Merge lp:~unity-team/unity/unity.more-visual-quicklist-tweaks into lp:unity

Proposed by Mirco Müller
Status: Merged
Merged at revision: 445
Proposed branch: lp:~unity-team/unity/unity.more-visual-quicklist-tweaks
Merge into: lp:unity
Diff against target: 250 lines (+29/-57)
6 files modified
unity-private/launcher/quicklist-check-menu-item.vala (+7/-5)
unity-private/launcher/quicklist-image-menu-item.vala (+3/-1)
unity-private/launcher/quicklist-menu-item.vala (+3/-1)
unity-private/launcher/quicklist-radio-menu-item.vala (+3/-1)
unity-private/launcher/quicklist-view.vala (+1/-0)
unity/quicklist-rendering.vala (+12/-49)
To merge this branch: bzr merge lp:~unity-team/unity/unity.more-visual-quicklist-tweaks
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Approve
Review via email: mp+33063@code.launchpad.net

Description of the change

This branch uses the new (leaner) visuals for checkmark- and radiobutton-items in quicklists. It also indents all items (normal, image, checkmark, radio-button). Due to this and the fact that quicklists are meant to grow out of tooltips, the label of a tooltip is now also indented (balanced with a gap on the right side to... this was done after consulting Design).

Disabled options are not yet covered as their state is currently only map-able to the reactive-flag, which is already used to avoid highlighting the tooltip-label (name of the quicklist) thus users don't expect this entry to be selectable and perform an action.

The new layout of the tooltips, making them denser in appearance, conflicts with the way expand-animations work. Design has not covered that yet. We'll address this after the merge window tomorrow, as it is a very involved issue.

To post a comment you must log in.
Revision history for this message
Neil J. Patel (njpatel) wrote :

