Merge lp:~unity-team/unity/dash-fixes-2011-03-10 into lp:unity

Proposed by Neil J. Patel on 2011-03-10
Status: Merged
Merged at revision: 942
Proposed branch: lp:~unity-team/unity/dash-fixes-2011-03-10
Merge into: lp:unity
Diff against target: 1896 lines (+694/-156)
37 files modified
src/Launcher.cpp (+1/-1)
src/LauncherIcon.cpp (+9/-7)
src/PanelIndicatorObjectEntryView.cpp (+3/-3)
src/PanelMenuView.cpp (+4/-3)
src/PanelTray.cpp (+8/-3)
src/PanelView.cpp (+4/-4)
src/Place.h (+11/-0)
src/PlaceEntry.h (+8/-0)
src/PlaceEntryHome.cpp (+11/-0)
src/PlaceEntryHome.h (+8/-3)
src/PlaceEntryRemote.cpp (+26/-1)
src/PlaceEntryRemote.h (+7/-1)
src/PlaceFactoryFile.cpp (+0/-4)
src/PlaceLauncherIcon.cpp (+43/-13)
src/PlaceLauncherIcon.h (+3/-0)
src/PlaceLauncherSection.cpp (+11/-5)
src/PlaceRemote.cpp (+85/-4)
src/PlaceRemote.h (+11/-0)
src/PlacesController.cpp (+92/-10)
src/PlacesController.h (+11/-4)
src/PlacesGroupController.cpp (+73/-37)
src/PlacesGroupController.h (+3/-0)
src/PlacesHomeView.cpp (+5/-0)
src/PlacesResultsController.cpp (+11/-0)
src/PlacesResultsController.h (+2/-0)
src/PlacesSearchBar.cpp (+7/-0)
src/PlacesSearchBar.h (+2/-0)
src/PlacesSettings.cpp (+16/-2)
src/PlacesSettings.h (+15/-5)
src/PlacesSimpleTile.cpp (+6/-15)
src/PlacesSimpleTile.h (+1/-3)
src/PlacesTile.cpp (+10/-8)
src/PlacesTile.h (+4/-3)
src/PlacesView.cpp (+147/-15)
src/PlacesView.h (+13/-1)
src/unityshell.cpp (+6/-0)
unityshell.xml.in (+17/-1)
To merge this branch: bzr merge lp:~unity-team/unity/dash-fixes-2011-03-10
Reviewer Review Type Date Requested Status
Jay Taoko (community) 2011-03-10 Approve on 2011-03-10
Review via email: mp+52834@code.launchpad.net

Description of the change

