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
=== modified file 'unity-private/launcher/quicklist-check-menu-item.vala'
--- unity-private/launcher/quicklist-check-menu-item.vala 2010-08-05 09:12:34 +0000
+++ unity-private/launcher/quicklist-check-menu-item.vala 2010-08-18 22:36:48 +0000
@@ -55,7 +55,9 @@
55 this.label,55 this.label,
56 out width,56 out width,
57 out height);57 out height);
58 min_width_p = (float) width + (float) Ctk.em_to_pixel (2 * MARGIN) + 30.0f;58 min_width_p = (float) width +
59 (float) Ctk.em_to_pixel (2 * MARGIN) +
60 ITEM_INDENT_ABS;
59 natural_width_p = min_width_p;61 natural_width_p = min_width_p;
60 }62 }
6163
@@ -125,15 +127,15 @@
125127
126 string formatted_label = Utils.strip_characters (label, "", "_", "_");128 string formatted_label = Utils.strip_characters (label, "", "_", "_");
127129
128 //Unity.QuicklistRendering.RadioItem.normal_mask (normal_cr,130 Unity.QuicklistRendering.RadioItem.normal_mask (normal_cr,
129 Unity.QuicklistRendering.CheckmarkItem.normal_mask (normal_cr,131 //Unity.QuicklistRendering.CheckmarkItem.normal_mask (normal_cr,
130 this.last_width,132 this.last_width,
131 this.last_height,133 this.last_height,
132 settings.gtk_font_name,134 settings.gtk_font_name,
133 formatted_label,135 formatted_label,
134 active);136 active);
135 //Unity.QuicklistRendering.RadioItem.selected_mask (selected_cr,137 Unity.QuicklistRendering.RadioItem.selected_mask (selected_cr,
136 Unity.QuicklistRendering.CheckmarkItem.selected_mask (selected_cr,138 //Unity.QuicklistRendering.CheckmarkItem.selected_mask (selected_cr,
137 this.last_width,139 this.last_width,
138 this.last_height,140 this.last_height,
139 settings.gtk_font_name,141 settings.gtk_font_name,
140142
=== modified file 'unity-private/launcher/quicklist-image-menu-item.vala'
--- unity-private/launcher/quicklist-image-menu-item.vala 2010-08-04 15:59:23 +0000
+++ unity-private/launcher/quicklist-image-menu-item.vala 2010-08-18 22:36:48 +0000
@@ -56,7 +56,9 @@
56 this.label,56 this.label,
57 out width,57 out width,
58 out height);58 out height);
59 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 ITEM_INDENT_ABS;
60 natural_width_p = min_width_p;62 natural_width_p = min_width_p;
61 }63 }
6264
6365
=== modified file 'unity-private/launcher/quicklist-menu-item.vala'
--- unity-private/launcher/quicklist-menu-item.vala 2010-08-04 15:59:23 +0000
+++ unity-private/launcher/quicklist-menu-item.vala 2010-08-18 22:36:48 +0000
@@ -57,7 +57,9 @@
57 this.label,57 this.label,
58 out width,58 out width,
59 out height);59 out height);
60 min_width_p = (float) width + (float) Ctk.em_to_pixel (2 * MARGIN);60 min_width_p = (float) width +
61 (float) Ctk.em_to_pixel (2 * MARGIN) +
62 2 * ITEM_INDENT_ABS;
61 natural_width_p = min_width_p;63 natural_width_p = min_width_p;
62 }64 }
6365
6466
=== modified file 'unity-private/launcher/quicklist-radio-menu-item.vala'
--- unity-private/launcher/quicklist-radio-menu-item.vala 2010-08-05 09:12:34 +0000
+++ unity-private/launcher/quicklist-radio-menu-item.vala 2010-08-18 22:36:48 +0000
@@ -55,7 +55,9 @@
55 this.label,55 this.label,
56 out width,56 out width,
57 out height);57 out height);
58 min_width_p = (float) width + (float) Ctk.em_to_pixel (2 * MARGIN) + 30.0f;58 min_width_p = (float) width +
59 (float) Ctk.em_to_pixel (2 * MARGIN) +
60 ITEM_INDENT_ABS;
59 natural_width_p = min_width_p;61 natural_width_p = min_width_p;
60 }62 }
6163
6264
=== modified file 'unity-private/launcher/quicklist-view.vala'
--- unity-private/launcher/quicklist-view.vala 2010-08-12 10:07:02 +0000
+++ unity-private/launcher/quicklist-view.vala 2010-08-18 22:36:48 +0000
@@ -34,6 +34,7 @@
34 const float ITEM_HEIGHT = 2.0f;34 const float ITEM_HEIGHT = 2.0f;
35 const float ITEM_CORNER_RADIUS = 0.3f;35 const float ITEM_CORNER_RADIUS = 0.3f;
36 const float ITEM_CORNER_RADIUS_ABS = 4.0f;36 const float ITEM_CORNER_RADIUS_ABS = 4.0f;
37 const float ITEM_INDENT_ABS = 20.0f;
37 const float ANCHOR_HEIGHT = 1.5f;38 const float ANCHOR_HEIGHT = 1.5f;
38 const float ANCHOR_HEIGHT_ABS = 18.0f;39 const float ANCHOR_HEIGHT_ABS = 18.0f;
39 const float ANCHOR_WIDTH = 0.75f;40 const float ANCHOR_WIDTH = 0.75f;
4041
=== modified file 'unity/quicklist-rendering.vala'
--- unity/quicklist-rendering.vala 2010-08-05 08:10:13 +0000
+++ unity/quicklist-rendering.vala 2010-08-18 22:36:48 +0000
@@ -35,6 +35,7 @@
35 const float ITEM_HEIGHT = 2.0f;35 const float ITEM_HEIGHT = 2.0f;
36 const float ITEM_CORNER_RADIUS = 0.3f;36 const float ITEM_CORNER_RADIUS = 0.3f;
37 const float ITEM_CORNER_RADIUS_ABS = 4.0f;37 const float ITEM_CORNER_RADIUS_ABS = 4.0f;
38 const float ITEM_INDENT_ABS = 20.0f;
38 const float ANCHOR_HEIGHT = 1.5f;39 const float ANCHOR_HEIGHT = 1.5f;
39 const float ANCHOR_HEIGHT_ABS = 18.0f;40 const float ANCHOR_HEIGHT_ABS = 18.0f;
40 const float ANCHOR_WIDTH = 0.75f;41 const float ANCHOR_WIDTH = 0.75f;
@@ -202,17 +203,8 @@
202203
203 // draw checkmark204 // draw checkmark
204 cr.save ();205 cr.save ();
205 cr.translate (_align ((30.0f - 16.0f) / 2.0f),206 cr.translate (_align ((ITEM_INDENT_ABS - 16.0f) / 2.0f),
206 _align (((double) h - 16.0f) / 2.0f));207 _align (((double) h - 16.0f)/ 2.0f));
207 cr.set_source_rgba (1.0f, 1.0f, 1.0f, 0.65f);
208 _round_rect (cr,
209 1.0f, // aspect
210 0.0f, // top-left corner
211 0.0f, // top-left corner
212 3.0f, // "size" of the corners
213 16.0f, // width of the rectangle
214 16.0f); // height of the rectangle
215 cr.stroke ();
216208
217 cr.set_source_rgba (1.0f, 1.0f, 1.0f, 1.0f);209 cr.set_source_rgba (1.0f, 1.0f, 1.0f, 1.0f);
218210
@@ -255,7 +247,7 @@
255 int text_width;247 int text_width;
256 int text_height;248 int text_height;
257 get_text_extents (font, text, out text_width, out text_height);249 get_text_extents (font, text, out text_width, out text_height);
258 cr.move_to (30.0f + Ctk.em_to_pixel (MARGIN),250 cr.move_to (ITEM_INDENT_ABS + Ctk.em_to_pixel (MARGIN),
259 (float) (h - text_height) / 2.0f);251 (float) (h - text_height) / 2.0f);
260252
261 Pango.cairo_show_layout (cr, layout);253 Pango.cairo_show_layout (cr, layout);
@@ -293,18 +285,9 @@
293285
294 // draw checkmark286 // draw checkmark
295 cr.save ();287 cr.save ();
296 cr.translate (_align ((30.0f - 16.0f) / 2.0f),288 cr.translate (_align ((ITEM_INDENT_ABS - 16.0f) / 2.0f),
297 _align (((double) h - 16.0f) / 2.0f));289 _align (((double) h - 16.0f) / 2.0f));
298290
299 _round_rect (cr,
300 1.0f, // aspect
301 0.0f, // top-left corner
302 0.0f, // top-left corner
303 3.0f, // "size" of the corners
304 16.0f, // width of the rectangle
305 16.0f); // height of the rectangle
306 cr.stroke ();
307
308 if (enabled)291 if (enabled)
309 {292 {
310 cr.translate (3.0f, 1.0f);293 cr.translate (3.0f, 1.0f);
@@ -344,7 +327,7 @@
344 int text_width;327 int text_width;
345 int text_height;328 int text_height;
346 get_text_extents (font, text, out text_width, out text_height);329 get_text_extents (font, text, out text_width, out text_height);
347 cr.move_to (30.0f + Ctk.em_to_pixel (MARGIN),330 cr.move_to (ITEM_INDENT_ABS + Ctk.em_to_pixel (MARGIN),
348 (float) (h - text_height) / 2.0f);331 (float) (h - text_height) / 2.0f);
349332
350 Pango.cairo_show_layout (cr, layout);333 Pango.cairo_show_layout (cr, layout);
@@ -371,7 +354,7 @@
371 cr.scale (1.0f, 1.0f);354 cr.scale (1.0f, 1.0f);
372 cr.set_line_width (1.0f);355 cr.set_line_width (1.0f);
373356
374 double x = _align (15.0f);357 double x = _align (ITEM_INDENT_ABS / 2.0f);
375 double y = _align ((double) h / 2.0f);358 double y = _align ((double) h / 2.0f);
376 double r1 = 3.5f;359 double r1 = 3.5f;
377 double r2 = 8.5f;360 double r2 = 8.5f;
@@ -383,17 +366,6 @@
383 cr.arc (x, y, r1, 0.0f * (GLib.Math.PI / 180.0f),366 cr.arc (x, y, r1, 0.0f * (GLib.Math.PI / 180.0f),
384 360.0f * (GLib.Math.PI / 180.0f));367 360.0f * (GLib.Math.PI / 180.0f));
385 cr.fill ();368 cr.fill ();
386 cr.set_source_rgba (1.0f, 1.0f, 1.0f, 0.65f);
387 cr.arc (x, y, r2, 0.0f * (GLib.Math.PI / 180.0f),
388 360.0f * (GLib.Math.PI / 180.0f));
389 cr.stroke ();
390 }
391 else
392 {
393 cr.set_source_rgba (1.0f, 1.0f, 1.0f, 0.65f);
394 cr.arc (x, y, r2, 0.0f * (GLib.Math.PI / 180.0f),
395 360.0f * (GLib.Math.PI / 180.0f));
396 cr.stroke ();
397 }369 }
398370
399 cr.set_source_rgba (1.0f, 1.0f, 1.0f, 1.0f);371 cr.set_source_rgba (1.0f, 1.0f, 1.0f, 1.0f);
@@ -419,7 +391,7 @@
419 int text_width;391 int text_width;
420 int text_height;392 int text_height;
421 get_text_extents (font, text, out text_width, out text_height);393 get_text_extents (font, text, out text_width, out text_height);
422 cr.move_to (30.0f + Ctk.em_to_pixel (MARGIN),394 cr.move_to (ITEM_INDENT_ABS + Ctk.em_to_pixel (MARGIN),
423 (float) (h - text_height) / 2.0f);395 (float) (h - text_height) / 2.0f);
424396
425 Pango.cairo_show_layout (cr, layout);397 Pango.cairo_show_layout (cr, layout);
@@ -452,7 +424,7 @@
452 h - 1.0f);424 h - 1.0f);
453 cr.fill ();425 cr.fill ();
454426
455 double x = _align (15.0f);427 double x = _align (ITEM_INDENT_ABS / 2.0f);
456 double y = _align ((double) h / 2.0f);428 double y = _align ((double) h / 2.0f);
457 double r1 = 3.5f;429 double r1 = 3.5f;
458 double r2 = 8.5f;430 double r2 = 8.5f;
@@ -465,16 +437,7 @@
465 cr.arc (x, y, r1, 0.0f * (GLib.Math.PI / 180.0f),437 cr.arc (x, y, r1, 0.0f * (GLib.Math.PI / 180.0f),
466 360.0f * (GLib.Math.PI / 180.0f));438 360.0f * (GLib.Math.PI / 180.0f));
467 cr.fill ();439 cr.fill ();
468 cr.arc (x, y, r2, 0.0f * (GLib.Math.PI / 180.0f),
469 360.0f * (GLib.Math.PI / 180.0f));
470 cr.stroke ();
471 }440 }
472 else
473 {
474 cr.arc (x, y, r2, 0.0f * (GLib.Math.PI / 180.0f),
475 360.0f * (GLib.Math.PI / 180.0f));
476 cr.stroke ();
477 }
478441
479 // draw text442 // draw text
480 Pango.Layout layout = Pango.cairo_create_layout (cr);443 Pango.Layout layout = Pango.cairo_create_layout (cr);
@@ -498,7 +461,7 @@
498 int text_width;461 int text_width;
499 int text_height;462 int text_height;
500 get_text_extents (font, text, out text_width, out text_height);463 get_text_extents (font, text, out text_width, out text_height);
501 cr.move_to (30.0f + Ctk.em_to_pixel (MARGIN),464 cr.move_to (ITEM_INDENT_ABS + Ctk.em_to_pixel (MARGIN),
502 (float) (h - text_height) / 2.0f);465 (float) (h - text_height) / 2.0f);
503466
504 Pango.cairo_show_layout (cr, layout);467 Pango.cairo_show_layout (cr, layout);
@@ -543,7 +506,7 @@
543 int text_width;506 int text_width;
544 int text_height;507 int text_height;
545 get_text_extents (font, text, out text_width, out text_height);508 get_text_extents (font, text, out text_width, out text_height);
546 cr.move_to (Ctk.em_to_pixel (MARGIN),509 cr.move_to (ITEM_INDENT_ABS + Ctk.em_to_pixel (MARGIN),
547 (float) (h - text_height) / 2.0f);510 (float) (h - text_height) / 2.0f);
548511
549 Pango.cairo_show_layout (cr, layout);512 Pango.cairo_show_layout (cr, layout);
@@ -597,7 +560,7 @@
597 int text_width;560 int text_width;
598 int text_height;561 int text_height;
599 get_text_extents (font, text, out text_width, out text_height);562 get_text_extents (font, text, out text_width, out text_height);
600 cr.move_to (Ctk.em_to_pixel (MARGIN),563 cr.move_to (ITEM_INDENT_ABS + Ctk.em_to_pixel (MARGIN),
601 (float) (h - text_height) / 2.0f);564 (float) (h - text_height) / 2.0f);
602565
603 cr.set_source_rgba (0.0f, 0.0f, 0.0f, 0.0f);566 cr.set_source_rgba (0.0f, 0.0f, 0.0f, 0.0f);