Looks good, approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'unity-private/launcher/quicklist-check-menu-item.vala'
2--- unity-private/launcher/quicklist-check-menu-item.vala 2010-08-05 09:12:34 +0000
3+++ unity-private/launcher/quicklist-check-menu-item.vala 2010-08-18 22:36:48 +0000
4@@ -55,7 +55,9 @@
5 this.label,
6 out width,
7 out height);
8- min_width_p = (float) width + (float) Ctk.em_to_pixel (2 * MARGIN) + 30.0f;
9+ min_width_p = (float) width +
10+ (float) Ctk.em_to_pixel (2 * MARGIN) +
11+ ITEM_INDENT_ABS;
12 natural_width_p = min_width_p;
13 }
14
15@@ -125,15 +127,15 @@
16
17 string formatted_label = Utils.strip_characters (label, "", "_", "_");
18
19- //Unity.QuicklistRendering.RadioItem.normal_mask (normal_cr,
20- Unity.QuicklistRendering.CheckmarkItem.normal_mask (normal_cr,
21+ Unity.QuicklistRendering.RadioItem.normal_mask (normal_cr,
22+ //Unity.QuicklistRendering.CheckmarkItem.normal_mask (normal_cr,
23 this.last_width,
24 this.last_height,
25 settings.gtk_font_name,
26 formatted_label,
27 active);
28- //Unity.QuicklistRendering.RadioItem.selected_mask (selected_cr,
29- Unity.QuicklistRendering.CheckmarkItem.selected_mask (selected_cr,
30+ Unity.QuicklistRendering.RadioItem.selected_mask (selected_cr,
31+ //Unity.QuicklistRendering.CheckmarkItem.selected_mask (selected_cr,
32 this.last_width,
33 this.last_height,
34 settings.gtk_font_name,
35
36=== modified file 'unity-private/launcher/quicklist-image-menu-item.vala'
37--- unity-private/launcher/quicklist-image-menu-item.vala 2010-08-04 15:59:23 +0000
38+++ unity-private/launcher/quicklist-image-menu-item.vala 2010-08-18 22:36:48 +0000
39@@ -56,7 +56,9 @@
40 this.label,
41 out width,
42 out height);
43- min_width_p = (float) width + (float) Ctk.em_to_pixel (2 * MARGIN);
44+ min_width_p = (float) width +
45+ (float) Ctk.em_to_pixel (2 * MARGIN) +
46+ ITEM_INDENT_ABS;
47 natural_width_p = min_width_p;
48 }
49
50
51=== modified file 'unity-private/launcher/quicklist-menu-item.vala'
52--- unity-private/launcher/quicklist-menu-item.vala 2010-08-04 15:59:23 +0000
53+++ unity-private/launcher/quicklist-menu-item.vala 2010-08-18 22:36:48 +0000
54@@ -57,7 +57,9 @@
55 this.label,
56 out width,
57 out height);
58- min_width_p = (float) width + (float) Ctk.em_to_pixel (2 * MARGIN);
59+ min_width_p = (float) width +
60+ (float) Ctk.em_to_pixel (2 * MARGIN) +
61+ 2 * ITEM_INDENT_ABS;
62 natural_width_p = min_width_p;
63 }
64
65
66=== modified file 'unity-private/launcher/quicklist-radio-menu-item.vala'
67--- unity-private/launcher/quicklist-radio-menu-item.vala 2010-08-05 09:12:34 +0000
68+++ unity-private/launcher/quicklist-radio-menu-item.vala 2010-08-18 22:36:48 +0000
69@@ -55,7 +55,9 @@
70 this.label,
71 out width,
72 out height);
73- min_width_p = (float) width + (float) Ctk.em_to_pixel (2 * MARGIN) + 30.0f;
74+ min_width_p = (float) width +
75+ (float) Ctk.em_to_pixel (2 * MARGIN) +
76+ ITEM_INDENT_ABS;
77 natural_width_p = min_width_p;
78 }
79
80
81=== modified file 'unity-private/launcher/quicklist-view.vala'
82--- unity-private/launcher/quicklist-view.vala 2010-08-12 10:07:02 +0000
83+++ unity-private/launcher/quicklist-view.vala 2010-08-18 22:36:48 +0000
84@@ -34,6 +34,7 @@
85 const float ITEM_HEIGHT = 2.0f;
86 const float ITEM_CORNER_RADIUS = 0.3f;
87 const float ITEM_CORNER_RADIUS_ABS = 4.0f;
88+ const float ITEM_INDENT_ABS = 20.0f;
89 const float ANCHOR_HEIGHT = 1.5f;
90 const float ANCHOR_HEIGHT_ABS = 18.0f;
91 const float ANCHOR_WIDTH = 0.75f;
92
93=== modified file 'unity/quicklist-rendering.vala'
94--- unity/quicklist-rendering.vala 2010-08-05 08:10:13 +0000
95+++ unity/quicklist-rendering.vala 2010-08-18 22:36:48 +0000
96@@ -35,6 +35,7 @@
97 const float ITEM_HEIGHT = 2.0f;
98 const float ITEM_CORNER_RADIUS = 0.3f;
99 const float ITEM_CORNER_RADIUS_ABS = 4.0f;
100+ const float ITEM_INDENT_ABS = 20.0f;
101 const float ANCHOR_HEIGHT = 1.5f;
102 const float ANCHOR_HEIGHT_ABS = 18.0f;
103 const float ANCHOR_WIDTH = 0.75f;
104@@ -202,17 +203,8 @@
105
106 // draw checkmark
107 cr.save ();
108- cr.translate (_align ((30.0f - 16.0f) / 2.0f),
109- _align (((double) h - 16.0f) / 2.0f));
110- cr.set_source_rgba (1.0f, 1.0f, 1.0f, 0.65f);
111- _round_rect (cr,
112- 1.0f, // aspect
113- 0.0f, // top-left corner
114- 0.0f, // top-left corner
115- 3.0f, // "size" of the corners
116- 16.0f, // width of the rectangle
117- 16.0f); // height of the rectangle
118- cr.stroke ();
119+ cr.translate (_align ((ITEM_INDENT_ABS - 16.0f) / 2.0f),
120+ _align (((double) h - 16.0f)/ 2.0f));
121
122 cr.set_source_rgba (1.0f, 1.0f, 1.0f, 1.0f);
123
124@@ -255,7 +247,7 @@
125 int text_width;
126 int text_height;
127 get_text_extents (font, text, out text_width, out text_height);
128- cr.move_to (30.0f + Ctk.em_to_pixel (MARGIN),
129+ cr.move_to (ITEM_INDENT_ABS + Ctk.em_to_pixel (MARGIN),
130 (float) (h - text_height) / 2.0f);
131
132 Pango.cairo_show_layout (cr, layout);
133@@ -293,18 +285,9 @@
134
135 // draw checkmark
136 cr.save ();
137- cr.translate (_align ((30.0f - 16.0f) / 2.0f),
138+ cr.translate (_align ((ITEM_INDENT_ABS - 16.0f) / 2.0f),
139 _align (((double) h - 16.0f) / 2.0f));
140
141- _round_rect (cr,
142- 1.0f, // aspect
143- 0.0f, // top-left corner
144- 0.0f, // top-left corner
145- 3.0f, // "size" of the corners
146- 16.0f, // width of the rectangle
147- 16.0f); // height of the rectangle
148- cr.stroke ();
149-
150 if (enabled)
151 {
152 cr.translate (3.0f, 1.0f);
153@@ -344,7 +327,7 @@
154 int text_width;
155 int text_height;
156 get_text_extents (font, text, out text_width, out text_height);
157- cr.move_to (30.0f + Ctk.em_to_pixel (MARGIN),
158+ cr.move_to (ITEM_INDENT_ABS + Ctk.em_to_pixel (MARGIN),
159 (float) (h - text_height) / 2.0f);
160
161 Pango.cairo_show_layout (cr, layout);
162@@ -371,7 +354,7 @@
163 cr.scale (1.0f, 1.0f);
164 cr.set_line_width (1.0f);
165
166- double x = _align (15.0f);
167+ double x = _align (ITEM_INDENT_ABS / 2.0f);
168 double y = _align ((double) h / 2.0f);
169 double r1 = 3.5f;
170 double r2 = 8.5f;
171@@ -383,17 +366,6 @@
172 cr.arc (x, y, r1, 0.0f * (GLib.Math.PI / 180.0f),
173 360.0f * (GLib.Math.PI / 180.0f));
174 cr.fill ();
175- cr.set_source_rgba (1.0f, 1.0f, 1.0f, 0.65f);
176- cr.arc (x, y, r2, 0.0f * (GLib.Math.PI / 180.0f),
177- 360.0f * (GLib.Math.PI / 180.0f));
178- cr.stroke ();
179- }
180- else
181- {
182- cr.set_source_rgba (1.0f, 1.0f, 1.0f, 0.65f);
183- cr.arc (x, y, r2, 0.0f * (GLib.Math.PI / 180.0f),
184- 360.0f * (GLib.Math.PI / 180.0f));
185- cr.stroke ();
186 }
187
188 cr.set_source_rgba (1.0f, 1.0f, 1.0f, 1.0f);
189@@ -419,7 +391,7 @@
190 int text_width;
191 int text_height;
192 get_text_extents (font, text, out text_width, out text_height);
193- cr.move_to (30.0f + Ctk.em_to_pixel (MARGIN),
194+ cr.move_to (ITEM_INDENT_ABS + Ctk.em_to_pixel (MARGIN),
195 (float) (h - text_height) / 2.0f);
196
197 Pango.cairo_show_layout (cr, layout);
198@@ -452,7 +424,7 @@
199 h - 1.0f);
200 cr.fill ();
201
202- double x = _align (15.0f);
203+ double x = _align (ITEM_INDENT_ABS / 2.0f);
204 double y = _align ((double) h / 2.0f);
205 double r1 = 3.5f;
206 double r2 = 8.5f;
207@@ -465,16 +437,7 @@
208 cr.arc (x, y, r1, 0.0f * (GLib.Math.PI / 180.0f),
209 360.0f * (GLib.Math.PI / 180.0f));
210 cr.fill ();
211- cr.arc (x, y, r2, 0.0f * (GLib.Math.PI / 180.0f),
212- 360.0f * (GLib.Math.PI / 180.0f));
213- cr.stroke ();
214 }
215- else
216- {
217- cr.arc (x, y, r2, 0.0f * (GLib.Math.PI / 180.0f),
218- 360.0f * (GLib.Math.PI / 180.0f));
219- cr.stroke ();
220- }
221
222 // draw text
223 Pango.Layout layout = Pango.cairo_create_layout (cr);
224@@ -498,7 +461,7 @@
225 int text_width;
226 int text_height;
227 get_text_extents (font, text, out text_width, out text_height);
228- cr.move_to (30.0f + Ctk.em_to_pixel (MARGIN),
229+ cr.move_to (ITEM_INDENT_ABS + Ctk.em_to_pixel (MARGIN),
230 (float) (h - text_height) / 2.0f);
231
232 Pango.cairo_show_layout (cr, layout);
233@@ -543,7 +506,7 @@
234 int text_width;
235 int text_height;
236 get_text_extents (font, text, out text_width, out text_height);
237- cr.move_to (Ctk.em_to_pixel (MARGIN),
238+ cr.move_to (ITEM_INDENT_ABS + Ctk.em_to_pixel (MARGIN),
239 (float) (h - text_height) / 2.0f);
240
241 Pango.cairo_show_layout (cr, layout);
242@@ -597,7 +560,7 @@
243 int text_width;
244 int text_height;
245 get_text_extents (font, text, out text_width, out text_height);
246- cr.move_to (Ctk.em_to_pixel (MARGIN),
247+ cr.move_to (ITEM_INDENT_ABS + Ctk.em_to_pixel (MARGIN),
248 (float) (h - text_height) / 2.0f);
249
250 cr.set_source_rgba (0.0f, 0.0f, 0.0f, 0.0f);