Smallish branch, fixes issue with panel (linked), adds fade when showing dash, adds optional blur (off by default as it's a bit slow right now, at least on nvidia)

You'll need trunk nux.

To post a comment you must log in.
951. By Neil J. Patel on 2011-03-10

[merge] trunk

952. By Neil J. Patel on 2011-03-10

fix dash screen size support

953. By Neil J. Patel on 2011-03-10

Fix fullscreening

954. By Neil J. Patel on 2011-03-10

make panel work with multi monitor

955. By Neil J. Patel on 2011-03-10

Support for positioning the quicklist and tooltip properly

956. By Neil J. Patel on 2011-03-10

Fix CheckWindowOverLauncher to use the absolute geometry

957. By Neil J. Patel on 2011-03-10

Respect ShowEntry

Jay Taoko (jaytaoko) wrote :

approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Launcher.cpp'
2--- src/Launcher.cpp 2011-03-10 14:33:38 +0000
3+++ src/Launcher.cpp 2011-03-10 14:34:46 +0000
4@@ -1535,7 +1535,7 @@
5 bool
6 Launcher::CheckIntersectWindow (CompWindow *window)
7 {
8- nux::Geometry geo = GetGeometry ();
9+ nux::Geometry geo = GetAbsoluteGeometry ();
10 int intersect_types = CompWindowTypeNormalMask | CompWindowTypeDialogMask |
11 CompWindowTypeModalDialogMask | CompWindowTypeUtilMask;
12
13
14=== modified file 'src/LauncherIcon.cpp'
15--- src/LauncherIcon.cpp 2011-02-27 08:25:15 +0000
16+++ src/LauncherIcon.cpp 2011-03-10 14:34:46 +0000
17@@ -361,8 +361,9 @@
18 return;
19 }
20
21- int tip_x = _launcher->GetBaseWidth () + 1; //icon_x + icon_w;
22- int tip_y = _center.y + _launcher->GetParent ()->GetGeometry ().y;
23+ nux::Geometry geo = _launcher->GetAbsoluteGeometry ();
24+ int tip_x = geo.x + geo.width + 1;
25+ int tip_y = geo.y + _center.y;
26
27 _tooltip->ShowTooltipWithTipAt (tip_x, tip_y);
28
29@@ -419,10 +420,10 @@
30 if (default_to_first_item)
31 _quicklist->DefaultToFirstItem ();
32
33- int tip_x = _launcher->GetBaseWidth () + 1; //icon_x + icon_w;
34- int tip_y = _center.y + _launcher->GetParent ()->GetGeometry ().y;
35+ nux::Geometry geo = _launcher->GetAbsoluteGeometry ();
36+ int tip_x = geo.x + geo.width + 1;
37+ int tip_y = geo.y + _center.y;
38 QuicklistManager::Default ()->ShowQuicklist (_quicklist, tip_x, tip_y);
39- //nux::GetWindowCompositor ().SetAlwaysOnFrontWindow (_quicklist);
40 }
41
42 void LauncherIcon::RecvMouseDown (int button)
43@@ -465,8 +466,9 @@
44 {
45 _center = center;
46
47- int tip_x = _launcher->GetBaseWidth () + 1; //icon_x + icon_w;
48- int tip_y = _center.y + _launcher->GetParent ()->GetGeometry ().y;
49+ nux::Geometry geo = _launcher->GetAbsoluteGeometry ();
50+ int tip_x = geo.x + geo.width + 1;
51+ int tip_y = geo.y + _center.y;
52
53 if (_quicklist->IsVisible ())
54 QuicklistManager::Default ()->ShowQuicklist (_quicklist, tip_x, tip_y);
55
56=== modified file 'src/PanelIndicatorObjectEntryView.cpp'
57--- src/PanelIndicatorObjectEntryView.cpp 2011-02-23 17:02:01 +0000
58+++ src/PanelIndicatorObjectEntryView.cpp 2011-03-10 14:34:46 +0000
59@@ -72,7 +72,7 @@
60 if ((_proxy->label_visible && _proxy->label_sensitive)
61 || (_proxy->icon_visible && _proxy->icon_sensitive))
62 {
63- _proxy->ShowMenu (GetGeometry ().x + 1, //cairo translation
64+ _proxy->ShowMenu (GetAbsoluteGeometry ().x + 1, //cairo translation
65 PANEL_HEIGHT,
66 time (NULL),
67 nux::GetEventButton (button_flags));
68@@ -88,7 +88,7 @@
69 void
70 PanelIndicatorObjectEntryView::Activate ()
71 {
72- _proxy->ShowMenu (GetGeometry ().x + 1, //cairo translation FIXME: Make this into one function
73+ _proxy->ShowMenu (GetAbsoluteGeometry().x + 1, //cairo translation FIXME: Make this into one function
74 PANEL_HEIGHT,
75 time (NULL),
76 1);
77@@ -239,7 +239,7 @@
78 textcol.GetRed (),
79 textcol.GetGreen (),
80 textcol.GetBlue (),
81- _proxy->label_sensitive ? 1.0f : 0.0f);
82+ _proxy->label_sensitive ? 1.0f : 0.5f);
83 cairo_move_to (cr, x, (int)((height - text_height)/2));
84 pango_cairo_show_layout (cr, layout);
85 cairo_stroke (cr);
86
87=== modified file 'src/PanelMenuView.cpp'
88--- src/PanelMenuView.cpp 2011-03-07 10:59:31 +0000
89+++ src/PanelMenuView.cpp 2011-03-10 14:34:46 +0000
90@@ -70,6 +70,7 @@
91 G_CALLBACK (on_active_window_changed), this);
92
93 _menu_layout = new nux::HLayout ("", NUX_TRACKER_LOCATION);
94+ _menu_layout->SetParentObject (this);
95
96 /* This is for our parent and for PanelView to read indicator entries, we
97 * shouldn't touch this again
98@@ -142,7 +143,7 @@
99 PanelMenuView::ProcessEvent (nux::IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
100 {
101 long ret = TraverseInfo;
102- nux::Geometry geo = GetGeometry ();
103+ nux::Geometry geo = GetAbsoluteGeometry ();
104
105 if (geo.IsPointInside (ievent.e_x, ievent.e_y))
106 {
107@@ -170,7 +171,8 @@
108 ret = _panel_titlebar_grab_area->OnEvent (ievent, ret, ProcessEventInfo);
109 }
110
111- ret = _menu_layout->ProcessEvent (ievent, ret, ProcessEventInfo);
112+ if (!_is_own_window)
113+ ret = _menu_layout->ProcessEvent (ievent, ret, ProcessEventInfo);
114
115 return ret;
116 }
117@@ -188,7 +190,6 @@
118 _window_buttons->ComputeLayout2 ();
119 new_window_buttons_w = _window_buttons->GetContentWidth ();
120
121-
122 /* Explicitly set the size and position of the widgets */
123 geo.x += _padding + new_window_buttons_w + _padding;
124 geo.width -= _padding + new_window_buttons_w + _padding;
125
126=== modified file 'src/PanelTray.cpp'
127--- src/PanelTray.cpp 2011-02-22 23:11:20 +0000
128+++ src/PanelTray.cpp 2011-03-10 14:34:46 +0000
129@@ -29,9 +29,10 @@
130 _settings = g_settings_new (SETTINGS_NAME);
131 _whitelist = g_settings_get_strv (_settings, "systray-whitelist");
132
133- _window = gtk_window_new (GTK_WINDOW_POPUP);
134+ _window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
135 gtk_window_set_type_hint (GTK_WINDOW (_window), GDK_WINDOW_TYPE_HINT_DOCK);
136- //gtk_window_set_keep_above (GTK_WINDOW (_window), TRUE);
137+ gtk_window_set_has_resize_grip (GTK_WINDOW (_window), FALSE);
138+ gtk_window_set_keep_above (GTK_WINDOW (_window), TRUE);
139 gtk_window_set_skip_pager_hint (GTK_WINDOW (_window), TRUE);
140 gtk_window_set_skip_taskbar_hint (GTK_WINDOW (_window), TRUE);
141 gtk_window_resize (GTK_WINDOW (_window), 1, 24);
142@@ -138,7 +139,11 @@
143 g_idle_add ((GSourceFunc)IdleSync, self);
144 }
145
146- g_debug ("TrayChild %s: %s %s", na_tray_child_get_title (icon), res_name, res_class);
147+ g_debug ("TrayChild %s: %s %s %s",
148+ accept ? "Accepted" : "Rejected",
149+ na_tray_child_get_title (icon),
150+ res_name,
151+ res_class);
152
153 g_free (res_name);
154 g_free (res_class);
155
156=== modified file 'src/PanelView.cpp'
157--- src/PanelView.cpp 2011-02-17 09:56:22 +0000
158+++ src/PanelView.cpp 2011-03-10 14:34:46 +0000
159@@ -252,8 +252,8 @@
160 void
161 PanelView::OnMenuPointerMoved (int x, int y)
162 {
163- nux::Geometry geo = GetGeometry ();
164- nux::Geometry hgeo = _home_button->GetGeometry ();
165+ nux::Geometry geo = GetAbsoluteGeometry ();
166+ nux::Geometry hgeo = _home_button->GetAbsoluteGeometry ();
167
168 if (x <= (hgeo.x + hgeo.width))
169 return;
170@@ -271,7 +271,7 @@
171 if (view->_layout == NULL)
172 continue;
173
174- geo = view->GetGeometry ();
175+ geo = view->GetAbsoluteGeometry ();
176 if (x >= geo.x && x <= (geo.x + geo.width)
177 && y >= geo.y && y <= (geo.y + geo.height))
178 {
179@@ -282,7 +282,7 @@
180 {
181 PanelIndicatorObjectEntryView *entry = static_cast<PanelIndicatorObjectEntryView *> (*it2);
182
183- geo = entry->GetGeometry ();
184+ geo = entry->GetAbsoluteGeometry ();
185 if (x >= geo.x && x <= (geo.x + geo.width)
186 && y >= geo.y && y <= (geo.y + geo.height))
187 {
188
189=== modified file 'src/Place.h'
190--- src/Place.h 2010-12-11 13:49:37 +0000
191+++ src/Place.h 2011-03-10 14:34:46 +0000
192@@ -23,9 +23,17 @@
193 #include <vector>
194 #include <sigc++/signal.h>
195 #include <sigc++/trackable.h>
196+#include <glib.h>
197
198 #include "PlaceEntry.h"
199
200+enum ActivationResult
201+{
202+ FALLBACK = 0,
203+ SHOW_DASH,
204+ HIDE_DASH
205+};
206+
207 class Place : public sigc::trackable
208 {
209 public:
210@@ -34,9 +42,12 @@
211 virtual std::vector<PlaceEntry *>& GetEntries () = 0;
212 virtual guint32 GetNEntries () = 0;
213
214+ virtual void ActivateResult (const char *uri, const char *mimetype) = 0;
215+
216 // Signals
217 sigc::signal<void, PlaceEntry *> entry_added;
218 sigc::signal<void, PlaceEntry *> entry_removed;
219+ sigc::signal<void, const char *, ActivationResult> result_activated;
220
221 protected:
222 std::vector<PlaceEntry *> _entries;
223
224=== modified file 'src/PlaceEntry.h'
225--- src/PlaceEntry.h 2011-03-06 17:40:56 +0000
226+++ src/PlaceEntry.h 2011-03-10 14:34:46 +0000
227@@ -15,6 +15,7 @@
228 *
229 * Authored by: Neil Jagdish Patel <neil.patel@canonical.com>
230 */
231+
232 #ifndef PLACE_ENTRY_H
233 #define PLACE_ENTRY_H
234
235@@ -26,6 +27,8 @@
236
237 #include <glib.h>
238
239+class Place;
240+
241 class PlaceEntrySection
242 {
243 public:
244@@ -74,6 +77,8 @@
245 typedef sigc::slot<void, PlaceEntry *, PlaceEntryGroup&> GroupForeachCallback;
246 typedef sigc::slot<void, PlaceEntry *, PlaceEntryGroup&, PlaceEntryResult&> ResultForeachCallback;
247
248+ virtual Place * GetParent () = 0;
249+
250 virtual const char * GetId () = 0;
251 virtual const char * GetName () = 0;
252 virtual const char * GetIcon () = 0;
253@@ -119,6 +124,9 @@
254 virtual void GetResult (const void *id, ResultForeachCallback slot) = 0;
255 virtual void GetGlobalResult (const void *id, ResultForeachCallback slot) = 0;
256
257+ virtual void ActivateResult (const void *id) = 0;
258+ virtual void ActivateGlobalResult (const void *id) = 0;
259+
260 // Signals
261
262 sigc::signal<void, bool> active_changed;
263
264=== modified file 'src/PlaceEntryHome.cpp'
265--- src/PlaceEntryHome.cpp 2011-03-06 17:51:59 +0000
266+++ src/PlaceEntryHome.cpp 2011-03-10 14:34:46 +0000
267@@ -281,3 +281,14 @@
268 entry->GetGlobalResult (id, sigc::mem_fun (this, &PlaceEntryHome::OnForeachResult));
269 }
270 }
271+
272+void
273+PlaceEntryHome::ActivateResult (const void *id)
274+{
275+ PlaceEntry *entry = _id_to_entry[id];
276+
277+ if (entry)
278+ {
279+ entry->ActivateGlobalResult (id);
280+ }
281+}
282
283=== modified file 'src/PlaceEntryHome.h'
284--- src/PlaceEntryHome.h 2011-03-06 17:51:59 +0000
285+++ src/PlaceEntryHome.h 2011-03-10 14:34:46 +0000
286@@ -37,6 +37,8 @@
287 ~PlaceEntryHome ();
288
289 /* Overrides */
290+ Place * GetParent () { return NULL; }
291+
292 const gchar * GetId ();
293 const gchar * GetName ();
294 const gchar * GetIcon ();
295@@ -58,17 +60,20 @@
296 void SetActiveSection (guint32 section_id);
297 void SetGlobalSearch (const gchar *search, std::map<gchar*, gchar*>& hints);
298
299- void ForeachSection (SectionForeachCallback slot) { };
300+ void ForeachSection (SectionForeachCallback slot) {};
301
302 void ForeachGroup (GroupForeachCallback slot);
303 void ForeachResult (ResultForeachCallback slot);
304
305- void ForeachGlobalGroup (GroupForeachCallback slot) { };
306- void ForeachGlobalResult (ResultForeachCallback slot) { };
307+ void ForeachGlobalGroup (GroupForeachCallback slot) {};
308+ void ForeachGlobalResult (ResultForeachCallback slot) {};
309
310 void GetResult (const void *id, ResultForeachCallback slot);
311 void GetGlobalResult (const void *id, ResultForeachCallback slot) {};
312
313+ void ActivateResult (const void *id);
314+ void ActivateGlobalResult (const void *id) {};
315+
316 private:
317 void LoadExistingEntries ();
318 void OnPlaceAdded (Place *place);
319
320=== modified file 'src/PlaceEntryRemote.cpp'
321--- src/PlaceEntryRemote.cpp 2011-03-06 17:40:56 +0000
322+++ src/PlaceEntryRemote.cpp 2011-03-10 14:34:46 +0000
323@@ -180,8 +180,9 @@
324 };
325
326
327-PlaceEntryRemote::PlaceEntryRemote (const gchar *dbus_name)
328+PlaceEntryRemote::PlaceEntryRemote (Place *parent, const gchar *dbus_name)
329 : dirty (false),
330+ _parent (parent),
331 _dbus_path (NULL),
332 _name (NULL),
333 _icon (NULL),
334@@ -303,6 +304,12 @@
335 }
336
337 /* Overrides */
338+Place *
339+PlaceEntryRemote::GetParent ()
340+{
341+ return _parent;
342+}
343+
344 const gchar *
345 PlaceEntryRemote::GetId ()
346 {
347@@ -627,6 +634,24 @@
348 slot (this, group, result);
349 }
350
351+void
352+PlaceEntryRemote::ActivateResult (const void *id)
353+{
354+ DeeModelIter *iter = (DeeModelIter *)id;
355+
356+ _parent->ActivateResult (dee_model_get_string (_results_model, iter, RESULT_URI),
357+ dee_model_get_string (_results_model, iter, RESULT_MIMETYPE));
358+}
359+
360+void
361+PlaceEntryRemote::ActivateGlobalResult (const void *id)
362+{
363+ DeeModelIter *iter = (DeeModelIter *)id;
364+
365+ _parent->ActivateResult (dee_model_get_string (_global_results_model, iter, RESULT_URI),
366+ dee_model_get_string (_global_results_model, iter, RESULT_MIMETYPE));
367+}
368+
369 /* Other methods */
370 bool
371 PlaceEntryRemote::IsValid ()
372
373=== modified file 'src/PlaceEntryRemote.h'
374--- src/PlaceEntryRemote.h 2011-03-06 17:40:56 +0000
375+++ src/PlaceEntryRemote.h 2011-03-10 14:34:46 +0000
376@@ -35,12 +35,14 @@
377 class PlaceEntryRemote : public PlaceEntry
378 {
379 public:
380- PlaceEntryRemote (const gchar *dbus_name);
381+ PlaceEntryRemote (Place *parent, const gchar *dbus_name);
382 ~PlaceEntryRemote ();
383
384 void InitFromKeyFile (GKeyFile *key_file, const gchar *group);
385
386 /* Overrides */
387+ Place * GetParent ();
388+
389 const gchar * GetId ();
390 const gchar * GetName ();
391 const gchar * GetIcon ();
392@@ -73,6 +75,9 @@
393 void GetResult (const void *id, ResultForeachCallback slot);
394 void GetGlobalResult (const void *id, ResultForeachCallback slot);
395
396+ void ActivateResult (const void *id);
397+ void ActivateGlobalResult (const void *id);
398+
399 /* Other methods */
400 bool IsValid ();
401 const gchar * GetPath ();
402@@ -110,6 +115,7 @@
403 bool dirty;
404
405 private:
406+ Place *_parent;
407 gchar *_dbus_name;
408 gchar *_dbus_path;
409 gchar *_name;
410
411=== modified file 'src/PlaceFactoryFile.cpp'
412--- src/PlaceFactoryFile.cpp 2011-02-21 17:48:29 +0000
413+++ src/PlaceFactoryFile.cpp 2011-03-10 14:34:46 +0000
414@@ -27,10 +27,6 @@
415
416 PlaceFactoryFile::PlaceFactoryFile (const char *directory)
417 {
418- //FIXME: This is a temporary Alpha 2 fix
419- g_spawn_command_line_sync ("killall unity-files-daemon", NULL, NULL, NULL, NULL);
420- g_spawn_command_line_sync ("killall unity-applications-daemon", NULL, NULL, NULL, NULL);
421-
422 /* Use the default lookup location */
423 if (directory == NULL)
424 _directory = g_build_filename (DATADIR, "unity", "places", NULL);
425
426=== modified file 'src/PlaceLauncherIcon.cpp'
427--- src/PlaceLauncherIcon.cpp 2011-02-22 13:46:36 +0000
428+++ src/PlaceLauncherIcon.cpp 2011-03-10 14:34:46 +0000
429@@ -26,6 +26,8 @@
430
431 #include <glib/gi18n-lib.h>
432
433+#define SECTION_NUMBER "ted-loves-strings"
434+
435 PlaceLauncherIcon::PlaceLauncherIcon (Launcher *launcher, PlaceEntry *entry)
436 : SimpleLauncherIcon(launcher),
437 _entry (entry)
438@@ -87,24 +89,52 @@
439
440 }
441
442+void
443+PlaceLauncherIcon::ForeachSectionCallback (PlaceEntry *entry, PlaceEntrySection& section)
444+{
445+ DbusmenuMenuitem *menu_item;
446+ char *temp;
447+
448+ temp = g_markup_escape_text (section.GetName (), -1);
449+ menu_item = dbusmenu_menuitem_new ();
450+ dbusmenu_menuitem_property_set (menu_item, DBUSMENU_MENUITEM_PROP_LABEL, section.GetName ());
451+ dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_ENABLED, true);
452+ dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
453+ dbusmenu_menuitem_property_set_int (menu_item, SECTION_NUMBER, _current_menu.size ());
454+ _current_menu.push_back (menu_item);
455+ g_signal_connect (menu_item, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
456+ G_CALLBACK (&PlaceLauncherIcon::OnOpen), this);
457+ g_free (temp);
458+}
459+
460 std::list<DbusmenuMenuitem *>
461 PlaceLauncherIcon::GetMenus ()
462 {
463- std::list<DbusmenuMenuitem *> result;
464 DbusmenuMenuitem *menu_item;
465-
466- menu_item = dbusmenu_menuitem_new ();
467-
468- dbusmenu_menuitem_property_set (menu_item, DBUSMENU_MENUITEM_PROP_LABEL, _("Open"));
469- dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_ENABLED, true);
470- dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
471-
472+ char * temp;
473+
474+ _current_menu.erase (_current_menu.begin (), _current_menu.end ());
475+
476+ _entry->ForeachSection (sigc::mem_fun (this, &PlaceLauncherIcon::ForeachSectionCallback));
477+
478+ menu_item = dbusmenu_menuitem_new ();
479+ dbusmenu_menuitem_property_set (menu_item, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR);
480+ dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_ENABLED, true);
481+ dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
482+ _current_menu.push_back (menu_item);
483+
484+ temp = g_markup_escape_text (_entry->GetName (), -1);
485+ menu_item = dbusmenu_menuitem_new ();
486+ dbusmenu_menuitem_property_set (menu_item, DBUSMENU_MENUITEM_PROP_LABEL, temp);
487+ dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_ENABLED, true);
488+ dbusmenu_menuitem_property_set_bool (menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
489+ dbusmenu_menuitem_property_set_int (menu_item, SECTION_NUMBER, 0);
490+ _current_menu.push_back (menu_item);
491 g_signal_connect (menu_item, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
492 G_CALLBACK (&PlaceLauncherIcon::OnOpen), this);
493-
494- result.push_back (menu_item);
495-
496- return result;
497+ g_free (temp);
498+
499+ return _current_menu;
500 }
501
502 void
503@@ -121,7 +151,7 @@
504 void
505 PlaceLauncherIcon::OnOpen (DbusmenuMenuitem *item, int time, PlaceLauncherIcon *self)
506 {
507- self->ActivateLauncherIcon ();
508+ self->ActivatePlace (dbusmenu_menuitem_property_get_int (item, SECTION_NUMBER), "");
509 }
510
511 void
512
513=== modified file 'src/PlaceLauncherIcon.h'
514--- src/PlaceLauncherIcon.h 2011-02-22 13:46:36 +0000
515+++ src/PlaceLauncherIcon.h 2011-03-10 14:34:46 +0000
516@@ -44,10 +44,13 @@
517 void ActivateLauncherIcon ();
518 void ActivatePlace (guint section_id, const char *search_string);
519 void OnActiveChanged (bool is_active);
520+ void ForeachSectionCallback (PlaceEntry *entry, PlaceEntrySection& section);
521+
522 static void OnOpen (DbusmenuMenuitem *item, int time, PlaceLauncherIcon *self);
523
524 private:
525 PlaceEntry *_entry;
526+ std::list<DbusmenuMenuitem *> _current_menu;
527 };
528
529 #endif // _PLACE_LAUNCHER_ICON_H__H
530
531=== modified file 'src/PlaceLauncherSection.cpp'
532--- src/PlaceLauncherSection.cpp 2011-01-24 21:37:38 +0000
533+++ src/PlaceLauncherSection.cpp 2011-03-10 14:34:46 +0000
534@@ -43,9 +43,12 @@
535 for (i = entries.begin (); i != entries.end (); ++i)
536 {
537 PlaceEntry *entry = static_cast<PlaceEntry *> (*i);
538- PlaceLauncherIcon *icon = new PlaceLauncherIcon (_launcher, entry);
539-
540- IconAdded.emit (icon);
541+
542+ if (entry->ShowInLauncher ())
543+ {
544+ PlaceLauncherIcon *icon = new PlaceLauncherIcon (_launcher, entry);
545+ IconAdded.emit (icon);
546+ }
547 }
548 }
549
550@@ -64,9 +67,12 @@
551 for (i = entries.begin (); i != entries.end (); ++i)
552 {
553 PlaceEntry *entry = static_cast<PlaceEntry *> (*i);
554- PlaceLauncherIcon *icon = new PlaceLauncherIcon (_launcher, entry);
555
556- IconAdded.emit (icon);
557+ if (entry->ShowInLauncher ())
558+ {
559+ PlaceLauncherIcon *icon = new PlaceLauncherIcon (_launcher, entry);
560+ IconAdded.emit (icon);
561+ }
562 }
563 }
564 }
565
566=== modified file 'src/PlaceRemote.cpp'
567--- src/PlaceRemote.cpp 2011-01-19 22:52:54 +0000
568+++ src/PlaceRemote.cpp 2011-03-10 14:34:46 +0000
569@@ -32,6 +32,7 @@
570 #define MIME_PATTERN "MimetypePattern"
571
572 #define PLACE_IFACE "com.canonical.Unity.Place"
573+#define ACTIVE_IFACE "com.canonical.Unity.Activation"
574
575 static void on_service_proxy_ready (GObject *source,
576 GAsyncResult *result,
577@@ -60,7 +61,6 @@
578 GKeyFile *key_file;
579 GError *error = NULL;
580
581- g_debug ("Loading Place: %s", path);
582 _path = g_strdup (path);
583
584 // A .place file is a keyfile, so we create on representing the .place file to
585@@ -216,6 +216,17 @@
586 NULL,
587 on_service_proxy_ready,
588 this);
589+
590+ if (_uri_regex || _mime_regex)
591+ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
592+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
593+ NULL,
594+ _dbus_name,
595+ _dbus_path,
596+ ACTIVE_IFACE,
597+ NULL,
598+ (GAsyncReadyCallback)PlaceRemote::OnActivationProxyReady,
599+ this);
600 }
601
602 std::vector<PlaceEntry *>&
603@@ -244,7 +255,7 @@
604
605 if (g_str_has_prefix (group, ENTRY_PREFIX))
606 {
607- PlaceEntryRemote *entry = new PlaceEntryRemote (_dbus_name);
608+ PlaceEntryRemote *entry = new PlaceEntryRemote (this, _dbus_name);
609 entry->InitFromKeyFile (key_file, group);
610
611 if (entry->IsValid ())
612@@ -369,7 +380,7 @@
613
614 if (!existing)
615 {
616- existing = new PlaceEntryRemote (_dbus_name);
617+ existing = new PlaceEntryRemote (this, _dbus_name);
618
619 _entries.push_back (existing);
620 entry_added.emit (existing);
621@@ -456,7 +467,7 @@
622 &global_results_model,
623 &global_hints);
624
625- entry = new PlaceEntryRemote (_dbus_name);
626+ entry = new PlaceEntryRemote (this, _dbus_name);
627 entry->Update (dbus_path,
628 name,
629 icon,
630@@ -512,6 +523,76 @@
631 }
632 }
633
634+void
635+PlaceRemote::OnActivationResultReceived (GObject *source,
636+ GAsyncResult *result,
637+ PlaceRemote *self)
638+{
639+ GVariant *args;
640+ GError *error = NULL;
641+ guint ret = 0;
642+
643+ args = g_dbus_proxy_call_finish ((GDBusProxy *)source, result, &error);
644+ if (error)
645+ {
646+ g_warning ("Unable to call Activate() on: %s",
647+ error->message);
648+ g_error_free (error);
649+ return;
650+ }
651+
652+ self->result_activated.emit (self->_active_uri.c_str (), (ActivationResult)ret);
653+
654+ g_variant_unref (args);
655+}
656+
657+void
658+PlaceRemote::ActivateResult (const char *uri, const char *mimetype)
659+{
660+ if (G_IS_DBUS_PROXY (_activation_proxy)
661+ && ((_uri_regex && g_regex_match (_uri_regex, uri, (GRegexMatchFlags)0, NULL))
662+ || (_mime_regex && g_regex_match (_mime_regex, mimetype, (GRegexMatchFlags)0, NULL))))
663+ {
664+ _active_uri = uri;
665+ g_dbus_proxy_call (_activation_proxy,
666+ "Activate",
667+ g_variant_new ("(s)", uri),
668+ G_DBUS_CALL_FLAGS_NONE,
669+ -1,
670+ NULL,
671+ (GAsyncReadyCallback)OnActivationResultReceived,
672+ this);
673+ }
674+ else
675+ {
676+ result_activated.emit (uri, FALLBACK);
677+ }
678+}
679+
680+void
681+PlaceRemote::OnActivationProxyReady (GObject *source,
682+ GAsyncResult *result,
683+ PlaceRemote *self)
684+{
685+ GError *error = NULL;
686+ gchar *name_owner = NULL;
687+
688+ self->_activation_proxy = g_dbus_proxy_new_for_bus_finish (result, &error);
689+ name_owner = g_dbus_proxy_get_name_owner (self->_activation_proxy);
690+
691+ if (error || !name_owner)
692+ {
693+ g_warning ("Unable to connect to PlaceRemote Activation %s: %s",
694+ self->_dbus_name,
695+ error ? error->message : "No name owner");
696+ if (error)
697+ g_error_free (error);
698+ }
699+
700+ g_free (name_owner);
701+}
702+
703+
704 /*
705 * C callbacks
706 */
707
708=== modified file 'src/PlaceRemote.h'
709--- src/PlaceRemote.h 2010-12-12 19:55:40 +0000
710+++ src/PlaceRemote.h 2011-03-10 14:34:46 +0000
711@@ -49,10 +49,19 @@
712
713 const gchar * GetDBusName ();
714
715+ void ActivateResult (const char *uri, const char *mimetype);
716+
717 private:
718 void LoadKeyFileEntries (GKeyFile *key_file);
719 void Connect ();
720
721+ static void OnActivationProxyReady (GObject *source,
722+ GAsyncResult *result,
723+ PlaceRemote *self);
724+ static void OnActivationResultReceived (GObject *source,
725+ GAsyncResult *result,
726+ PlaceRemote *self);
727+
728 private:
729 char *_path;
730 char *_dbus_name;
731@@ -63,6 +72,8 @@
732
733 GDBusProxy *_service_proxy;
734 GDBusProxy *_activation_proxy;
735+
736+ std::string _active_uri;
737 };
738
739 #endif // PLACE_REMOTE_H
740
741=== modified file 'src/PlacesController.cpp'
742--- src/PlacesController.cpp 2011-03-04 15:01:07 +0000
743+++ src/PlacesController.cpp 2011-03-10 14:34:46 +0000
744@@ -36,7 +36,8 @@
745
746 PlacesController::PlacesController ()
747 : _visible (false),
748- _fullscren_request (false)
749+ _fullscren_request (false),
750+ _timeline_id (0)
751 {
752 // register interest with ubus so that we get activation messages
753 UBusServer *ubus = ubus_server_get_default ();
754@@ -47,7 +48,7 @@
755 (UBusCallback)&PlacesController::CloseRequest,
756 this);
757
758- _factory = new PlaceFactoryFile ();
759+ _factory = PlaceFactory::GetDefault ();
760
761 _window_layout = new nux::HLayout ();
762
763@@ -57,6 +58,7 @@
764 _window->SetConfigureNotifyCallback(&PlacesController::WindowConfigureCallback, this);
765 _window->ShowWindow(false);
766 _window->InputWindowEnableStruts(false);
767+ _window->SetOpacity (0.0f);
768
769 _window->OnMouseDownOutsideArea.connect (sigc::mem_fun (this, &PlacesController::RecvMouseDownOutsideOfView));
770
771@@ -76,6 +78,12 @@
772
773 PlacesSettings::GetDefault ()->changed.connect (sigc::mem_fun (this, &PlacesController::OnSettingsChanged));
774 _view->SetFocused (true);
775+
776+ Relayout (gdk_screen_get_default (), this);
777+ g_signal_connect (gdk_screen_get_default (), "monitors-changed",
778+ G_CALLBACK (PlacesController::Relayout), this);
779+ g_signal_connect (gdk_screen_get_default (), "size-changed",
780+ G_CALLBACK (PlacesController::Relayout), this);
781 }
782
783 PlacesController::~PlacesController ()
784@@ -83,11 +91,28 @@
785 _window->UnReference ();
786 }
787
788+void
789+PlacesController::Relayout (GdkScreen *screen, PlacesController *self)
790+{
791+ int width = 0, height = 0;
792+
793+ gdk_screen_get_monitor_geometry (screen,
794+ gdk_screen_get_primary_monitor (screen),
795+ &self->_monitor_rect);
796+
797+ self->GetWindowSize (&width, &height);
798+ self->_window->SetGeometry (nux::Geometry (self->_monitor_rect.x + _launcher_size,
799+ self->_monitor_rect.y + 24,
800+ width,
801+ height));
802+}
803+
804 void PlacesController::Show ()
805 {
806 if (_visible)
807 return;
808
809+ _view->AboutToShow ();
810 _window->ShowWindow (true, false);
811 // Raise this window on top of all other BaseWindows
812 _window->PushToFront ();
813@@ -96,12 +121,13 @@
814 //_window->GrabKeyboard ();
815 _window->QueueDraw ();
816 _window->CaptureMouseDownAnyWhereElse (true);
817+
818+ StartShowHideTimeline ();
819
820 _visible = true;
821
822 ubus_server_send_message (ubus_server_get_default (), UBUS_PLACE_VIEW_SHOWN, NULL);
823 }
824-
825 void PlacesController::Hide ()
826 {
827 if (!_visible)
828@@ -112,13 +138,13 @@
829 _window->UnGrabPointer ();
830 //_window->UnGrabKeyboard ();
831 _window->EnableInputWindow (false);
832- _window->ShowWindow (false, false);
833-
834 _visible = false;
835 _fullscren_request = false;
836
837 _view->SetActiveEntry (NULL, 0, "");
838
839+ StartShowHideTimeline ();
840+
841 ubus_server_send_message (ubus_server_get_default (), UBUS_PLACE_VIEW_HIDDEN, NULL);
842 }
843
844@@ -128,6 +154,55 @@
845 }
846
847 void
848+PlacesController::StartShowHideTimeline ()
849+{
850+ if (_timeline_id)
851+ g_source_remove (_timeline_id);
852+
853+ _timeline_id = g_timeout_add (15, (GSourceFunc)PlacesController::OnViewShowHideFrame, this);
854+ _last_opacity = _window->GetOpacity ();
855+ _start_time = g_get_monotonic_time ();
856+}
857+
858+gboolean
859+PlacesController::OnViewShowHideFrame (PlacesController *self)
860+{
861+#define _LENGTH_ 90000
862+ gint64 diff;
863+ float progress;
864+ float last_opacity;
865+
866+ diff = g_get_monotonic_time () - self->_start_time;
867+
868+ progress = diff/(float)_LENGTH_;
869+
870+ last_opacity = self->_last_opacity;
871+
872+ if (self->_visible)
873+ {
874+ self->_window->SetOpacity (last_opacity + ((1.0f - last_opacity) * progress));
875+ }
876+ else
877+ {
878+ self->_window->SetOpacity (last_opacity - (last_opacity * progress));
879+ }
880+
881+ if (diff > _LENGTH_)
882+ {
883+ self->_timeline_id = 0;
884+
885+ // Make sure the state is right
886+ self->_window->SetOpacity (self->_visible ? 1.0f : 0.0f);
887+ if (!self->_visible)
888+ self->_window->ShowWindow (false, false);
889+
890+ return FALSE;
891+ }
892+ return TRUE;
893+}
894+
895+
896+void
897 PlacesController::GetWindowSize (int *out_width, int *out_height)
898 {
899 PlacesSettings *settings = PlacesSettings::GetDefault ();
900@@ -173,9 +248,14 @@
901 void
902 PlacesController::WindowConfigureCallback(int WindowWidth, int WindowHeight, nux::Geometry& geo, void *user_data)
903 {
904+ PlacesController *self = static_cast<PlacesController *> (user_data);
905 int width = 0, height = 0;
906- static_cast<PlacesController *> (user_data)->GetWindowSize (&width, &height);
907- geo = nux::Geometry (_launcher_size, 24, width, height);
908+
909+ self->GetWindowSize (&width, &height);
910+ geo = nux::Geometry (self->_monitor_rect.x + self->_launcher_size,
911+ self->_monitor_rect.y + 24,
912+ width,
913+ height);
914 }
915
916 void
917@@ -184,7 +264,10 @@
918 int width = 0, height = 0;
919 _fullscren_request = true;
920 GetWindowSize (&width, &height);
921- _window->SetGeometry (nux::Geometry (_launcher_size, 24, width, height));
922+ _window->SetGeometry (nux::Geometry (_monitor_rect.x + _launcher_size,
923+ _monitor_rect.y + 24,
924+ width,
925+ height));
926 }
927
928 void
929@@ -204,8 +287,7 @@
930 void
931 PlacesController::RecvMouseDownOutsideOfView (int x, int y, unsigned long button_flags, unsigned long key_flags)
932 {
933- //FIXME: We need a way to get the real position/size of the homebutton
934- nux::Geometry geo (0, 0, _launcher_size, 24);
935+ nux::Geometry geo (_monitor_rect.x, _monitor_rect.y, _launcher_size, 24);
936 if (!geo.IsPointInside (x, y))
937 Hide ();
938 }
939
940=== modified file 'src/PlacesController.h'
941--- src/PlacesController.h 2011-03-09 15:04:54 +0000
942+++ src/PlacesController.h 2011-03-10 14:34:46 +0000
943@@ -31,6 +31,7 @@
944 #include "Introspectable.h"
945
946 #include <Nux/BaseWindow.h>
947+#include <Nux/TimelineEasings.h>
948
949 class PlacesController : public Introspectable
950 {
951@@ -43,6 +44,8 @@
952 void ToggleShowHide ();
953 static void SetLauncherSize (int launcher_size);
954
955+ nux::BaseWindow* GetWindow () {return _window;}
956+
957 protected:
958 const gchar* GetName ();
959 void AddProperties (GVariantBuilder *builder);
960@@ -58,18 +61,22 @@
961 void OnSettingsChanged (PlacesSettings *settings);
962 void OnDashFullscreenRequest ();
963 void GetWindowSize (int *width, int *height);
964+ void StartShowHideTimeline ();
965+ static gboolean OnViewShowHideFrame (PlacesController *self);
966+ static void Relayout (GdkScreen *screen, PlacesController *self);
967
968 private:
969 nux::BaseWindow *_window;
970 nux::HLayout *_window_layout;
971 PlacesView *_view;
972- PlaceFactoryFile *_factory;
973+ PlaceFactory *_factory;
974 bool _visible;
975 bool _fullscren_request;
976 static int _launcher_size;
977-
978-public:
979- nux::BaseWindow* GetWindow () {return _window;}
980+ guint _timeline_id;
981+ float _last_opacity;
982+ gint64 _start_time;
983+ GdkRectangle _monitor_rect;
984 };
985
986 #endif // PLACES_CONTROLLER_H
987
988=== modified file 'src/PlacesGroupController.cpp'
989--- src/PlacesGroupController.cpp 2011-03-06 17:40:56 +0000
990+++ src/PlacesGroupController.cpp 2011-03-10 14:34:46 +0000
991@@ -91,9 +91,12 @@
992
993 tile = new PlacesSimpleTile (result_icon,
994 result_name,
995- style->GetTileIconSize ());
996+ style->GetTileIconSize (),
997+ false,
998+ result.GetId ());
999 tile->SetURI (result.GetURI ());
1000 tile->QueueRelayout ();
1001+ tile->sigClick.connect (sigc::mem_fun (this, &PlacesGroupController::TileClicked));
1002
1003 _id_to_tile[result.GetId ()] = tile;
1004
1005@@ -105,21 +108,28 @@
1006 }
1007
1008 void
1009+PlacesGroupController::TileClicked (PlacesTile *tile)
1010+{
1011+ if (_entry)
1012+ {
1013+ _entry->ActivateResult (tile->GetId ());
1014+ }
1015+}
1016+
1017+void
1018 PlacesGroupController::AddResult (PlaceEntryGroup& group, PlaceEntryResult& result)
1019 {
1020 PlacesStyle *style = PlacesStyle::GetDefault ();
1021
1022- if (!_group->GetExpanded ()
1023- && _id_to_tile.size () >= (guint)style->GetDefaultNColumns ())
1024- {
1025- _queue.push_back (result.GetId ());
1026- }
1027- else
1028+ _queue.push_back (result.GetId ());
1029+
1030+ if (_group->GetExpanded ()
1031+ || _id_to_tile.size () != (guint)style->GetDefaultNColumns ())
1032 {
1033 AddTile (_entry, group, result);
1034 }
1035
1036- _group->SetCounts (style->GetDefaultNColumns (), _id_to_tile.size () + _queue.size ());
1037+ _group->SetCounts (style->GetDefaultNColumns (), _queue.size ());
1038 }
1039
1040 void
1041@@ -134,19 +144,21 @@
1042 {
1043 _queue.erase (it);
1044 }
1045- else if ((tile = _id_to_tile[result.GetId ()]))
1046+
1047+ if ((tile = _id_to_tile[result.GetId ()]))
1048 {
1049- _id_to_tile.erase (result.GetId ());
1050-
1051 _group->GetChildLayout ()->RemoveChildObject (tile);
1052 _group->Relayout ();
1053- _group->SetVisible (_id_to_tile.size ());
1054 }
1055+
1056+ _id_to_tile.erase (result.GetId ());
1057
1058 if (!_check_tiles_id)
1059 _check_tiles_id = g_timeout_add (0, (GSourceFunc)CheckTilesTimeout, this);
1060-
1061- _group->SetCounts (PlacesStyle::GetDefault ()->GetDefaultNColumns (), _id_to_tile.size () + _queue.size ());
1062+
1063+ _group->SetVisible (_queue.size ());
1064+ _group->SetCounts (PlacesStyle::GetDefault ()->GetDefaultNColumns (),
1065+ _queue.size ());
1066 }
1067
1068 void
1069@@ -162,7 +174,7 @@
1070 guint n_to_show;
1071
1072 if (_group->GetExpanded ())
1073- n_to_show = _id_to_tile.size () + _queue.size ();
1074+ n_to_show = _queue.size ();
1075 else
1076 n_to_show = style->GetDefaultNColumns ();
1077
1078@@ -172,30 +184,34 @@
1079 }
1080 else if (_id_to_tile.size () < n_to_show)
1081 {
1082- while (_id_to_tile.size () < n_to_show && _queue.size ())
1083- {
1084- _entry->GetResult ((*_queue.begin ()), sigc::mem_fun (this, &PlacesGroupController::AddTile));
1085- _queue.erase (_queue.begin ());
1086- }
1087- }
1088- else // Remove some
1089- {
1090- while (_id_to_tile.size () != n_to_show)
1091- {
1092- std::map<const void *, PlacesTile *>::reverse_iterator it;
1093-
1094- it = _id_to_tile.rbegin ();
1095-
1096- if (it != _id_to_tile.rend ())
1097+ std::vector<const void *>::iterator it = _queue.begin ();
1098+
1099+ if (_queue.size () >= n_to_show)
1100+ {
1101+ it += _id_to_tile.size ();
1102+
1103+ while (_id_to_tile.size () < n_to_show && it != _queue.end ())
1104 {
1105- _group->GetChildLayout ()->RemoveChildObject ((*it).second);
1106+ _entry->GetResult ((*it), sigc::mem_fun (this, &PlacesGroupController::AddTile));
1107+ it++;
1108 }
1109-
1110- _queue.insert (_queue.begin (), (*it).first);
1111- _id_to_tile.erase ((*it).first);
1112- }
1113- }
1114-
1115+ }
1116+ }
1117+ else // Remove some
1118+ {
1119+ std::vector<const void *>::iterator it, eit = _queue.end ();
1120+
1121+ for (it = _queue.begin () + n_to_show; it != eit; ++it)
1122+ {
1123+ PlacesTile *tile = _id_to_tile[*it];
1124+
1125+ if (tile)
1126+ _group->GetChildLayout ()->RemoveChildObject (tile);
1127+
1128+ _id_to_tile.erase (*it);
1129+ }
1130+
1131+ }
1132 _group->Relayout ();
1133 }
1134
1135@@ -208,6 +224,26 @@
1136 return FALSE;
1137 }
1138
1139+bool
1140+PlacesGroupController::ActivateFirst ()
1141+{
1142+ std::vector<const void *>::iterator it = _queue.begin ();
1143+
1144+ if (it != _queue.end ())
1145+ {
1146+ PlacesTile *tile = _id_to_tile[*it];
1147+
1148+ if (tile)
1149+ {
1150+ nux::Geometry geo = tile->GetGeometry ();
1151+ tile->OnMouseClick.emit (geo.x, geo.y, 0, 0);
1152+ return true;
1153+ }
1154+ }
1155+
1156+ return false;
1157+}
1158+
1159 //
1160 // Introspectable
1161 //
1162
1163=== modified file 'src/PlacesGroupController.h'
1164--- src/PlacesGroupController.h 2011-03-06 17:40:56 +0000
1165+++ src/PlacesGroupController.h 2011-03-10 14:34:46 +0000
1166@@ -41,6 +41,8 @@
1167
1168 void Clear ();
1169
1170+ bool ActivateFirst ();
1171+
1172 protected:
1173 const gchar* GetName ();
1174 void AddProperties (GVariantBuilder *builder);
1175@@ -49,6 +51,7 @@
1176 void AddTile (PlaceEntry *ignore, PlaceEntryGroup& group, PlaceEntryResult& result);
1177 void CheckTiles ();
1178 static gboolean CheckTilesTimeout (PlacesGroupController *self);
1179+ void TileClicked (PlacesTile *tile);
1180
1181 private:
1182 PlaceEntry *_entry;
1183
1184=== modified file 'src/PlacesHomeView.cpp'
1185--- src/PlacesHomeView.cpp 2011-02-28 12:58:19 +0000
1186+++ src/PlacesHomeView.cpp 2011-03-10 14:34:46 +0000
1187@@ -126,6 +126,8 @@
1188 NULL, NULL);
1189
1190 Refresh ();
1191+
1192+ expanded.connect (sigc::mem_fun (this, &PlacesHomeView::Refresh));
1193 }
1194
1195 PlacesHomeView::~PlacesHomeView ()
1196@@ -156,6 +158,9 @@
1197
1198 _layout->Clear ();
1199
1200+ if (!GetExpanded ())
1201+ return;
1202+
1203 // Find Media Apps
1204 markup = g_strdup_printf (temp, _("Find Media Apps"));
1205 shortcut = new Shortcut (PKGDATADIR"/find_media_apps.png",
1206
1207=== modified file 'src/PlacesResultsController.cpp'
1208--- src/PlacesResultsController.cpp 2011-03-06 17:40:56 +0000
1209+++ src/PlacesResultsController.cpp 2011-03-10 14:34:46 +0000
1210@@ -103,6 +103,17 @@
1211 _results_view->Clear ();
1212 }
1213
1214+bool
1215+PlacesResultsController::ActivateFirst ()
1216+{
1217+ std::map <const void *, PlacesGroupController *>::iterator it, eit = _id_to_group.end ();
1218+
1219+ for (it = _id_to_group.begin (); it != eit; ++it)
1220+ if ((it->second)->ActivateFirst ())
1221+ return true;
1222+
1223+ return false;
1224+}
1225
1226 //
1227 // Introspection
1228
1229=== modified file 'src/PlacesResultsController.h'
1230--- src/PlacesResultsController.h 2011-03-06 17:40:56 +0000
1231+++ src/PlacesResultsController.h 2011-03-10 14:34:46 +0000
1232@@ -44,6 +44,8 @@
1233 // Clears all the current groups and results
1234 void Clear ();
1235
1236+ bool ActivateFirst ();
1237+
1238 protected:
1239 const gchar* GetName ();
1240 void AddProperties (GVariantBuilder *builder);
1241
1242=== modified file 'src/PlacesSearchBar.cpp'
1243--- src/PlacesSearchBar.cpp 2011-03-05 18:11:55 +0000
1244+++ src/PlacesSearchBar.cpp 2011-03-10 14:34:46 +0000
1245@@ -74,6 +74,7 @@
1246
1247 _pango_entry = new nux::TextEntry ("", NUX_TRACKER_LOCATION);
1248 _pango_entry->sigTextChanged.connect (sigc::mem_fun (this, &PlacesSearchBar::OnSearchChanged));
1249+ _pango_entry->activated.connect (sigc::mem_fun (this, &PlacesSearchBar::OnEntryActivated));
1250 _layered_layout->AddLayer (_pango_entry);
1251
1252 _layered_layout->SetPaintAll (true);
1253@@ -300,6 +301,12 @@
1254 }
1255
1256 void
1257+PlacesSearchBar::OnEntryActivated ()
1258+{
1259+ activated.emit ();
1260+}
1261+
1262+void
1263 PlacesSearchBar::OnFontChanged (GObject *object, GParamSpec *pspec, PlacesSearchBar *self)
1264 {
1265 #define HOW_LARGE 8
1266
1267=== modified file 'src/PlacesSearchBar.h'
1268--- src/PlacesSearchBar.h 2011-03-05 18:11:55 +0000
1269+++ src/PlacesSearchBar.h 2011-03-10 14:34:46 +0000
1270@@ -55,6 +55,7 @@
1271 const char *search_string);
1272
1273 sigc::signal<void, const char *> search_changed;
1274+ sigc::signal<void> activated;
1275
1276 bool CanFocus ();
1277
1278@@ -72,6 +73,7 @@
1279 void OnSectionAdded (PlaceEntry *entry, PlaceEntrySection& section);
1280 void OnComboChanged (nux::ComboBoxSimple *simple);
1281 void OnMenuClosing (nux::MenuPage *menu, int x, int y);
1282+ void OnEntryActivated ();
1283
1284 static bool OnLiveSearchTimeout (PlacesSearchBar *self);
1285 static void OnFontChanged (GObject *object, GParamSpec *pspec, PlacesSearchBar *self);
1286
1287=== modified file 'src/PlacesSettings.cpp'
1288--- src/PlacesSettings.cpp 2011-02-21 11:20:17 +0000
1289+++ src/PlacesSettings.cpp 2011-03-10 14:34:46 +0000
1290@@ -26,7 +26,8 @@
1291 PlacesSettings::PlacesSettings ()
1292 : _settings (NULL),
1293 _raw_from_factor (0),
1294- _form_factor (DESKTOP)
1295+ _form_factor (DESKTOP),
1296+ _dash_blur_type (NO_BLUR)
1297 {
1298 _settings = g_settings_new ("com.canonical.Unity");
1299 g_signal_connect (_settings, "changed",
1300@@ -54,7 +55,7 @@
1301 primary_monitor = gdk_screen_get_primary_monitor (screen);
1302 gdk_screen_get_monitor_geometry (screen, primary_monitor, &geo);
1303
1304- _form_factor = geo.height > 800 ? DESKTOP : NETBOOK;
1305+ _form_factor = geo.height > 799 ? DESKTOP : NETBOOK;
1306 }
1307 else
1308 {
1309@@ -91,3 +92,16 @@
1310 //FIXME: We want to calculate this from DPI
1311 return 140;
1312 }
1313+
1314+PlacesSettings::DashBlurType
1315+PlacesSettings::GetDashBlurType ()
1316+{
1317+ return _dash_blur_type;
1318+}
1319+
1320+void
1321+PlacesSettings::SetDashBlurType (PlacesSettings::DashBlurType type)
1322+{
1323+ _dash_blur_type = type;
1324+}
1325+
1326
1327=== modified file 'src/PlacesSettings.h'
1328--- src/PlacesSettings.h 2011-02-21 11:20:17 +0000
1329+++ src/PlacesSettings.h 2011-03-10 14:34:46 +0000
1330@@ -28,12 +28,18 @@
1331 class PlacesSettings : public nux::Object
1332 {
1333 public:
1334- typedef enum
1335+ enum FormFactor
1336 {
1337 DESKTOP=1,
1338 NETBOOK
1339
1340- } FormFactor;
1341+ };
1342+
1343+ enum DashBlurType
1344+ {
1345+ NO_BLUR=0,
1346+ STATIC_BLUR
1347+ };
1348
1349 PlacesSettings ();
1350 ~PlacesSettings ();
1351@@ -43,6 +49,9 @@
1352 FormFactor GetFormFactor ();
1353 int GetDefaultTileWidth ();
1354
1355+ DashBlurType GetDashBlurType ();
1356+ void SetDashBlurType (DashBlurType type);
1357+
1358 sigc::signal<void, PlacesSettings *> changed;
1359
1360 private:
1361@@ -50,9 +59,10 @@
1362 static void Changed (GSettings *settings, gchar *key, PlacesSettings *self);
1363
1364 private:
1365- GSettings *_settings;
1366- int _raw_from_factor;
1367- FormFactor _form_factor;
1368+ GSettings *_settings;
1369+ int _raw_from_factor;
1370+ FormFactor _form_factor;
1371+ DashBlurType _dash_blur_type;
1372 };
1373
1374 #endif // PLACES_SETTINGS_H
1375
1376=== modified file 'src/PlacesSimpleTile.cpp'
1377--- src/PlacesSimpleTile.cpp 2011-03-01 04:08:36 +0000
1378+++ src/PlacesSimpleTile.cpp 2011-03-10 14:34:46 +0000
1379@@ -26,8 +26,12 @@
1380
1381 #include "PlacesSimpleTile.h"
1382
1383-PlacesSimpleTile::PlacesSimpleTile (const char *icon_name, const char *label, int icon_size, bool defer_icon_loading)
1384-: PlacesTile (NUX_TRACKER_LOCATION),
1385+PlacesSimpleTile::PlacesSimpleTile (const char *icon_name,
1386+ const char *label,
1387+ int icon_size,
1388+ bool defer_icon_loading,
1389+ const void *id)
1390+: PlacesTile (NUX_TRACKER_LOCATION, id),
1391 _label (NULL),
1392 _icon (NULL),
1393 _uri (NULL)
1394@@ -58,8 +62,6 @@
1395
1396 SetLayout (layout);
1397
1398- OnMouseClick.connect (sigc::mem_fun (this, &PlacesSimpleTile::Clicked));
1399-
1400 SetDndEnabled (true, false);
1401 }
1402
1403@@ -190,17 +192,6 @@
1404 }
1405
1406 void
1407-PlacesSimpleTile::Clicked (int x, int y, unsigned long button_flags, unsigned long key_flags)
1408-{
1409- if (_uri)
1410- {
1411- ubus_server_send_message (ubus_server_get_default (),
1412- UBUS_PLACE_TILE_ACTIVATE_REQUEST,
1413- g_variant_new_string (_uri));
1414- }
1415-}
1416-
1417-void
1418 PlacesSimpleTile::LoadIcon ()
1419 {
1420 _icontex->LoadIcon ();
1421
1422=== modified file 'src/PlacesSimpleTile.h'
1423--- src/PlacesSimpleTile.h 2011-03-01 04:08:36 +0000
1424+++ src/PlacesSimpleTile.h 2011-03-10 14:34:46 +0000
1425@@ -31,7 +31,7 @@
1426 {
1427 public:
1428
1429- PlacesSimpleTile (const char *icon, const char *label, int icon_size=64, bool defer_icon_loading=false);
1430+ PlacesSimpleTile (const char *icon, const char *label, int icon_size=64, bool defer_icon_loading=false, const void *id=NULL);
1431 ~PlacesSimpleTile ();
1432
1433 const char * GetLabel ();
1434@@ -53,8 +53,6 @@
1435 virtual std::list<const char *> DndSourceGetDragTypes ();
1436 virtual const char * DndSourceGetDataForType (const char *type, int *size, int *format);
1437 virtual void DndSourceDragFinished (nux::DndAction result);
1438-private:
1439- void Clicked (int x, int y, unsigned long button_flags, unsigned long key_flags);
1440
1441 private:
1442 nux::Geometry _highlight_geometry;
1443
1444=== modified file 'src/PlacesTile.cpp'
1445--- src/PlacesTile.cpp 2011-02-28 22:19:04 +0000
1446+++ src/PlacesTile.cpp 2011-03-10 14:34:46 +0000
1447@@ -27,8 +27,9 @@
1448
1449 #define PADDING 8
1450
1451-PlacesTile::PlacesTile (NUX_FILE_LINE_DECL) :
1452+PlacesTile::PlacesTile (NUX_FILE_LINE_DECL, const void *id) :
1453 View (NUX_FILE_LINE_PARAM),
1454+ _id (id),
1455 _hilight_background (NULL),
1456 _hilight_layer (NULL),
1457 _last_width (0),
1458@@ -55,7 +56,14 @@
1459 delete _hilight_layer;
1460 }
1461
1462-void PlacesTile::OnFocusChanged (nux::Area *area)
1463+const void *
1464+PlacesTile::GetId ()
1465+{
1466+ return _id;
1467+}
1468+
1469+void
1470+PlacesTile::OnFocusChanged (nux::Area *area)
1471 {
1472 QueueDraw ();
1473 }
1474@@ -341,9 +349,3 @@
1475 {
1476 QueueDraw ();
1477 }
1478-
1479-void
1480-PlacesTile::ActivateFocus ()
1481-{
1482- sigClick.emit (this);
1483-}
1484
1485=== modified file 'src/PlacesTile.h'
1486--- src/PlacesTile.h 2011-02-28 16:27:57 +0000
1487+++ src/PlacesTile.h 2011-03-10 14:34:46 +0000
1488@@ -31,13 +31,13 @@
1489 class PlacesTile : public nux::View
1490 {
1491 public:
1492- PlacesTile (NUX_FILE_LINE_PROTO);
1493+ PlacesTile (NUX_FILE_LINE_PROTO, const void *id=NULL);
1494 ~PlacesTile ();
1495
1496+ const void * GetId ();
1497+
1498 sigc::signal<void, PlacesTile*> sigClick;
1499
1500- virtual void ActivateFocus ();
1501-
1502 protected:
1503 virtual nux::Geometry GetHighlightGeometry ();
1504
1505@@ -64,6 +64,7 @@
1506 void DrawHighlight (const char *texid, int width, int height, nux::BaseTexture **texture);
1507
1508 private:
1509+ const void *_id;
1510 nux::BaseTexture *_hilight_background;
1511 nux::TextureLayer *_hilight_layer;
1512
1513
1514=== modified file 'src/PlacesView.cpp'
1515--- src/PlacesView.cpp 2011-03-06 17:40:56 +0000
1516+++ src/PlacesView.cpp 2011-03-10 14:34:46 +0000
1517@@ -30,7 +30,7 @@
1518
1519 #include "PlaceFactory.h"
1520 #include "PlacesStyle.h"
1521-
1522+#include "PlacesSettings.h"
1523 #include "PlacesView.h"
1524
1525 static void place_entry_activate_request (GVariant *payload, PlacesView *self);
1526@@ -43,6 +43,9 @@
1527 _entry (NULL),
1528 _size_mode (SIZE_MODE_FULLSCREEN)
1529 {
1530+ LoadPlaces ();
1531+ _factory->place_added.connect (sigc::mem_fun (this, &PlacesView::OnPlaceAdded));
1532+
1533 _home_entry = new PlaceEntryHome (_factory);
1534
1535 _layout = new nux::HLayout (NUX_TRACKER_LOCATION);
1536@@ -58,6 +61,7 @@
1537 AddChild (_search_bar);
1538
1539 _search_bar->search_changed.connect (sigc::mem_fun (this, &PlacesView::OnSearchChanged));
1540+ _search_bar->activated.connect (sigc::mem_fun (this, &PlacesView::OnEntryActivated));
1541
1542 _layered_layout = new nux::LayeredLayout (NUX_TRACKER_LOCATION);
1543 vlayout->AddLayout (_layered_layout, 1, nux::eCenter, nux::eFull);
1544@@ -96,7 +100,7 @@
1545 (UBusCallback)&PlacesView::CloseRequest,
1546 this);
1547 ubus_server_register_interest (ubus, UBUS_PLACE_TILE_ACTIVATE_REQUEST,
1548- (UBusCallback)&PlacesView::OnResultClicked,
1549+ (UBusCallback)&PlacesView::OnResultActivated,
1550 this);
1551 ubus_server_register_interest (ubus, UBUS_PLACE_VIEW_QUEUE_DRAW,
1552 (UBusCallback)&PlacesView::OnPlaceViewQueueDrawNeeded,
1553@@ -132,13 +136,15 @@
1554 {
1555 PlacesStyle *style = PlacesStyle::GetDefault ();
1556 nux::BaseTexture *corner = style->GetDashCorner ();
1557- nux::Geometry geo = GetGeometry ();
1558- nux::Geometry fullscreen (geo.x + geo.width - corner->GetWidth () + 66,
1559- geo.y + geo.height - corner->GetHeight () + 24,
1560+ nux::Geometry geo = GetAbsoluteGeometry ();
1561+ nux::Geometry fullscreen (geo.x + geo.width - corner->GetWidth (),
1562+ geo.y + geo.height - corner->GetHeight (),
1563 corner->GetWidth (),
1564 corner->GetHeight ());
1565+
1566 if (fullscreen.IsPointInside (ievent.e_x, ievent.e_y))
1567 {
1568+ _bg_blur_texture.Release ();
1569 fullscreen_request.emit ();
1570
1571 return TraverseInfo |= nux::eMouseEventSolved;
1572@@ -154,6 +160,9 @@
1573 {
1574 PlacesStyle *style = PlacesStyle::GetDefault ();
1575 nux::Geometry geo = GetGeometry ();
1576+ nux::Geometry geo_absolute = GetAbsoluteGeometry ();
1577+ PlacesSettings::DashBlurType type = PlacesSettings::GetDefault ()->GetDashBlurType ();
1578+ bool paint_blur = type != PlacesSettings::NO_BLUR;
1579
1580 GfxContext.PushClippingRectangle (geo);
1581
1582@@ -162,6 +171,60 @@
1583 GfxContext.GetRenderStates ().SetBlend (true);
1584 GfxContext.GetRenderStates ().SetPremultipliedBlend (nux::SRC_OVER);
1585
1586+ nux::Geometry _bg_blur_geo = GetGeometry ();
1587+
1588+ if ((_size_mode == SIZE_MODE_HOVER))
1589+ {
1590+ nux::BaseTexture *bottom = style->GetDashBottomTile ();
1591+ nux::BaseTexture *right = style->GetDashRightTile ();
1592+
1593+ _bg_blur_geo.OffsetSize (-right->GetWidth (), -bottom->GetHeight ());
1594+ }
1595+
1596+ if (!_bg_blur_texture.IsValid () && paint_blur)
1597+ {
1598+ nux::ObjectPtr<nux::IOpenGLFrameBufferObject> current_fbo = nux::GetGpuDevice ()->GetCurrentFrameBufferObject ();
1599+ nux::GetGpuDevice ()->DeactivateFrameBuffer ();
1600+
1601+ GfxContext.SetViewport (0, 0, GfxContext.GetWindowWidth (), GfxContext.GetWindowHeight ());
1602+ GfxContext.SetScissor (0, 0, GfxContext.GetWindowWidth (), GfxContext.GetWindowHeight ());
1603+ GfxContext.GetRenderStates ().EnableScissor (false);
1604+
1605+ nux::ObjectPtr <nux::IOpenGLBaseTexture> _bg_texture = GfxContext.CreateTextureFromBackBuffer (
1606+ geo_absolute.x, geo_absolute.y, _bg_blur_geo.width, _bg_blur_geo.height);
1607+
1608+ nux::TexCoordXForm texxform__bg;
1609+ _bg_blur_texture = GfxContext.QRP_GetBlurTexture (0, 0, _bg_blur_geo.width, _bg_blur_geo.height, _bg_texture, texxform__bg, nux::Color::White, 1.0f, 2);
1610+
1611+ if (current_fbo.IsValid ())
1612+ {
1613+ current_fbo->Activate (true);
1614+ GfxContext.Push2DWindow (current_fbo->GetWidth (), current_fbo->GetHeight ());
1615+ }
1616+ else
1617+ {
1618+ GfxContext.SetViewport (0, 0, GfxContext.GetWindowWidth (), GfxContext.GetWindowHeight ());
1619+ GfxContext.Push2DWindow (GfxContext.GetWindowWidth (), GfxContext.GetWindowHeight ());
1620+ GfxContext.ApplyClippingRectangle ();
1621+ }
1622+ }
1623+
1624+ if (_bg_blur_texture.IsValid () && paint_blur)
1625+ {
1626+ nux::TexCoordXForm texxform_blur__bg;
1627+ nux::ROPConfig rop;
1628+ rop.Blend = true;
1629+ rop.SrcBlend = GL_ONE;
1630+ rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
1631+
1632+ gPainter.PushDrawTextureLayer (GfxContext, _bg_blur_geo,
1633+ _bg_blur_texture,
1634+ texxform_blur__bg,
1635+ nux::Color::White,
1636+ true,
1637+ rop);
1638+ }
1639+
1640 if (_size_mode == SIZE_MODE_HOVER)
1641 {
1642 nux::BaseTexture *corner = style->GetDashCorner ();
1643@@ -240,6 +303,9 @@
1644 nux::GetPainter ().RenderSinglePaintLayer (GfxContext, geo, _bg_layer);
1645 }
1646
1647+ if (_bg_blur_texture.IsValid () && paint_blur)
1648+ gPainter.PopBackground ();
1649+
1650 GfxContext.GetRenderStates ().SetBlend (false);
1651
1652 GfxContext.PopClippingRectangle ();
1653@@ -249,16 +315,38 @@
1654 void
1655 PlacesView::DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw)
1656 {
1657+ PlacesSettings::DashBlurType type = PlacesSettings::GetDefault ()->GetDashBlurType ();
1658+ bool paint_blur = type != PlacesSettings::NO_BLUR;
1659+ int bgs = 1;
1660+
1661 GfxContext.PushClippingRectangle (GetGeometry() );
1662 GfxContext.GetRenderStates ().SetBlend (true);
1663 GfxContext.GetRenderStates ().SetPremultipliedBlend (nux::SRC_OVER);
1664
1665+ if (_bg_blur_texture.IsValid () && paint_blur)
1666+ {
1667+
1668+ nux::TexCoordXForm texxform_blur__bg;
1669+ nux::ROPConfig rop;
1670+ rop.Blend = true;
1671+ rop.SrcBlend = GL_ONE;
1672+ rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
1673+
1674+ gPainter.PushTextureLayer (GfxContext, _bg_blur_geo,
1675+ _bg_blur_texture,
1676+ texxform_blur__bg,
1677+ nux::Color::White,
1678+ true,
1679+ rop);
1680+ bgs++;
1681+ }
1682+
1683 nux::GetPainter ().PushLayer (GfxContext, _bg_layer->GetGeometry (), _bg_layer);
1684
1685 if (_layout)
1686 _layout->ProcessDraw (GfxContext, force_draw);
1687
1688- nux::GetPainter ().PopBackground ();
1689+ nux::GetPainter ().PopBackground (bgs);
1690
1691 GfxContext.GetRenderStates ().SetBlend (false);
1692
1693@@ -269,6 +357,12 @@
1694 // PlacesView Methods
1695 //
1696 void
1697+PlacesView::AboutToShow ()
1698+{
1699+ _bg_blur_texture.Release ();
1700+}
1701+
1702+void
1703 PlacesView::SetActiveEntry (PlaceEntry *entry, guint section_id, const char *search_string, bool signal)
1704 {
1705 if (signal)
1706@@ -378,25 +472,17 @@
1707 void
1708 PlacesView::OnResultAdded (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result)
1709 {
1710- //FIXME: We can't do anything with these do just ignore
1711- if (g_str_has_prefix (result.GetURI (), "unity-install"))
1712- return;
1713-
1714 _results_controller->AddResult (entry, group, result);
1715 }
1716
1717 void
1718 PlacesView::OnResultRemoved (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result)
1719 {
1720- //FIXME: We can't do anything with these do just ignore
1721- if (g_str_has_prefix (result.GetURI (), "unity-install"))
1722- return;
1723-
1724 _results_controller->RemoveResult (entry, group, result);
1725 }
1726
1727 void
1728-PlacesView::OnResultClicked (GVariant *data, PlacesView *self)
1729+PlacesView::OnResultActivated (GVariant *data, PlacesView *self)
1730 {
1731 const char *uri;
1732
1733@@ -527,6 +613,52 @@
1734 self->QueueDraw ();
1735 }
1736
1737+void
1738+PlacesView::OnEntryActivated ()
1739+{
1740+ if (!_results_controller->ActivateFirst ())
1741+ g_debug ("Cannot activate anything");
1742+}
1743+
1744+void
1745+PlacesView::LoadPlaces ()
1746+{
1747+ std::vector<Place *>::iterator it, eit = _factory->GetPlaces ().end ();
1748+
1749+ for (it = _factory->GetPlaces ().begin (); it != eit; ++it)
1750+ {
1751+ OnPlaceAdded (*it);
1752+ }
1753+}
1754+
1755+void
1756+PlacesView::OnPlaceAdded (Place *place)
1757+{
1758+ place->result_activated.connect (sigc::mem_fun (this, &PlacesView::OnPlaceResultActivated));
1759+}
1760+
1761+void
1762+PlacesView::OnPlaceResultActivated (const char *uri, ActivationResult res)
1763+{
1764+ switch (res)
1765+ {
1766+ case FALLBACK:
1767+ OnResultActivated (g_variant_new_string (uri), this);
1768+ break;
1769+ case SHOW_DASH:
1770+ break;
1771+ case HIDE_DASH:
1772+ ubus_server_send_message (ubus_server_get_default (),
1773+ UBUS_PLACE_VIEW_CLOSE_REQUEST,
1774+ NULL);
1775+ break;
1776+ default:
1777+ g_warning ("Activation result %d not supported", res);
1778+ break;
1779+ };
1780+}
1781+
1782+
1783 //
1784 // Introspection
1785 //
1786
1787=== modified file 'src/PlacesView.h'
1788--- src/PlacesView.h 2011-03-01 09:22:43 +0000
1789+++ src/PlacesView.h 2011-03-10 14:34:46 +0000
1790@@ -79,6 +79,8 @@
1791 SizeMode GetSizeMode ();
1792 void SetSizeMode (SizeMode size_mode);
1793
1794+ void AboutToShow ();
1795+
1796 // Signals
1797 sigc::signal<void, PlaceEntry *> entry_changed;
1798 sigc::signal<void> fullscreen_request;
1799@@ -95,12 +97,19 @@
1800 void OnResultAdded (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result);
1801 void OnResultRemoved (PlaceEntry *entry, PlaceEntryGroup& group, PlaceEntryResult& result);
1802
1803- static void OnResultClicked (GVariant *data, PlacesView *self);
1804+ bool TryPlaceActivation (const char *uri);
1805+ static void OnResultActivated (GVariant *data, PlacesView *self);
1806 void OnSearchChanged (const char *search_string);
1807 void OnResultsViewGeometryChanged (nux::Area *view, nux::Geometry& view_geo);
1808
1809 static void OnPlaceViewQueueDrawNeeded (GVariant *data, PlacesView *self);
1810
1811+ void OnEntryActivated ();
1812+
1813+ void LoadPlaces ();
1814+ void OnPlaceAdded (Place *place);
1815+ void OnPlaceResultActivated (const char *uri, ActivationResult res);
1816+
1817 private:
1818 PlaceFactory *_factory;
1819 nux::HLayout *_layout;
1820@@ -122,6 +131,9 @@
1821 nux::SpaceLayout *_v_spacer;
1822
1823 SizeMode _size_mode;
1824+
1825+ nux::ObjectPtr <nux::IOpenGLBaseTexture> _bg_blur_texture;
1826+ nux::Geometry _bg_blur_geo;
1827 };
1828
1829 #endif // PANEL_HOME_BUTTON_H
1830
1831=== modified file 'src/unityshell.cpp'
1832--- src/unityshell.cpp 2011-03-10 12:26:04 +0000
1833+++ src/unityshell.cpp 2011-03-10 14:34:46 +0000
1834@@ -30,6 +30,7 @@
1835 #include "Launcher.h"
1836 #include "LauncherIcon.h"
1837 #include "LauncherController.h"
1838+#include "PlacesSettings.h"
1839 #include "PluginAdapter.h"
1840 #include "StartupNotifyService.h"
1841 #include "unityshell.h"
1842@@ -565,6 +566,10 @@
1843 case UnityshellOptions::AutohideAnimation:
1844 launcher->SetAutoHideAnimation ((Launcher::AutoHideAnimation) optionGetAutohideAnimation ());
1845 break;
1846+
1847+ case UnityshellOptions::DashBlurExperimental:
1848+ PlacesSettings::GetDefault ()->SetDashBlurType ((PlacesSettings::DashBlurType)optionGetDashBlurExperimental ());
1849+ break;
1850 default:
1851 break;
1852 }
1853@@ -754,6 +759,7 @@
1854 optionSetPanelOpacityNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
1855 optionSetIconSizeNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
1856 optionSetAutohideAnimationNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
1857+ optionSetDashBlurExperimentalNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
1858 optionSetShowLauncherInitiate (boost::bind (&UnityScreen::showLauncherKeyInitiate, this, _1, _2, _3));
1859 optionSetShowLauncherTerminate (boost::bind (&UnityScreen::showLauncherKeyTerminate, this, _1, _2, _3));
1860 optionSetKeyboardFocusInitiate (boost::bind (&UnityScreen::setKeyboardFocusKeyInitiate, this, _1, _2, _3));
1861
1862=== modified file 'unityshell.xml.in'
1863--- unityshell.xml.in 2011-03-04 15:01:07 +0000
1864+++ unityshell.xml.in 2011-03-10 14:34:46 +0000
1865@@ -144,7 +144,7 @@
1866 <max>1.0</max>
1867 <precision>0.01</precision>
1868 </option>
1869- <option name="icon_size" type="int">
1870+ <option name="icon_size" type="int">
1871 <_short>Launcher icon size</_short>
1872 <_long>The size of the launcher icons</_long>
1873 <default>48</default>
1874@@ -171,6 +171,22 @@
1875 <_name>Fade only</_name>
1876 </desc>
1877 </option>
1878+
1879+ <option name="dash_blur_experimental" type="int">
1880+ <_short>Dash Blur</_short>
1881+ <_long>Type of blur in the Dash</_long>
1882+ <min>0</min>
1883+ <max>1</max>
1884+ <default>0</default>
1885+ <desc>
1886+ <value>0</value>
1887+ <_name>No Blur</_name>
1888+ </desc>
1889+ <desc>
1890+ <value>1</value>
1891+ <_name>Static Blur</_name>
1892+ </desc>
1893+ </option>
1894 </group>
1895 </options>
1896 </plugin>