Merge lp:~unity-team/unity/unity.design-fixes-16-09 into lp:unity

Proposed by Gord Allott
Status: Merged
Merged at revision: 515
Proposed branch: lp:~unity-team/unity/unity.design-fixes-16-09
Merge into: lp:unity
Diff against target: 383 lines (+130/-47)
7 files modified
unity-private/launcher/quicklist-controller.vala (+5/-2)
unity-private/launcher/quicklist-menu-item.vala (+2/-1)
unity-private/launcher/scroller-model.vala (+0/-1)
unity-private/launcher/scroller-view.vala (+74/-15)
unity-private/launcher/scrollerchild-controller.vala (+1/-1)
unity-private/launcher/scrollerchild.vala (+46/-27)
unity/icon-postprocessor.vala (+2/-0)
To merge this branch: bzr merge lp:~unity-team/unity/unity.design-fixes-16-09
Reviewer Review Type Date Requested Status
Mikkel Kamstrup Erlandsen (community) Approve
Review via email: mp+35732@code.launchpad.net

This proposal supersedes a proposal from 2010-09-16.

Description of the change

design fixes for the launcher, hope launchpad has been clever and linked the bugs down there

To post a comment you must log in.
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

FUNCTIONAL:

Bug #632985: launcher mouse wheel dragging artifacts
 - I can still reproduce this when I have the dash open - can you recheck this? (not crucial for merging though)

Bug #627488: Running indicator on special launchers
 - Fix confirmed

Bug #632991: launcher mouse wheel dragging elastic band jittering
 - Couldn't reproduce, dragging a tile while mw-scrolling seemed smooth

Bug #633084: arrows position in folded launcher tiles
 - arrow position looks right to me

CODE:
Looks good

