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
1=== added file 'resources/launcher_pip_large_ltr.png'
2Binary 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
3=== added file 'resources/launcher_pip_large_rtl.png'
4Binary 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
5=== modified file 'unity-shared/IconRenderer.cpp'
6--- unity-shared/IconRenderer.cpp 2013-03-11 22:18:58 +0000
7+++ unity-shared/IconRenderer.cpp 2013-03-18 18:23:24 +0000
8@@ -189,6 +189,8 @@
9 nux::BaseTexture* progress_bar_fill = 0;
10 nux::BaseTexture* pip_ltr = 0;
11 nux::BaseTexture* pip_rtl = 0;
12+nux::BaseTexture* large_pip_ltr = 0;
13+nux::BaseTexture* large_pip_rtl = 0;
14 nux::BaseTexture* arrow_ltr = 0;
15 nux::BaseTexture* arrow_rtl = 0;
16 nux::BaseTexture* arrow_empty_ltr = 0;
17@@ -890,8 +892,8 @@
18 if (running > 0)
19 {
20 int scale = 1;
21-
22 int markerX;
23+
24 if (pip_style == OUTSIDE_TILE)
25 {
26 markerX = geo.x;
27@@ -899,8 +901,7 @@
28 else
29 {
30 auto bounds = arg.icon->GetTransform(ui::IconTextureSource::TRANSFORM_TILE, monitor);
31- markerX = bounds[0].x + 2;
32- scale = 2;
33+ markerX = bounds[0].x + 1;
34 }
35
36 nux::TexCoordXForm texxform;
37@@ -921,26 +922,47 @@
38
39 if (!arg.running_on_viewport)
40 {
41+ scale = (pip_style == OUTSIDE_TILE) ? 1 : 2;
42 markers[0] = markerCenter;
43 texture = local::arrow_empty_ltr;
44 }
45 else if (running == 1)
46 {
47+ scale = (pip_style == OUTSIDE_TILE) ? 1 : 2;
48 markers[0] = markerCenter;
49 texture = local::arrow_ltr;
50 }
51 else if (running == 2)
52 {
53- markers[0] = markerCenter - 2 * scale;
54- markers[1] = markerCenter + 2 * scale;
55- texture = local::pip_ltr;
56+ if (pip_style == OUTSIDE_TILE)
57+ {
58+ texture = local::pip_ltr;
59+ markers[0] = markerCenter - 2;
60+ markers[1] = markerCenter + 2;
61+ }
62+ else
63+ {
64+ texture = local::large_pip_ltr;
65+ markers[0] = markerCenter - 4;
66+ markers[1] = markerCenter + 4;
67+ }
68 }
69 else
70 {
71- markers[0] = markerCenter - 4 * scale;
72- markers[1] = markerCenter;
73- markers[2] = markerCenter + 4 * scale;
74- texture = local::pip_ltr;
75+ if (pip_style == OUTSIDE_TILE)
76+ {
77+ texture = local::pip_ltr;
78+ markers[0] = markerCenter - 4;
79+ markers[1] = markerCenter;
80+ markers[2] = markerCenter + 4;
81+ }
82+ else
83+ {
84+ texture = local::large_pip_ltr;
85+ markers[0] = markerCenter - 8;
86+ markers[1] = markerCenter;
87+ markers[2] = markerCenter + 8;
88+ }
89 }
90
91
92@@ -1223,10 +1245,12 @@
93 // squircle_shine = load_texture(PKGDATADIR"/squircle_shine_54.png");
94
95 pip_ltr = load_texture(PKGDATADIR"/launcher_pip_ltr.png");
96+ large_pip_ltr = load_texture(PKGDATADIR"/launcher_pip_large_ltr.png");
97 arrow_ltr = load_texture(PKGDATADIR"/launcher_arrow_ltr.png");
98 arrow_empty_ltr = load_texture(PKGDATADIR"/launcher_arrow_outline_ltr.png");
99
100 pip_rtl = load_texture(PKGDATADIR"/launcher_pip_rtl.png");
101+ large_pip_rtl = load_texture(PKGDATADIR"/launcher_pip_large_rt.png");
102 arrow_rtl = load_texture(PKGDATADIR"/launcher_arrow_rtl.png");
103 arrow_empty_rtl = load_texture(PKGDATADIR"/launcher_arrow_outline_rtl.png");
104
105@@ -1253,6 +1277,8 @@
106 progress_bar_fill->UnReference();
107 pip_ltr->UnReference();
108 pip_rtl->UnReference();
109+ large_pip_ltr->UnReference();
110+ large_pip_rtl->UnReference();
111 arrow_ltr->UnReference();
112 arrow_rtl->UnReference();
113 arrow_empty_ltr->UnReference();