Merge lp:~unity-team/unity/unity.post-release-fixes into lp:unity

Proposed by Gord Allott
Status: Superseded
Proposed branch: lp:~unity-team/unity/unity.post-release-fixes
Merge into: lp:unity
Diff against target: 188 lines (+51/-33)
2 files modified
unity-private/launcher/scroller-view.vala (+27/-14)
unity-private/launcher/scrollerchild-controller.vala (+24/-19)
To merge this branch: bzr merge lp:~unity-team/unity/unity.post-release-fixes
Reviewer Review Type Date Requested Status
Mirco Müller (community) Needs Fixing
Review via email: mp+33895@code.launchpad.net

This proposal has been superseded by a proposal from 2010-08-31.

Description of the change

some small fixes for the scrolling update,
Work correctly when you don't have enough icons to fill the launcher (neil mode)
stop auto-scrolling when you are already dragging the launcher

To post a comment you must log in.
Revision history for this message
Mirco Müller (macslow) wrote :

I get a jerking animation when right-clicking on a launcher icon to get to the quicklist. Instead of directly expanding from the tooltip to the quicklist, it looks like the tooltip closes, reopens and then expands to the quicklist. Furthermore I'm getting duplicated entries in the quicklist, but that's another issue I believe.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'unity-private/launcher/scroller-view.vala'
2--- unity-private/launcher/scroller-view.vala 2010-08-26 15:34:34 +0000
3+++ unity-private/launcher/scroller-view.vala 2010-08-31 10:13:44 +0000
4@@ -82,6 +82,7 @@
5 private ScrollerViewType view_type = ScrollerViewType.CONTRACTED;
6 private bool do_logic_pick = true;
7 private float last_known_pointer_x = 0.0f;
8+ private bool can_scroll = false;
9
10 /*
11 * scrolling variables
12@@ -409,7 +410,6 @@
13
14 private void on_drag_indicator_index_change ()
15 {
16- //debug (@"index changed $drag_indicator_index");
17 order_children (false);
18 queue_relayout ();
19 }
20@@ -678,7 +678,15 @@
21 new_scroll_position = limit * ( 1 - Math.powf ((limit - 1) / limit, new_scroll_position));
22 scroll_position = new_scroll_position;
23 }
24- else if (scroll_position < -(get_total_children_height () - get_available_height ()))
25+ else if (get_total_children_height () < get_available_height () &&
26+ scroll_position < 0)
27+ {
28+ float new_scroll_position = -scroll_position;
29+ new_scroll_position = limit * ( 1 - Math.powf ((limit - 1) / limit, new_scroll_position));
30+ scroll_position = -new_scroll_position;
31+ }
32+ else if (get_total_children_height () >= get_available_height () &&
33+ scroll_position < -(get_total_children_height () - get_available_height ()))
34 {
35 float diff = scroll_position + (get_total_children_height () - get_available_height ());
36 float new_scroll_position = limit * ( 1 - Math.powf ((limit - 1) / limit, Math.fabsf (diff)));
37@@ -845,6 +853,11 @@
38 passthrough_button_press_event (event);
39 }
40 button_down = true;
41+ if (get_model_index_at_y_pos (event.button.y, true) < 0)
42+ can_scroll = false;
43+ else
44+ can_scroll = true;
45+
46 previous_y_position = event.button.y;
47 previous_y_time = event.button.time;
48
49@@ -864,6 +877,7 @@
50 button_down = false;
51 this.get_stage ().button_release_event.disconnect (this.on_button_release_event);
52 Unity.global_shell.remove_fullscreen_request (this);
53+ Clutter.ungrab_pointer ();
54
55 if (is_scrolling)
56 {
57@@ -879,10 +893,7 @@
58 if (scroll_position > 0 || scroll_position < -(get_total_children_height () - get_available_height ()))
59 {
60 current_phase = ScrollerPhase.SETTLING;
61- if (scroll_position > 0)
62- settle_position = 0;
63- else
64- settle_position = -(get_total_children_height () - get_available_height ());
65+ settle_position = get_aligned_settle_position ();
66 }
67 else
68 {
69@@ -950,7 +961,7 @@
70 float autoscroll_mouse_pos_cache = 0.0f;
71 private bool on_autoscroll_motion_check (float y)
72 {
73- if (get_total_children_height () < get_available_height ())
74+ if (get_total_children_height () < get_available_height () || is_scrolling)
75 {
76 is_autoscrolling = false;
77 }
78@@ -996,7 +1007,9 @@
79 }
80 last_motion_event_time = event.motion.time;
81
82- if (button_down && is_scrolling == false && view_type != ScrollerViewType.CONTRACTED)
83+ if (button_down && is_scrolling == false &&
84+ view_type != ScrollerViewType.CONTRACTED &&
85+ can_scroll)
86 {
87 /* we have a left button down, but we aren't dragging yet, we need to
88 * monitor how far away we have dragged from the original click, once
89@@ -1143,10 +1156,7 @@
90 fling_timeout_source = GLib.Timeout.add (300, () =>
91 {
92 current_phase = ScrollerPhase.SETTLING;
93- if (scroll_position > 0)
94- settle_position = 0;
95- else
96- settle_position = -(get_total_children_height () - get_available_height ());
97+ settle_position = get_aligned_settle_position ();
98 fling_timeline.start ();
99 return false;
100 });
101@@ -1175,10 +1185,14 @@
102 // we always position on the first child
103 final_position = 0;
104 }
105+ else if (get_total_children_height () < get_available_height ())
106+ {
107+ final_position = 0;
108+ }
109 else if (-scroll_position > total_child_height - height - padding.top - padding.bottom)
110 {
111 // position on the final child
112- final_position = total_child_height - height + padding.bottom;
113+ final_position = -(get_total_children_height () - get_available_height ());
114 }
115
116 return final_position;
117@@ -1602,7 +1616,6 @@
118
119 if (drag_indicator_active)
120 {
121- //debug (@"drawing at $drag_indicator_position with $drag_indicator_opacity opacity");
122 Cogl.set_source_color4f (1.0f, 1.0f, 1.0f,
123 drag_indicator_opacity);
124
125
126=== modified file 'unity-private/launcher/scrollerchild-controller.vala'
127--- unity-private/launcher/scrollerchild-controller.vala 2010-08-26 11:53:42 +0000
128+++ unity-private/launcher/scrollerchild-controller.vala 2010-08-31 10:13:44 +0000
129@@ -140,26 +140,28 @@
130 private bool on_release_event (Clutter.Event event)
131 {
132 child.grabbed_push = 0;
133- if (event.button.button == 1 &&
134- button_down == true &&
135- event.button.time - last_press_time < 500 &&
136- no_activate == false)
137+ if (event.button.button == 1)
138 {
139- if (menu is QuicklistController)
140+ if (button_down == true &&
141+ event.button.time - last_press_time < 500 &&
142+ no_activate == false)
143 {
144- if (menu.state == QuicklistControllerState.LABEL ||
145- menu.state == QuicklistControllerState.MENU)
146- {
147- menu.state = QuicklistControllerState.CLOSED;
148- }
149- }
150+ if (menu is QuicklistController)
151+ {
152+ if (menu.state == QuicklistControllerState.LABEL ||
153+ menu.state == QuicklistControllerState.MENU)
154+ {
155+ menu.state = QuicklistControllerState.CLOSED;
156+ }
157+ }
158
159- activate ();
160- }
161- else
162- {
163- menu.state = QuicklistControllerState.LABEL;
164- ensure_menu_state ();
165+ activate ();
166+ }
167+ else
168+ {
169+ menu.state = QuicklistControllerState.LABEL;
170+ ensure_menu_state ();
171+ }
172 }
173
174 button_down = false;
175@@ -215,8 +217,11 @@
176 {
177 Idle.add (() =>
178 {
179- menu.state = QuicklistControllerState.MENU;
180- menu_state = ScrollerChildControllerMenuState.NO_MENU;
181+ if (menu.state != QuicklistControllerState.MENU)
182+ {
183+ menu.state = QuicklistControllerState.MENU;
184+ }
185+ //menu_state = ScrollerChildControllerMenuState.NO_MENU;
186 return false;
187 });
188 }