Merge lp:~unity-team/unity/unity.sprint-fixes into lp:unity

Proposed by Gord Allott
Status: Superseded
Proposed branch: lp:~unity-team/unity/unity.sprint-fixes
Merge into: lp:unity
Diff against target: 676 lines (+198/-161) (has conflicts)
9 files modified
targets/mutter/expose-manager.vala (+3/-47)
targets/mutter/plugin.vala (+1/-32)
unity-private/launcher/application-controller.vala (+62/-39)
unity-private/launcher/launcher-child.vala (+10/-0)
unity-private/launcher/quicklist-controller.vala (+8/-1)
unity-private/launcher/scroller-controller.vala (+71/-39)
unity-private/launcher/scroller-view.vala (+32/-2)
unity-private/launcher/scrollerchild-controller.vala (+3/-0)
unity/icon-postprocessor.vala (+8/-1)
Text conflict in unity-private/launcher/application-controller.vala
To merge this branch: bzr merge lp:~unity-team/unity/unity.sprint-fixes
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+30617@code.launchpad.net

This proposal has been superseded by a proposal from 2010-07-22.

Description of the change

bunch of fixes from the sprint

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'targets/mutter/expose-manager.vala'
--- targets/mutter/expose-manager.vala 2010-07-19 09:12:30 +0000
+++ targets/mutter/expose-manager.vala 2010-07-22 14:56:07 +0000
@@ -48,7 +48,7 @@
48 unhovered_opacity = 255;48 unhovered_opacity = 255;
4949
50 this.source = source;50 this.source = source;
51 51
52 if (source is Mutter.Window)52 if (source is Mutter.Window)
53 clone = new Clutter.Clone ((source as Mutter.Window).get_texture ());53 clone = new Clutter.Clone ((source as Mutter.Window).get_texture ());
54 else54 else
@@ -117,7 +117,6 @@
117117
118 private ExposeClone? last_selected_clone = null;118 private ExposeClone? last_selected_clone = null;
119119
120 private bool menu_in_hover_close_state = false;
121120
122 public ExposeManager (Plugin plugin, Launcher.Launcher launcher)121 public ExposeManager (Plugin plugin, Launcher.Launcher launcher)
123 {122 {
@@ -137,12 +136,6 @@
137136
138 public void start_expose (SList<Clutter.Actor> windows)137 public void start_expose (SList<Clutter.Actor> windows)
139 {138 {
140 var controller = Launcher.QuicklistController.get_current_menu ();
141 if (controller.is_menu_open ())
142 {
143 controller.get_view ().destroy.connect (this.end_expose);
144 this.menu_in_hover_close_state = controller.get_view ().get_close_on_leave ();
145 }
146 exposed_windows = new List<ExposeClone> ();139 exposed_windows = new List<ExposeClone> ();
147140
148 if (expose_group != null)141 if (expose_group != null)
@@ -175,26 +168,6 @@
175 clone.unhovered_opacity = unhovered_opacity;168 clone.unhovered_opacity = unhovered_opacity;
176 clone.opacity = unhovered_opacity;169 clone.opacity = unhovered_opacity;
177 clone.darken = darken;170 clone.darken = darken;
178
179 clone.enter_event.connect (() => {
180 var ql_controller = Launcher.QuicklistController.get_current_menu ();
181 if (ql_controller.state == Launcher.QuicklistControllerState.MENU
182 && this.menu_in_hover_close_state)
183 {
184 ql_controller.get_view ().set_close_on_leave (false);
185 }
186 return false;
187 });
188
189 clone.leave_event.connect (() => {
190 var ql_controller = Launcher.QuicklistController.get_current_menu ();
191 if (ql_controller.state == Launcher.QuicklistControllerState.MENU
192 && this.menu_in_hover_close_state)
193 {
194 ql_controller.get_view ().set_close_on_leave (true);
195 }
196 return false;
197 });
198 }171 }
199172
200 unowned GLib.List<Mutter.Window> mutter_windows = owner.plugin.get_windows ();173 unowned GLib.List<Mutter.Window> mutter_windows = owner.plugin.get_windows ();
@@ -223,13 +196,6 @@
223 {196 {
224 if (!expose_showing)197 if (!expose_showing)
225 return;198 return;
226
227 var controller = Launcher.QuicklistController.get_current_menu ();
228 if (controller.is_menu_open ())
229 {
230 controller.get_view ().destroy.disconnect (this.end_expose);
231 controller.state = Launcher.QuicklistControllerState.CLOSED;
232 }
233199
234 unowned GLib.List<Mutter.Window> mutter_windows = owner.plugin.get_windows ();200 unowned GLib.List<Mutter.Window> mutter_windows = owner.plugin.get_windows ();
235 foreach (Mutter.Window window in mutter_windows)201 foreach (Mutter.Window window in mutter_windows)
@@ -524,23 +490,13 @@
524 if (event.type == Clutter.EventType.ENTER || event.type == Clutter.EventType.LEAVE)490 if (event.type == Clutter.EventType.ENTER || event.type == Clutter.EventType.LEAVE)
525 return false;491 return false;
526492
527 bool event_over_menu = false;
528493
529 float x, y;494 float x, y;
530 event.get_coords (out x, out y);495 event.get_coords (out x, out y);
531496
532 unowned Clutter.Actor actor = this.stage.get_actor_at_pos (Clutter.PickMode.REACTIVE, (int) x, (int) y);497 unowned Clutter.Actor actor = this.stage.get_actor_at_pos (Clutter.PickMode.REACTIVE, (int) x, (int) y);
533498
534 Clutter.Actor? menu = null;499 if (event.type == Clutter.EventType.BUTTON_PRESS)
535 if (Unity.Launcher.QuicklistController.get_current_menu ().is_menu_open ())
536 menu = Unity.Launcher.QuicklistController.get_current_menu ().get_view ();
537 if (menu != null)
538 {
539 if (x > menu.x && x < menu.x + menu.width && y > menu.y && y < menu.y + menu.height)
540 event_over_menu = true;
541 }
542
543 if (event.type == Clutter.EventType.BUTTON_PRESS && !event_over_menu)
544 pick_window (event, actor);500 pick_window (event, actor);
545501
546 if (coverflow)502 if (coverflow)
@@ -548,7 +504,7 @@
548 else504 else
549 handle_event_expose (event, actor);505 handle_event_expose (event, actor);
550506
551 return !event_over_menu;507 return true;
552 }508 }
553 }509 }
554}510}
555511
=== modified file 'targets/mutter/plugin.vala'
--- targets/mutter/plugin.vala 2010-07-16 08:43:18 +0000
+++ targets/mutter/plugin.vala 2010-07-22 14:56:07 +0000
@@ -308,7 +308,6 @@
308308
309 private void on_focus_window_fullscreen_changed ()309 private void on_focus_window_fullscreen_changed ()
310 {310 {
311 warning ("FOCUS WINDOW FULLSCREEN CHANGED");
312 check_fullscreen_obstruction ();311 check_fullscreen_obstruction ();
313 }312 }
314313
@@ -466,32 +465,6 @@
466 /*465 /*
467 * SHELL IMPLEMENTATION466 * SHELL IMPLEMENTATION
468 */467 */
469
470 /*
471 public void show_window_picker ()
472 {
473 this.show_unity ();
474 return;
475 }
476
477 if (expose_manager.expose_showing == true)
478 {
479 this.dexpose_windows ();
480 return;
481 }
482
483 GLib.SList <Clutter.Actor> windows = null;
484
485 unowned GLib.List<Mutter.Window> mutter_windows = this.plugin.get_windows ();
486 foreach (Mutter.Window window in mutter_windows)
487 {
488 windows.append (window as Clutter.Actor);
489 }
490
491 this.expose_windows (windows, 80);
492 }
493 */
494
495 public Clutter.Stage get_stage ()468 public Clutter.Stage get_stage ()
496 {469 {
497 return this.stage;470 return this.stage;
@@ -539,7 +512,7 @@
539512
540 public void stop_expose ()513 public void stop_expose ()
541 {514 {
542 dexpose_windows ();515 expose_manager.end_expose ();
543 }516 }
544517
545 public void show_window (uint32 xid)518 public void show_window (uint32 xid)
@@ -585,10 +558,6 @@
585 expose_manager.start_expose (windows);558 expose_manager.start_expose (windows);
586 }559 }
587560
588 public void dexpose_windows ()
589 {
590 expose_manager.end_expose ();
591 }
592561
593 public void hide_unity ()562 public void hide_unity ()
594 {563 {
595564
=== modified file 'unity-private/launcher/application-controller.vala'
--- unity-private/launcher/application-controller.vala 2010-07-22 09:06:10 +0000
+++ unity-private/launcher/application-controller.vala 2010-07-22 14:56:07 +0000
@@ -63,20 +63,12 @@
63 favorites.favorite_added.connect (on_favorite_added);63 favorites.favorite_added.connect (on_favorite_added);
64 favorites.favorite_removed.connect (on_favorite_removed);64 favorites.favorite_removed.connect (on_favorite_removed);
6565
66 // we need to figure out if we are a favorite66 // we need to figure out if we are a favoritem
67 is_favorite = true;67
68 is_favorite = is_sticky ();
68 child.pin_type = PinType.UNPINNED;69 child.pin_type = PinType.UNPINNED;
69 foreach (string uid in favorites.get_favorites ())70 if (is_sticky ())
70 {71 child.pin_type = PinType.PINNED;
71 if (favorites.get_string (uid, "desktop_file") == desktop_file)
72 {
73 is_favorite = true;
74 child.pin_type = PinType.PINNED;
75 break;
76 }
77 }
78
79 notify["menu"].connect (on_notify_menu);
80 }72 }
8173
82 public override QuicklistController get_menu_controller ()74 public override QuicklistController get_menu_controller ()
@@ -85,28 +77,19 @@
85 return new_menu;77 return new_menu;
86 }78 }
8779
88 private void on_notify_menu ()
89 {
90 menu.notify["state"].connect (() => {
91 if (menu.state == QuicklistControllerState.MENU)
92 {
93 Unity.global_shell.expose_xids (app.get_xids ());
94 }
95 else
96 {
97 Unity.global_shell.stop_expose ();
98 }
99 });
100 }
101
102 public void set_sticky (bool is_sticky = true)80 public void set_sticky (bool is_sticky = true)
103 {81 {
104 if (desktop_file == "" || desktop_file == null)82 if (desktop_file == "" || desktop_file == null)
105 return;83 return;
106 //string uid = "app-" + Path.get_basename (desktop_file);84
107 var favorites = Unity.Favorites.get_default ();85 var favorites = Unity.Favorites.get_default ();
10886
109 string uid = favorites.find_uid_for_desktop_file (desktop_file);87 string uid = favorites.find_uid_for_desktop_file (desktop_file);
88 if (uid == "" || uid == null)
89 {
90 var filepath = desktop_file.split ("/");
91 uid = "app-" + filepath[filepath.length - 1];
92 }
11093
111 if (is_sticky)94 if (is_sticky)
112 {95 {
@@ -127,10 +110,10 @@
127110
128 var favorites = Unity.Favorites.get_default ();111 var favorites = Unity.Favorites.get_default ();
129 string uid = favorites.find_uid_for_desktop_file (desktop_file);112 string uid = favorites.find_uid_for_desktop_file (desktop_file);
130 if (uid != null && uid != "")113 if (uid == null || uid == "")
114 return false;
115 else
131 return true;116 return true;
132 else
133 return false;
134 }117 }
135118
136 public void close_windows ()119 public void close_windows ()
@@ -188,15 +171,17 @@
188 }171 }
189 }172 }
190173
174/*
175 private get_menu_for_client (ScrollerChildController.menu_cb callback, Dbusmenu.Client client)
176 {
177
178 }
179*/
180
191 public override void get_menu_actions (ScrollerChildController.menu_cb callback)181 public override void get_menu_actions (ScrollerChildController.menu_cb callback)
192 {182 {
193183
194 // first check to see if we have a cached client, if we do, just re-use that184 // first check to see if we have a cached client, if we do, just re-use that
195 if (menu_client is Dbusmenu.Client && cached_menu is Dbusmenu.Menuitem)
196 {
197 callback (cached_menu);
198 }
199
200 // check for a menu from bamf185 // check for a menu from bamf
201 if (app is Bamf.Application)186 if (app is Bamf.Application)
202 {187 {
@@ -279,14 +264,38 @@
279 Dbusmenu.Menuitem root = new Dbusmenu.Menuitem ();264 Dbusmenu.Menuitem root = new Dbusmenu.Menuitem ();
280 root.set_root (true);265 root.set_root (true);
281266
282 if (desktop_file != null)267 if (desktop_file != null && desktop_file != "")
283 {268 {
284 Dbusmenu.Menuitem pinning_item = new Dbusmenu.Menuitem ();269 Dbusmenu.Menuitem pinning_item = new Dbusmenu.Menuitem ();
270<<<<<<< TREE
285 if (is_sticky ())271 if (is_sticky ())
286 pinning_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _("Remove from launcher"));272 pinning_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _("Remove from launcher"));
273=======
274 if (is_sticky () && app is Bamf.Application)
275 {
276 pinning_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, "Keep in Launcher");
277 pinning_item.property_set (Dbusmenu.MENUITEM_PROP_TOGGLE_TYPE, Dbusmenu.MENUITEM_TOGGLE_CHECK);
278 pinning_item.property_set_int (Dbusmenu.MENUITEM_PROP_TOGGLE_STATE, Dbusmenu.MENUITEM_TOGGLE_STATE_CHECKED);
279 }
280 else if (is_sticky ())
281 {
282 pinning_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, "Remove from launcher");
283 }
284>>>>>>> MERGE-SOURCE
287 else285 else
286<<<<<<< TREE
288 pinning_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _("Add to launcher"));287 pinning_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _("Add to launcher"));
289288
289=======
290 {
291 if (app is Bamf.Application)
292 {
293 pinning_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, "Keep in Launcher");
294 pinning_item.property_set (Dbusmenu.MENUITEM_PROP_TOGGLE_TYPE, Dbusmenu.MENUITEM_TOGGLE_CHECK);
295 pinning_item.property_set_int (Dbusmenu.MENUITEM_PROP_TOGGLE_STATE, Dbusmenu.MENUITEM_TOGGLE_STATE_UNCHECKED);
296 }
297 }
298>>>>>>> MERGE-SOURCE
290 pinning_item.property_set_bool (Dbusmenu.MENUITEM_PROP_ENABLED, true);299 pinning_item.property_set_bool (Dbusmenu.MENUITEM_PROP_ENABLED, true);
291 pinning_item.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, true);300 pinning_item.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, true);
292 pinning_item.item_activated.connect ((timestamp) => {301 pinning_item.item_activated.connect ((timestamp) => {
@@ -299,7 +308,11 @@
299 if (app is Bamf.Application)308 if (app is Bamf.Application)
300 {309 {
301 Dbusmenu.Menuitem app_item = new Dbusmenu.Menuitem ();310 Dbusmenu.Menuitem app_item = new Dbusmenu.Menuitem ();
311<<<<<<< TREE
302 app_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _("Quit"));312 app_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _("Quit"));
313=======
314 app_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, "Quit");
315>>>>>>> MERGE-SOURCE
303 app_item.property_set_bool (Dbusmenu.MENUITEM_PROP_ENABLED, true);316 app_item.property_set_bool (Dbusmenu.MENUITEM_PROP_ENABLED, true);
304 app_item.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, true);317 app_item.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, true);
305318
@@ -317,6 +330,8 @@
317 }330 }
318331
319 private static int order_app_windows (void* a, void* b)332 private static int order_app_windows (void* a, void* b)
333 requires (a is Bamf.Window)
334 requires (b is Bamf.Window)
320 {335 {
321 if ((b as Bamf.Window).last_active () > (a as Bamf.Window).last_active ())336 if ((b as Bamf.Window).last_active () > (a as Bamf.Window).last_active ())
322 {337 {
@@ -337,7 +352,12 @@
337352
338 if (app is Bamf.Application)353 if (app is Bamf.Application)
339 {354 {
340 if (app.is_running ())355 if (app.is_active ())
356 {
357 Array<uint32> xids = app.get_xids ();
358 global_shell.expose_xids (xids);
359 }
360 else if (app.is_running ())
341 {361 {
342 unowned List<Bamf.Window> windows = app.get_windows ();362 unowned List<Bamf.Window> windows = app.get_windows ();
343 windows.sort ((CompareFunc)order_app_windows);363 windows.sort ((CompareFunc)order_app_windows);
@@ -375,7 +395,7 @@
375 public void attach_application (Bamf.Application application)395 public void attach_application (Bamf.Application application)
376 {396 {
377 app = application;397 app = application;
378 desktop_file = app.get_desktop_file ();398 desktop_file = app.get_desktop_file ().dup ();
379 child.running = app.is_running ();399 child.running = app.is_running ();
380 child.active = app.is_active ();400 child.active = app.is_active ();
381 child.activating = false;401 child.activating = false;
@@ -384,6 +404,9 @@
384 app.active_changed.connect (on_app_active_changed);404 app.active_changed.connect (on_app_active_changed);
385 app.closed.connect (detach_application);405 app.closed.connect (detach_application);
386 app.urgent_changed.connect (on_app_urgant_changed);406 app.urgent_changed.connect (on_app_urgant_changed);
407 app.user_visible_changed.connect ((value) => {
408 hide = !value;
409 });
387 name = app.get_name ();410 name = app.get_name ();
388 if (name == null || name == "")411 if (name == null || name == "")
389 warning (@"Bamf returned null for app.get_name (): $desktop_file");412 warning (@"Bamf returned null for app.get_name (): $desktop_file");
390413
=== modified file 'unity-private/launcher/launcher-child.vala'
--- unity-private/launcher/launcher-child.vala 2010-06-22 13:18:52 +0000
+++ unity-private/launcher/launcher-child.vala 2010-07-22 14:56:07 +0000
@@ -77,6 +77,16 @@
77 rotate_timeline.new_frame.connect (on_rotate_timeline_new_frame);77 rotate_timeline.new_frame.connect (on_rotate_timeline_new_frame);
7878
79 notify["rotation"].connect (on_rotation_changed);79 notify["rotation"].connect (on_rotation_changed);
80 notify["opacity"].connect (on_opacity_changed);
81 }
82
83 private void on_opacity_changed ()
84 {
85 //debug (@"opacity changes on launcher child, set to $(opacity)");
86 if (processed_icon is Clutter.Actor)
87 {
88 processed_icon.set_opacity (opacity);
89 }
80 }90 }
8191
82 ~LauncherChild ()92 ~LauncherChild ()
8393
=== modified file 'unity-private/launcher/quicklist-controller.vala'
--- unity-private/launcher/quicklist-controller.vala 2010-07-16 15:50:39 +0000
+++ unity-private/launcher/quicklist-controller.vala 2010-07-22 14:56:07 +0000
@@ -36,6 +36,9 @@
36 get { return _state; }36 get { return _state; }
37 set37 set
38 {38 {
39 var drag_controller = Unity.Drag.Controller.get_default ();
40 if (drag_controller.is_dragging) value = QuicklistControllerState.CLOSED;
41
39 if (value == QuicklistControllerState.LABEL ||42 if (value == QuicklistControllerState.LABEL ||
40 value == QuicklistControllerState.MENU)43 value == QuicklistControllerState.MENU)
41 {44 {
@@ -95,7 +98,6 @@
9598
96 }99 }
97100
98
99 public class ApplicationQuicklistController : QuicklistController101 public class ApplicationQuicklistController : QuicklistController
100 {102 {
101 public ApplicationQuicklistController (ScrollerChildController scroller_child)103 public ApplicationQuicklistController (ScrollerChildController scroller_child)
@@ -111,6 +113,11 @@
111 new_menu ();113 new_menu ();
112 notify["state"].connect (on_state_change);114 notify["state"].connect (on_state_change);
113 state = QuicklistControllerState.LABEL;115 state = QuicklistControllerState.LABEL;
116
117 var drag_controller = Unity.Drag.Controller.get_default ();
118 drag_controller.drag_start.connect (() => {
119 state = QuicklistControllerState.CLOSED;
120 });
114 }121 }
115122
116 private void new_menu ()123 private void new_menu ()
117124
=== modified file 'unity-private/launcher/scroller-controller.vala'
--- unity-private/launcher/scroller-controller.vala 2010-07-15 13:19:02 +0000
+++ unity-private/launcher/scroller-controller.vala 2010-07-22 14:56:07 +0000
@@ -75,38 +75,34 @@
75 {75 {
76 Bamf.Application app = object as Bamf.Application;76 Bamf.Application app = object as Bamf.Application;
77 // need to hook up to its visible changed signals77 // need to hook up to its visible changed signals
7878 string desktop_file = app.get_desktop_file ();
79 // this is wrong as it will never re-hide a window79
80 app.user_visible_changed.connect ((a, changed) => {80 ScrollerChildController controller = null;
81 if (changed)81 if (desktop_file != null && desktop_file != "")
82 {82 {
83 handle_bamf_view_opened (a as Object);83 controller = find_controller_by_desktop_file (desktop_file);
84 }84 }
85 });85
8686 if (controller is ApplicationController)
87 if (app.user_visible ())87 {
88 {88 (controller as ApplicationController).attach_application (app);
89 string desktop_file = app.get_desktop_file ();89 }
9090 else
91 ScrollerChildController controller = null;91 {
92 if (desktop_file != null && desktop_file != "")92 LauncherChild child = new LauncherChild ();
93 {93 controller = new ApplicationController (null, child);
94 controller = find_controller_by_desktop_file (desktop_file);94 (controller as ApplicationController).attach_application (app);
95 }95 if (app.user_visible ())
9696 model.add (child);
97 if (controller is ApplicationController)97
98 {98 childcontrollers.add (controller);
99 (controller as ApplicationController).attach_application (app);99 controller.closed.connect (on_scroller_controller_closed);
100 }100 controller.notify["hide"].connect (() => {
101 else101 if (controller.hide && controller.child in model)
102 {102 model.remove (controller.child);
103 LauncherChild child = new LauncherChild ();103 if (!controller.hide && (controller.child in model) == false)
104 controller = new ApplicationController (null, child);104 model.add (controller.child);
105 (controller as ApplicationController).attach_application (app);105 });
106 model.add (child);
107 childcontrollers.add (controller);
108 controller.closed.connect (on_scroller_controller_closed);
109 }
110 }106 }
111 }107 }
112 }108 }
@@ -115,7 +111,7 @@
115 {111 {
116 if (controller is ApplicationController)112 if (controller is ApplicationController)
117 {113 {
118 if (controller.child.pin_type == PinType.UNPINNED)114 if (!(controller as ApplicationController).is_sticky ())
119 {115 {
120 model.remove (controller.child);116 model.remove (controller.child);
121 childcontrollers.remove (controller);117 childcontrollers.remove (controller);
@@ -267,8 +263,17 @@
267 }263 }
268 }264 }
269265
266 float last_drag_x = 0.0f;
267 float last_drag_y = 0.0f;
270 private void on_unity_drag_motion (Drag.Model drag_model, float x, float y)268 private void on_unity_drag_motion (Drag.Model drag_model, float x, float y)
271 {269 {
270 if (x == last_drag_x && y == last_drag_y)
271 return;
272
273 last_drag_x = x;
274 last_drag_y = y;
275
276
272 var drag_controller = Drag.Controller.get_default ();277 var drag_controller = Drag.Controller.get_default ();
273 // check to see if the data matches any of our children278 // check to see if the data matches any of our children
274 if (!(drag_controller.get_drag_model () is ScrollerChildController))279 if (!(drag_controller.get_drag_model () is ScrollerChildController))
@@ -286,13 +291,40 @@
286 {291 {
287 // if the actor is not in the model, add it. because its now in there!292 // if the actor is not in the model, add it. because its now in there!
288 // find the index at this position293 // find the index at this position
289 int model_index = view.get_model_index_at_y_pos (y);294 int model_index = view.get_model_index_at_y_pos_no_anim (y, true);
290 if (retcont in model)295 if (model_index < 0) return;
291 model.move (retcont, int.max (model_index, 0));296
297 //we have to check to see if we would still be over the index
298 //if it was done animating
299/*
300 GLib.Value value = Value (typeof (float));
301 var child = model[model_index];
302 Clutter.Animation anim = child.get_animation ();
303 if (anim is Clutter.Animation)
304 {
305 debug ("is animating");
306 Clutter.Interval interval = anim.get_interval ("position");
307 interval.get_final_value (value);
308 }
292 else309 else
293 model.insert (retcont, int.max (model_index, 0));310 {
294311 debug ("is not animating");
295 view.do_queue_redraw ();312 value.set_float (y);
313 }
314
315 debug ("%f", Math.fabsf (value.get_float () - y));
316
317 if (Math.fabsf (value.get_float () - y) < 48)
318 {
319 debug ("moving things");
320*/
321 if (retcont in model)
322 model.move (retcont, int.max (model_index, 0));
323 else
324 model.insert (retcont, int.max (model_index, 0));
325
326 view.do_queue_redraw ();
327 //}
296 }328 }
297 }329 }
298330
299331
=== modified file 'unity-private/launcher/scroller-view.vala'
--- unity-private/launcher/scroller-view.vala 2010-07-19 13:06:02 +0000
+++ unity-private/launcher/scroller-view.vala 2010-07-22 14:56:07 +0000
@@ -156,7 +156,35 @@
156 });156 });
157 }157 }
158158
159 public int get_model_index_at_y_pos (float y)159 public int get_model_index_at_y_pos_no_anim (float y, bool return_minus_if_fail=false)
160 {
161 SList<float?> positions = new SList<float?> ();
162 foreach (ScrollerChild child in model)
163 {
164 positions.append (child.position);
165 GLib.Value value = Value (typeof (float));
166 Clutter.Animation anim = child.get_animation ();
167 if (anim is Clutter.Animation)
168 {
169 Clutter.Interval interval = anim.get_interval ("position");
170 interval.get_final_value (value);
171 child.position = value.get_float ();
172 }
173 }
174
175 int value = get_model_index_at_y_pos (y, return_minus_if_fail);
176
177 unowned SList<float?> list = positions;
178 foreach (ScrollerChild child in model)
179 {
180 child.position = (float)list.data;
181 list = list.next;
182 }
183
184 return value;
185 }
186
187 public int get_model_index_at_y_pos (float y, bool return_minus_if_fail=false)
160 {188 {
161189
162 // trying out a different method190 // trying out a different method
@@ -174,6 +202,8 @@
174202
175 if (picked_actor is ScrollerChild == false)203 if (picked_actor is ScrollerChild == false)
176 {204 {
205 if (return_minus_if_fail)
206 return -1;
177 // couldn't pick a single actor, return 0207 // couldn't pick a single actor, return 0
178 return (y < padding.top + model[0].get_height () + spacing) ? 0 : model.size -1 ;208 return (y < padding.top + model[0].get_height () + spacing) ? 0 : model.size -1 ;
179 }209 }
@@ -660,7 +690,7 @@
660 if (child.get_animation () is Clutter.Animation)690 if (child.get_animation () is Clutter.Animation)
661 {691 {
662 //GLib.Value value = GLib.Value (GLib.Type.from_name ("string"));692 //GLib.Value value = GLib.Value (GLib.Type.from_name ("string"));
663 GLib.Value value = typeof (float);693 GLib.Value value = Value (typeof (float));
664 Clutter.Interval interval = child.get_animation ().get_interval ("position");694 Clutter.Interval interval = child.get_animation ().get_interval ("position");
665 interval.get_final_value (value);695 interval.get_final_value (value);
666 if (value.get_float () != transitions[index].position)696 if (value.get_float () != transitions[index].position)
667697
=== modified file 'unity-private/launcher/scrollerchild-controller.vala'
--- unity-private/launcher/scrollerchild-controller.vala 2010-07-15 09:29:49 +0000
+++ unity-private/launcher/scrollerchild-controller.vala 2010-07-22 14:56:07 +0000
@@ -38,6 +38,8 @@
38 public ScrollerChild child {get; construct;}38 public ScrollerChild child {get; construct;}
39 public signal void request_removal (); //call when not needed anymore so we can unref39 public signal void request_removal (); //call when not needed anymore so we can unref
40 public string name = "If you can read this, file a bug!!";40 public string name = "If you can read this, file a bug!!";
41 public bool hide {get; set;}
42
4143
42 public signal void closed ();44 public signal void closed ();
4345
@@ -140,6 +142,7 @@
140 private void ensure_menu_state ()142 private void ensure_menu_state ()
141 {143 {
142 //no tooltips on drag144 //no tooltips on drag
145
143 if (Unity.Drag.Controller.get_default ().is_dragging) return;146 if (Unity.Drag.Controller.get_default ().is_dragging) return;
144147
145 if (menu is QuicklistController == false)148 if (menu is QuicklistController == false)
146149
=== modified file 'unity/icon-postprocessor.vala'
--- unity/icon-postprocessor.vala 2010-06-24 09:10:53 +0000
+++ unity/icon-postprocessor.vala 2010-07-22 14:56:07 +0000
@@ -254,6 +254,11 @@
254 g_total = g_total / uint.max (total_caught_pixels, 1);254 g_total = g_total / uint.max (total_caught_pixels, 1);
255 b_total = b_total / uint.max (total_caught_pixels, 1);255 b_total = b_total / uint.max (total_caught_pixels, 1);
256256
257 rs_total = rs_total / (width * height);
258 gs_total = gs_total / (width * height);
259 bs_total = bs_total / (width * height);
260
261
257 // get a new super saturated value based on our totals262 // get a new super saturated value based on our totals
258 if (total_caught_pixels <= 20)263 if (total_caught_pixels <= 20)
259 {264 {
@@ -491,7 +496,9 @@
491 }496 }
492 };497 };
493498
494 uchar opacity = self.get_paint_opacity ();499 uchar opacity = self.get_opacity ();
500
501 //debug (@"opacity is set to $opacity");
495502
496 self.bg_mat.set_color4ub (opacity, opacity, opacity, opacity);503 self.bg_mat.set_color4ub (opacity, opacity, opacity, opacity);
497 self.bgcol_material.set_color4ub (opacity, opacity, opacity, opacity);504 self.bgcol_material.set_color4ub (opacity, opacity, opacity, opacity);