Nice job! 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-controller.vala'
2--- unity-private/launcher/quicklist-controller.vala 2010-09-16 00:04:23 +0000
3+++ unity-private/launcher/quicklist-controller.vala 2010-09-16 20:23:26 +0000
4@@ -161,11 +161,13 @@
5 if (Unity.global_shell is Unity.Shell)
6 Unity.global_shell.remove_fullscreen_request (this);
7
8- if (state == QuicklistControllerState.CLOSED) return;
9+ if (state == QuicklistControllerState.CLOSED)
10+ {
11+ return;
12+ }
13 if (menu == null)
14 {
15 new_menu ();
16- warning ("state change called on menu when menu does not exist");
17 }
18
19 if (state == QuicklistControllerState.LABEL)
20@@ -190,6 +192,7 @@
21 menu.compute_style_textures ();
22 menu.set_expansion_size_factor (0.0f);
23 menu.set_anchor_position (x + w - 4, y + h/2.0f, 0);
24+
25 }
26 else if (state == QuicklistControllerState.MENU)
27 {
28
29=== modified file 'unity-private/launcher/quicklist-menu-item.vala'
30--- unity-private/launcher/quicklist-menu-item.vala 2010-09-03 11:16:52 +0000
31+++ unity-private/launcher/quicklist-menu-item.vala 2010-09-16 20:23:26 +0000
32@@ -84,7 +84,8 @@
33 last_width = new_width;
34 last_height = new_height;
35
36- Timeout.add (0, _update_item_background);
37+ _update_item_background (); // removed the timeout because it was causing a frame of lag
38+ //Timeout.add (0, _update_item_background);
39 }
40
41 private bool
42
43=== modified file 'unity-private/launcher/scroller-model.vala'
44--- unity-private/launcher/scroller-model.vala 2010-08-01 19:50:39 +0000
45+++ unity-private/launcher/scroller-model.vala 2010-09-16 20:23:26 +0000
46@@ -155,7 +155,6 @@
47
48 children.remove (child);
49 child_removed (tempchild);
50- order_changed ();
51 }
52
53 public void insert (ScrollerChild child, int i)
54
55=== modified file 'unity-private/launcher/scroller-view.vala'
56--- unity-private/launcher/scroller-view.vala 2010-09-14 11:35:55 +0000
57+++ unity-private/launcher/scroller-view.vala 2010-09-16 20:23:26 +0000
58@@ -84,6 +84,9 @@
59 private float last_known_pointer_x = 0.0f;
60 private bool can_scroll = false;
61
62+ private float last_known_x = 0;
63+ private float last_known_y = 0;
64+
65 /*
66 * scrolling variables
67 */
68@@ -264,6 +267,8 @@
69
70 float x, y;
71 event.get_coords (out x, out y);
72+ last_known_x = x;
73+ last_known_y = y;
74 if (assume_on_launcher)
75 x = 25;
76
77@@ -299,6 +304,7 @@
78 {
79 // if picked_actor is null, then we want to send a leave event on the
80 // previous actor
81+
82 Clutter.Event crossing_event = { 0 };
83 crossing_event.type = Clutter.EventType.LEAVE;
84 crossing_event.crossing.x = x;
85@@ -325,6 +331,7 @@
86 {
87 get_stage ().motion_event.disconnect (on_motion_event);
88 }
89+
90 Clutter.Actor picked_actor = handle_event (event, is_scrolling);
91
92 if (picked_actor is Clutter.Actor)
93@@ -711,6 +718,7 @@
94 */
95 private void disable_animations_on_children (Clutter.Event event)
96 {
97+/*
98 disable_child_events = true;
99
100 Clutter.Event e = { 0 };
101@@ -729,6 +737,7 @@
102 child.do_event (e, false);
103 }
104 }
105+*/
106
107 }
108
109@@ -795,10 +804,30 @@
110 child.set_parent (this);
111
112 // we only animate if the added child is not at the end
113- if (model.index_of (child) == model.size -1)
114- order_children (true);
115- else
116- order_children (false);
117+ float[] prev_positions = {};//new float [model.size];
118+ float[] prev_rotations = {};//new float [model.size];
119+
120+ foreach (ScrollerChild modelchild in model)
121+ {
122+ prev_positions += modelchild.position;
123+ prev_rotations += modelchild.rotation;
124+ }
125+ order_children (true);
126+
127+ int index = 0;
128+ foreach (ScrollerChild modelchild in model)
129+ {
130+ if (child != modelchild)
131+ {
132+ change_child_position_rotation (modelchild,
133+ prev_positions[index],
134+ prev_rotations[index],
135+ true);
136+ }
137+ index++;
138+ }
139+
140+ order_children (false);
141 queue_relayout ();
142 child.notify["position"].connect (() => {
143 queue_relayout ();
144@@ -809,17 +838,30 @@
145
146 private void model_child_removed (ScrollerChild child)
147 {
148- child_refs.add (child); // we need to keep a reference on it for now
149- var anim = child.animate (Clutter.AnimationMode.EASE_OUT_QUAD,
150- SHORT_DELAY,
151- "opacity", 0);
152- anim.completed.connect (() => {
153- child.unparent ();
154- child_refs.remove (child);
155- });
156+ var drag_controller = Drag.Controller.get_default ();
157+ if (drag_controller.is_dragging)
158+ {
159+ order_children (false);
160+ queue_relayout ();
161+ }
162+ else
163+ {
164+ child_refs.add (child); // we need to keep a reference on it for now
165+ var anim = child.animate (Clutter.AnimationMode.EASE_OUT_QUAD,
166+ SHORT_DELAY,
167+ "opacity", 0);
168
169- order_children (false);
170- queue_relayout ();
171+ var icon_scale_anim = child.processed_icon.animate (Clutter.AnimationMode.EASE_OUT_QUAD,
172+ SHORT_DELAY,
173+ "scale-x", 0.0,
174+ "scale-y", 0.0);
175+ anim.completed.connect (() => {
176+ child.unparent ();
177+ child_refs.remove (child);
178+ order_children (false);
179+ queue_relayout ();
180+ });
181+ }
182 }
183
184 private void model_order_changed ()
185@@ -839,6 +881,15 @@
186 speed *= autoscroll_direction;
187 move_scroll_position (speed, true);
188 autoscroll_anim_active = is_autoscrolling;
189+
190+ Clutter.Event motion_event = { 0 };
191+ motion_event.type = Clutter.EventType.MOTION;
192+ motion_event.motion.x = last_known_x;
193+ motion_event.motion.y = last_known_y;
194+ motion_event.motion.stage = get_stage () as Clutter.Stage;
195+ motion_event.motion.flags = Clutter.EventFlags.FLAG_SYNTHETIC;
196+ passthrough_motion_event (motion_event);
197+
198 return is_autoscrolling;
199 });
200 }
201@@ -1166,6 +1217,14 @@
202 else
203 cache.invalidate_texture_cache ();
204
205+ Clutter.Event motion_event = { 0 };
206+ motion_event.type = Clutter.EventType.MOTION;
207+ motion_event.motion.x = last_known_x;
208+ motion_event.motion.y = last_known_y;
209+ motion_event.motion.stage = get_stage () as Clutter.Stage;
210+ motion_event.motion.flags = Clutter.EventFlags.FLAG_SYNTHETIC;
211+ passthrough_motion_event (motion_event);
212+
213 stored_delta = delta;
214 }
215
216@@ -1476,7 +1535,7 @@
217 if (index >= index_start_flat && index < index_end_flat)
218 {
219 change_child_position_rotation (child, h, 0.0f, immediate);
220- h += nat_height + spacing;
221+ h += 48 + spacing;
222 num_children_handled++;
223
224 if (index == index_start_flat)
225
226=== modified file 'unity-private/launcher/scrollerchild-controller.vala'
227--- unity-private/launcher/scrollerchild-controller.vala 2010-09-14 11:48:10 +0000
228+++ unity-private/launcher/scrollerchild-controller.vala 2010-09-16 20:23:26 +0000
229@@ -59,7 +59,7 @@
230 construct
231 {
232 theme_file_path = new Unity.ThemeFilePath ();
233- name = "Bug Found, You Defeated Unity, +20 exp";
234+ name = "Bug Found, You Defeated Unity, +20,000 exp";
235 child.controller = this;
236 child.button_press_event.connect (on_press_event);
237 child.button_release_event.connect (on_release_event);
238
239=== modified file 'unity-private/launcher/scrollerchild.vala'
240--- unity-private/launcher/scrollerchild.vala 2010-08-26 15:11:32 +0000
241+++ unity-private/launcher/scrollerchild.vala 2010-09-16 20:23:26 +0000
242@@ -85,7 +85,7 @@
243 opacity);
244 }
245
246- private UnityIcon processed_icon;
247+ public UnityIcon processed_icon;
248 private ThemeImage close_symbol;
249 private ThemeImage active_indicator;
250 private ThemeImage running_indicator_notify;
251@@ -221,27 +221,27 @@
252 }
253 }
254
255- private bool previous_close_state = false;
256- private void on_enable_close_state_changed ()
257- {
258- if (enable_close_state == true && previous_close_state == false)
259- {
260- close_symbol.animate (Clutter.AnimationMode.EASE_OUT_CUBIC,
261- 300,
262- "opacity", 0xff,
263- "scale-x", 1.0,
264- "scale-y", 1.0);
265- }
266- else if (enable_close_state == false && previous_close_state == true)
267- {
268- close_symbol.animate (Clutter.AnimationMode.EASE_OUT_CUBIC,
269- 300,
270- "opacity", 0x00,
271- "scale-x", 0.0,
272- "scale-y", 0.0);
273- }
274- previous_close_state = enable_close_state;
275- }
276+ private bool previous_close_state = false;
277+ private void on_enable_close_state_changed ()
278+ {
279+ if (enable_close_state == true && previous_close_state == false)
280+ {
281+ close_symbol.animate (Clutter.AnimationMode.EASE_OUT_CUBIC,
282+ 300,
283+ "opacity", 0xff,
284+ "scale-x", 1.0,
285+ "scale-y", 1.0);
286+ }
287+ else if (enable_close_state == false && previous_close_state == true)
288+ {
289+ close_symbol.animate (Clutter.AnimationMode.EASE_OUT_CUBIC,
290+ 300,
291+ "opacity", 0x00,
292+ "scale-x", 0.0,
293+ "scale-y", 0.0);
294+ }
295+ previous_close_state = enable_close_state;
296+ }
297
298 /* alpha helpers */
299 private static float get_ease_out_sine (float alpha)
300@@ -465,7 +465,12 @@
301 effect_drop_shadow.set_opacity (0.4f);
302 this.effect_drop_shadow.set_margin (5);
303 this.processed_icon.add_effect (effect_drop_shadow);
304-
305+ this.processed_icon.set_scale (0.0f, 0.0f);
306+ this.processed_icon.scale_gravity = Clutter.Gravity.CENTER;
307+ this.processed_icon.animate (Clutter.AnimationMode.EASE_OUT_CUBIC,
308+ 300,
309+ "scale-x", 1.0,
310+ "scale-y", 1.0);
311 do_queue_redraw ();
312 }
313 }
314@@ -488,8 +493,10 @@
315 {
316 uint target_opacity = 0;
317 if (active)
318+ target_opacity = 255;
319+
320+ if (active && running)
321 {
322- target_opacity = 255;
323 running_indicator_notify.animate (Clutter.AnimationMode.EASE_IN_QUAD,
324 150,
325 "opacity", 0x00);
326@@ -620,12 +627,20 @@
327
328 Clutter.ActorBox child_box = Clutter.ActorBox ();
329
330+ // if we are rotated negatively, we need to work 'backwards'
331+ float midpoint = 0;
332+
333 //allocate the running indicator first
334 float width, height, n_width, n_height;
335 running_indicator.get_preferred_width (58, out n_width, out width);
336 running_indicator.get_preferred_height (58, out n_height, out height);
337+ midpoint = (processed_icon.stored_height - height) / 2.0f;
338+ if (rotation > 0)
339+ midpoint = box.get_height () - midpoint - processed_icon.stored_ymod;
340+
341 child_box.x1 = 0;
342- child_box.y1 = (box.get_height () - height) / 2.0f;
343+ child_box.y1 = midpoint;
344+ //child_box.y1 = (box.get_height () - height) / 2.0f;
345 child_box.x2 = child_box.x1 + width;
346 child_box.y2 = child_box.y1 + height;
347 running_indicator.allocate (child_box, flags);
348@@ -636,7 +651,7 @@
349 processed_icon.get_preferred_width (48, out width, out n_width);
350 processed_icon.get_preferred_height (48, out height, out n_height);
351 child_box.x1 = grabbed_push + (box.get_width () - width) / 2.0f;
352- child_box.y1 = y;
353+ child_box.y1 = 0;
354 child_box.x2 = child_box.x1 + 48;
355 child_box.y2 = child_box.y1 + height;
356 processed_icon.allocate (child_box, flags);
357@@ -644,8 +659,12 @@
358 //allocate the active indicator
359 active_indicator.get_preferred_width (48, out n_width, out width);
360 active_indicator.get_preferred_height (48, out n_height, out height);
361+ midpoint = (processed_icon.stored_height - height) / 2.0f;
362+ if (rotation > 0)
363+ midpoint = box.get_height () - midpoint - processed_icon.stored_ymod;
364+
365 child_box.x1 = box.get_width () - width;
366- child_box.y1 = (box.get_height () - height) / 2.0f;
367+ child_box.y1 = midpoint;
368 child_box.x2 = child_box.x1 + width;
369 child_box.y2 = child_box.y1 + height;
370 active_indicator.allocate (child_box, flags);
371
372=== modified file 'unity/icon-postprocessor.vala'
373--- unity/icon-postprocessor.vala 2010-08-18 16:09:44 +0000
374+++ unity/icon-postprocessor.vala 2010-09-16 20:23:26 +0000
375@@ -391,6 +391,8 @@
376 public static void paint_real (Clutter.Actor actor)
377 {
378 UnityIcon self = actor as UnityIcon;
379+ if (self.icon is Clutter.Texture == false)
380+ return;
381 float p1_x, p1_y;
382 float p2_x, p2_y;
383 float p3_x, p3_y;