Merge lp:~3v1n0/unity/bigger-switcher-pips into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 3225
Proposed branch: lp:~3v1n0/unity/bigger-switcher-pips
Merge into: lp:unity
Diff against target: 113 lines (+36/-10)
1 file modified
unity-shared/IconRenderer.cpp (+36/-10)
To merge this branch: bzr merge lp:~3v1n0/unity/bigger-switcher-pips
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Andrea Azzarone (community) code Approve
Review via email: mp+153896@code.launchpad.net

Commit message

IconRenderer: use bigger assets to draw pips inside tile (in Switcher)

Description of the change

Added new bigger assets to draw the pips in the switcher (in INSIDE mode) and use them for a nicer switcher (finally!):
http://ubuntuone.com/3OHNSYwy5Cd4qNWtWFVV0Y
http://ubuntuone.com/1cLqExRsJWKZZSdxKfmRaE (with launcher)

Matthieu James has approved the change design side:
19:00:57 <tiheum> It's nice like that.

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

LGTM

review: Approve (code)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'resources/launcher_pip_large_ltr.png'
0Binary files resources/launcher_pip_large_ltr.png 1970-01-01 00:00:00 +0000 and resources/launcher_pip_large_ltr.png 2013-03-18 18:23:24 +0000 differ0Binary files resources/launcher_pip_large_ltr.png 1970-01-01 00:00:00 +0000 and resources/launcher_pip_large_ltr.png 2013-03-18 18:23:24 +0000 differ
=== added file 'resources/launcher_pip_large_rtl.png'
1Binary files resources/launcher_pip_large_rtl.png 1970-01-01 00:00:00 +0000 and resources/launcher_pip_large_rtl.png 2013-03-18 18:23:24 +0000 differ1Binary files resources/launcher_pip_large_rtl.png 1970-01-01 00:00:00 +0000 and resources/launcher_pip_large_rtl.png 2013-03-18 18:23:24 +0000 differ
=== modified file 'unity-shared/IconRenderer.cpp'
--- unity-shared/IconRenderer.cpp 2013-03-11 22:18:58 +0000
+++ unity-shared/IconRenderer.cpp 2013-03-18 18:23:24 +0000
@@ -189,6 +189,8 @@
189nux::BaseTexture* progress_bar_fill = 0;189nux::BaseTexture* progress_bar_fill = 0;
190nux::BaseTexture* pip_ltr = 0;190nux::BaseTexture* pip_ltr = 0;
191nux::BaseTexture* pip_rtl = 0;191nux::BaseTexture* pip_rtl = 0;
192nux::BaseTexture* large_pip_ltr = 0;
193nux::BaseTexture* large_pip_rtl = 0;
192nux::BaseTexture* arrow_ltr = 0;194nux::BaseTexture* arrow_ltr = 0;
193nux::BaseTexture* arrow_rtl = 0;195nux::BaseTexture* arrow_rtl = 0;
194nux::BaseTexture* arrow_empty_ltr = 0;196nux::BaseTexture* arrow_empty_ltr = 0;
@@ -890,8 +892,8 @@
890 if (running > 0)892 if (running > 0)
891 {893 {
892 int scale = 1;894 int scale = 1;
893
894 int markerX;895 int markerX;
896
895 if (pip_style == OUTSIDE_TILE)897 if (pip_style == OUTSIDE_TILE)
896 {898 {
897 markerX = geo.x;899 markerX = geo.x;
@@ -899,8 +901,7 @@
899 else901 else
900 {902 {
901 auto bounds = arg.icon->GetTransform(ui::IconTextureSource::TRANSFORM_TILE, monitor);903 auto bounds = arg.icon->GetTransform(ui::IconTextureSource::TRANSFORM_TILE, monitor);
902 markerX = bounds[0].x + 2;904 markerX = bounds[0].x + 1;
903 scale = 2;
904 }905 }
905906
906 nux::TexCoordXForm texxform;907 nux::TexCoordXForm texxform;
@@ -921,26 +922,47 @@
921922
922 if (!arg.running_on_viewport)923 if (!arg.running_on_viewport)
923 {924 {
925 scale = (pip_style == OUTSIDE_TILE) ? 1 : 2;
924 markers[0] = markerCenter;926 markers[0] = markerCenter;
925 texture = local::arrow_empty_ltr;927 texture = local::arrow_empty_ltr;
926 }928 }
927 else if (running == 1)929 else if (running == 1)
928 {930 {
931 scale = (pip_style == OUTSIDE_TILE) ? 1 : 2;
929 markers[0] = markerCenter;932 markers[0] = markerCenter;
930 texture = local::arrow_ltr;933 texture = local::arrow_ltr;
931 }934 }
932 else if (running == 2)935 else if (running == 2)
933 {936 {
934 markers[0] = markerCenter - 2 * scale;937 if (pip_style == OUTSIDE_TILE)
935 markers[1] = markerCenter + 2 * scale;938 {
936 texture = local::pip_ltr;939 texture = local::pip_ltr;
940 markers[0] = markerCenter - 2;
941 markers[1] = markerCenter + 2;
942 }
943 else
944 {
945 texture = local::large_pip_ltr;
946 markers[0] = markerCenter - 4;
947 markers[1] = markerCenter + 4;
948 }
937 }949 }
938 else950 else
939 {951 {
940 markers[0] = markerCenter - 4 * scale;952 if (pip_style == OUTSIDE_TILE)
941 markers[1] = markerCenter;953 {
942 markers[2] = markerCenter + 4 * scale;954 texture = local::pip_ltr;
943 texture = local::pip_ltr;955 markers[0] = markerCenter - 4;
956 markers[1] = markerCenter;
957 markers[2] = markerCenter + 4;
958 }
959 else
960 {
961 texture = local::large_pip_ltr;
962 markers[0] = markerCenter - 8;
963 markers[1] = markerCenter;
964 markers[2] = markerCenter + 8;
965 }
944 }966 }
945967
946968
@@ -1223,10 +1245,12 @@
1223 // squircle_shine = load_texture(PKGDATADIR"/squircle_shine_54.png");1245 // squircle_shine = load_texture(PKGDATADIR"/squircle_shine_54.png");
12241246
1225 pip_ltr = load_texture(PKGDATADIR"/launcher_pip_ltr.png");1247 pip_ltr = load_texture(PKGDATADIR"/launcher_pip_ltr.png");
1248 large_pip_ltr = load_texture(PKGDATADIR"/launcher_pip_large_ltr.png");
1226 arrow_ltr = load_texture(PKGDATADIR"/launcher_arrow_ltr.png");1249 arrow_ltr = load_texture(PKGDATADIR"/launcher_arrow_ltr.png");
1227 arrow_empty_ltr = load_texture(PKGDATADIR"/launcher_arrow_outline_ltr.png");1250 arrow_empty_ltr = load_texture(PKGDATADIR"/launcher_arrow_outline_ltr.png");
12281251
1229 pip_rtl = load_texture(PKGDATADIR"/launcher_pip_rtl.png");1252 pip_rtl = load_texture(PKGDATADIR"/launcher_pip_rtl.png");
1253 large_pip_rtl = load_texture(PKGDATADIR"/launcher_pip_large_rt.png");
1230 arrow_rtl = load_texture(PKGDATADIR"/launcher_arrow_rtl.png");1254 arrow_rtl = load_texture(PKGDATADIR"/launcher_arrow_rtl.png");
1231 arrow_empty_rtl = load_texture(PKGDATADIR"/launcher_arrow_outline_rtl.png");1255 arrow_empty_rtl = load_texture(PKGDATADIR"/launcher_arrow_outline_rtl.png");
12321256
@@ -1253,6 +1277,8 @@
1253 progress_bar_fill->UnReference();1277 progress_bar_fill->UnReference();
1254 pip_ltr->UnReference();1278 pip_ltr->UnReference();
1255 pip_rtl->UnReference();1279 pip_rtl->UnReference();
1280 large_pip_ltr->UnReference();
1281 large_pip_rtl->UnReference();
1256 arrow_ltr->UnReference();1282 arrow_ltr->UnReference();
1257 arrow_rtl->UnReference();1283 arrow_rtl->UnReference();
1258 arrow_empty_ltr->UnReference();1284 arrow_empty_ltr->UnReference();