Merge lp:~unity-team/unity/fixes-2011-04-04 into lp:unity
- fixes-2011-04-04
- Merge into trunk
Proposed by
Neil J. Patel
Status: | Merged | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Gord Allott | ||||||||||||||||||||||||||||
Approved revision: | no longer in the source branch. | ||||||||||||||||||||||||||||
Merged at revision: | 1084 | ||||||||||||||||||||||||||||
Proposed branch: | lp:~unity-team/unity/fixes-2011-04-04 | ||||||||||||||||||||||||||||
Merge into: | lp:unity | ||||||||||||||||||||||||||||
Diff against target: |
614 lines (+118/-69) 23 files modified
src/IndicatorObjectFactoryRemote.cpp (+2/-2) src/LauncherIcon.cpp (+5/-0) src/LauncherIcon.h (+1/-1) src/PanelController.cpp (+7/-0) src/PanelHomeButton.cpp (+3/-1) src/PanelHomeButton.h (+1/-0) src/PanelMenuView.cpp (+1/-1) src/PlaceFactoryFile.cpp (+34/-1) src/PlaceFactoryFile.h (+4/-2) src/PlaceLauncherSection.cpp (+4/-2) src/PlaceLauncherSection.h (+2/-0) src/PlaceRemote.cpp (+6/-0) src/PlaceRemote.h (+1/-1) src/PlacesController.cpp (+1/-1) src/PlacesHorizontalTile.cpp (+13/-11) src/PlacesSettings.cpp (+2/-2) src/PlacesSimpleTile.cpp (+8/-7) src/PlacesTile.cpp (+7/-32) src/QuicklistMenuItemCheckmark.cpp (+1/-1) src/QuicklistMenuItemLabel.cpp (+1/-1) src/QuicklistMenuItemRadio.cpp (+1/-1) src/StaticCairoText.cpp (+9/-1) src/StaticCairoText.h (+4/-1) |
||||||||||||||||||||||||||||
To merge this branch: | bzr merge lp:~unity-team/unity/fixes-2011-04-04 | ||||||||||||||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gord Allott | Pending | ||
Review via email: mp+56769@code.launchpad.net |
Commit message
Description of the change
Bugs attached plus some misc fixes.
To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/IndicatorObjectFactoryRemote.cpp' | |||
2 | --- src/IndicatorObjectFactoryRemote.cpp 2011-03-31 22:02:34 +0000 | |||
3 | +++ src/IndicatorObjectFactoryRemote.cpp 2011-04-07 13:41:22 +0000 | |||
4 | @@ -537,8 +537,8 @@ | |||
5 | 537 | } | 537 | } |
6 | 538 | else if (g_strcmp0 (signal_name, "EntryShowNowChanged") == 0) | 538 | else if (g_strcmp0 (signal_name, "EntryShowNowChanged") == 0) |
7 | 539 | { | 539 | { |
10 | 540 | gchar *id = NULL; | 540 | gchar *id = NULL; |
11 | 541 | bool show_now_state; | 541 | gboolean show_now_state; |
12 | 542 | 542 | ||
13 | 543 | g_variant_get (parameters, "(sb)", &id, &show_now_state); | 543 | g_variant_get (parameters, "(sb)", &id, &show_now_state); |
14 | 544 | 544 | ||
15 | 545 | 545 | ||
16 | === modified file 'src/LauncherIcon.cpp' | |||
17 | --- src/LauncherIcon.cpp 2011-04-06 17:53:41 +0000 | |||
18 | +++ src/LauncherIcon.cpp 2011-04-07 13:41:22 +0000 | |||
19 | @@ -71,6 +71,7 @@ | |||
20 | 71 | _mouse_inside = false; | 71 | _mouse_inside = false; |
21 | 72 | _has_visible_window = false; | 72 | _has_visible_window = false; |
22 | 73 | _tooltip = new nux::Tooltip (); | 73 | _tooltip = new nux::Tooltip (); |
23 | 74 | _tooltip->SinkReference (); | ||
24 | 74 | _icon_type = TYPE_NONE; | 75 | _icon_type = TYPE_NONE; |
25 | 75 | _sort_priority = 0; | 76 | _sort_priority = 0; |
26 | 76 | _shortcut = 0; | 77 | _shortcut = 0; |
27 | @@ -79,6 +80,7 @@ | |||
28 | 79 | _superkey_label = 0; | 80 | _superkey_label = 0; |
29 | 80 | 81 | ||
30 | 81 | _quicklist = new QuicklistView (); | 82 | _quicklist = new QuicklistView (); |
31 | 83 | _quicklist->SinkReference (); | ||
32 | 82 | _quicklist_is_initialized = false; | 84 | _quicklist_is_initialized = false; |
33 | 83 | 85 | ||
34 | 84 | _present_time_handle = 0; | 86 | _present_time_handle = 0; |
35 | @@ -133,6 +135,9 @@ | |||
36 | 133 | 135 | ||
37 | 134 | if (on_order_changed_connection.connected ()) | 136 | if (on_order_changed_connection.connected ()) |
38 | 135 | on_order_changed_connection.disconnect (); | 137 | on_order_changed_connection.disconnect (); |
39 | 138 | |||
40 | 139 | _quicklist->UnReference (); | ||
41 | 140 | _tooltip->UnReference (); | ||
42 | 136 | } | 141 | } |
43 | 137 | 142 | ||
44 | 138 | bool | 143 | bool |
45 | 139 | 144 | ||
46 | === modified file 'src/LauncherIcon.h' | |||
47 | --- src/LauncherIcon.h 2011-03-31 20:33:43 +0000 | |||
48 | +++ src/LauncherIcon.h 2011-04-07 13:41:22 +0000 | |||
49 | @@ -88,6 +88,7 @@ | |||
50 | 88 | 88 | ||
51 | 89 | void SetShortcut (guint64 shortcut); | 89 | void SetShortcut (guint64 shortcut); |
52 | 90 | guint64 GetShortcut (); | 90 | guint64 GetShortcut (); |
53 | 91 | void SetSortPriority (int priority); | ||
54 | 91 | 92 | ||
55 | 92 | void RecvMouseEnter (); | 93 | void RecvMouseEnter (); |
56 | 93 | void RecvMouseLeave (); | 94 | void RecvMouseLeave (); |
57 | @@ -182,7 +183,6 @@ | |||
58 | 182 | void Unpresent (); | 183 | void Unpresent (); |
59 | 183 | 184 | ||
60 | 184 | void SetIconType (IconType type); | 185 | void SetIconType (IconType type); |
61 | 185 | void SetSortPriority (int priority); | ||
62 | 186 | 186 | ||
63 | 187 | void SetEmblem (nux::BaseTexture *emblem); | 187 | void SetEmblem (nux::BaseTexture *emblem); |
64 | 188 | void SetSuperkeyLabel (nux::BaseTexture* label); | 188 | void SetSuperkeyLabel (nux::BaseTexture* label); |
65 | 189 | 189 | ||
66 | === modified file 'src/PanelController.cpp' | |||
67 | --- src/PanelController.cpp 2011-03-29 16:02:03 +0000 | |||
68 | +++ src/PanelController.cpp 2011-04-07 13:41:22 +0000 | |||
69 | @@ -134,8 +134,12 @@ | |||
70 | 134 | (*it)->EnableInputWindow (true); | 134 | (*it)->EnableInputWindow (true); |
71 | 135 | (*it)->InputWindowEnableStruts (true); | 135 | (*it)->InputWindowEnableStruts (true); |
72 | 136 | 136 | ||
73 | 137 | g_debug ("PanelController:: Updated Panel for Monitor %d", i); | ||
74 | 138 | |||
75 | 137 | i++; | 139 | i++; |
76 | 138 | } | 140 | } |
77 | 141 | else | ||
78 | 142 | break; | ||
79 | 139 | } | 143 | } |
80 | 140 | 144 | ||
81 | 141 | // Add new ones if needed | 145 | // Add new ones if needed |
82 | @@ -181,6 +185,8 @@ | |||
83 | 181 | unity_util_accessible_add_window (window); | 185 | unity_util_accessible_add_window (window); |
84 | 182 | 186 | ||
85 | 183 | _windows.push_back (window); | 187 | _windows.push_back (window); |
86 | 188 | |||
87 | 189 | g_debug ("PanelController:: Added Panel for Monitor %d", i); | ||
88 | 184 | } | 190 | } |
89 | 185 | } | 191 | } |
90 | 186 | 192 | ||
91 | @@ -190,6 +196,7 @@ | |||
92 | 190 | for (sit = it; sit != eit; ++sit) | 196 | for (sit = it; sit != eit; ++sit) |
93 | 191 | { | 197 | { |
94 | 192 | (*sit)->UnReference (); | 198 | (*sit)->UnReference (); |
95 | 199 | g_debug ("PanelController:: Removed extra Panel"); | ||
96 | 193 | } | 200 | } |
97 | 194 | 201 | ||
98 | 195 | _windows.erase (it, _windows.end ()); | 202 | _windows.erase (it, _windows.end ()); |
99 | 196 | 203 | ||
100 | === modified file 'src/PanelHomeButton.cpp' | |||
101 | --- src/PanelHomeButton.cpp 2011-04-06 17:53:41 +0000 | |||
102 | +++ src/PanelHomeButton.cpp 2011-04-07 13:41:22 +0000 | |||
103 | @@ -56,7 +56,7 @@ | |||
104 | 56 | G_CALLBACK (PanelHomeButton::OnIconThemeChanged), this); | 56 | G_CALLBACK (PanelHomeButton::OnIconThemeChanged), this); |
105 | 57 | 57 | ||
106 | 58 | UBusServer *ubus = ubus_server_get_default (); | 58 | UBusServer *ubus = ubus_server_get_default (); |
108 | 59 | ubus_server_register_interest (ubus, UBUS_LAUNCHER_ICON_URGENT_CHANGED, | 59 | _urgent_interest = ubus_server_register_interest (ubus, UBUS_LAUNCHER_ICON_URGENT_CHANGED, |
109 | 60 | (UBusCallback)&PanelHomeButton::OnLauncherIconUrgentChanged, | 60 | (UBusCallback)&PanelHomeButton::OnLauncherIconUrgentChanged, |
110 | 61 | this); | 61 | this); |
111 | 62 | 62 | ||
112 | @@ -67,6 +67,8 @@ | |||
113 | 67 | { | 67 | { |
114 | 68 | if (_theme_changed_id) | 68 | if (_theme_changed_id) |
115 | 69 | g_signal_handler_disconnect (gtk_icon_theme_get_default (), _theme_changed_id); | 69 | g_signal_handler_disconnect (gtk_icon_theme_get_default (), _theme_changed_id); |
116 | 70 | |||
117 | 71 | ubus_server_unregister_interest (ubus_server_get_default (), _urgent_interest); | ||
118 | 70 | } | 72 | } |
119 | 71 | 73 | ||
120 | 72 | void | 74 | void |
121 | 73 | 75 | ||
122 | === modified file 'src/PanelHomeButton.h' | |||
123 | --- src/PanelHomeButton.h 2011-03-29 12:23:52 +0000 | |||
124 | +++ src/PanelHomeButton.h 2011-04-07 13:41:22 +0000 | |||
125 | @@ -60,6 +60,7 @@ | |||
126 | 60 | int _urgent_count; | 60 | int _urgent_count; |
127 | 61 | 61 | ||
128 | 62 | gulong _theme_changed_id; | 62 | gulong _theme_changed_id; |
129 | 63 | guint _urgent_interest; | ||
130 | 63 | }; | 64 | }; |
131 | 64 | 65 | ||
132 | 65 | #endif // PANEL_HOME_BUTTON_H | 66 | #endif // PANEL_HOME_BUTTON_H |
133 | 66 | 67 | ||
134 | === modified file 'src/PanelMenuView.cpp' | |||
135 | --- src/PanelMenuView.cpp 2011-04-07 08:48:01 +0000 | |||
136 | +++ src/PanelMenuView.cpp 2011-04-07 13:41:22 +0000 | |||
137 | @@ -100,7 +100,7 @@ | |||
138 | 100 | _on_winbutton_redraw_signal_connection = _window_buttons->redraw_signal.connect (sigc::mem_fun (this, &PanelMenuView::OnWindowButtonsRedraw)); | 100 | _on_winbutton_redraw_signal_connection = _window_buttons->redraw_signal.connect (sigc::mem_fun (this, &PanelMenuView::OnWindowButtonsRedraw)); |
139 | 101 | 101 | ||
140 | 102 | _panel_titlebar_grab_area = new PanelTitlebarGrabArea (); | 102 | _panel_titlebar_grab_area = new PanelTitlebarGrabArea (); |
142 | 103 | _panel_titlebar_grab_area->Reference (); | 103 | _panel_titlebar_grab_area->SinkReference (); |
143 | 104 | _on_titlebargrab_mouse_down_connnection = _panel_titlebar_grab_area->mouse_down.connect (sigc::mem_fun (this, &PanelMenuView::OnMaximizedGrab)); | 104 | _on_titlebargrab_mouse_down_connnection = _panel_titlebar_grab_area->mouse_down.connect (sigc::mem_fun (this, &PanelMenuView::OnMaximizedGrab)); |
144 | 105 | _on_titlebargrab_mouse_doubleleftclick_connnection = _panel_titlebar_grab_area->mouse_doubleleftclick.connect (sigc::mem_fun (this, &PanelMenuView::OnMouseDoubleClicked)); | 105 | _on_titlebargrab_mouse_doubleleftclick_connnection = _panel_titlebar_grab_area->mouse_doubleleftclick.connect (sigc::mem_fun (this, &PanelMenuView::OnMouseDoubleClicked)); |
145 | 106 | _on_titlebargrab_mouse_middleclick_connnection = _panel_titlebar_grab_area->mouse_middleclick.connect (sigc::mem_fun (this, &PanelMenuView::OnMouseMiddleClicked)); | 106 | _on_titlebargrab_mouse_middleclick_connnection = _panel_titlebar_grab_area->mouse_middleclick.connect (sigc::mem_fun (this, &PanelMenuView::OnMouseMiddleClicked)); |
146 | 107 | 107 | ||
147 | === modified file 'src/PlaceFactoryFile.cpp' | |||
148 | --- src/PlaceFactoryFile.cpp 2011-03-09 12:40:14 +0000 | |||
149 | +++ src/PlaceFactoryFile.cpp 2011-04-07 13:41:22 +0000 | |||
150 | @@ -17,6 +17,8 @@ | |||
151 | 17 | */ | 17 | */ |
152 | 18 | #include "config.h" | 18 | #include "config.h" |
153 | 19 | 19 | ||
154 | 20 | #include <algorithm> | ||
155 | 21 | |||
156 | 20 | #include "PlaceFactoryFile.h" | 22 | #include "PlaceFactoryFile.h" |
157 | 21 | 23 | ||
158 | 22 | #include "PlaceRemote.h" | 24 | #include "PlaceRemote.h" |
159 | @@ -120,7 +122,6 @@ | |||
160 | 120 | if (place->IsValid ()) | 122 | if (place->IsValid ()) |
161 | 121 | { | 123 | { |
162 | 122 | _places.push_back (place); | 124 | _places.push_back (place); |
163 | 123 | place_added.emit (place); | ||
164 | 124 | } | 125 | } |
165 | 125 | else | 126 | else |
166 | 126 | delete place; | 127 | delete place; |
167 | @@ -142,11 +143,43 @@ | |||
168 | 142 | return; | 143 | return; |
169 | 143 | } | 144 | } |
170 | 144 | 145 | ||
171 | 146 | // Sort them | ||
172 | 147 | std::sort (_places.begin (), _places.end (), DoSortThemMister); | ||
173 | 148 | |||
174 | 149 | // Signal their creation | ||
175 | 150 | std::vector<Place *>::iterator it, eit = _places.end (); | ||
176 | 151 | for (it = _places.begin (); it != eit; ++it) | ||
177 | 152 | { | ||
178 | 153 | place_added.emit (*it); | ||
179 | 154 | g_debug ("%s", static_cast<PlaceRemote *> (*it)->GetDBusPath ()); | ||
180 | 155 | } | ||
181 | 156 | |||
182 | 145 | read_directory = true; | 157 | read_directory = true; |
183 | 146 | 158 | ||
184 | 147 | g_object_unref (enumerator); | 159 | g_object_unref (enumerator); |
185 | 148 | } | 160 | } |
186 | 149 | 161 | ||
187 | 162 | bool | ||
188 | 163 | PlaceFactoryFile::DoSortThemMister (Place *aa, Place *bb) | ||
189 | 164 | { | ||
190 | 165 | #define FIRST "/com/canonical/unity/applicationsplace" | ||
191 | 166 | #define SECOND "/com/canonical/unity/filesplace" | ||
192 | 167 | |||
193 | 168 | PlaceRemote *a = static_cast<PlaceRemote *> (aa); | ||
194 | 169 | PlaceRemote *b = static_cast<PlaceRemote *> (bb); | ||
195 | 170 | |||
196 | 171 | if (g_strcmp0 (a->GetDBusPath (), FIRST) == 0) | ||
197 | 172 | return true; | ||
198 | 173 | else if (g_strcmp0 (b->GetDBusPath (), FIRST) == 0) | ||
199 | 174 | return false; | ||
200 | 175 | else if (g_strcmp0 (a->GetDBusPath (), SECOND) == 0) | ||
201 | 176 | return true; | ||
202 | 177 | else if (g_strcmp0 (b->GetDBusPath (), SECOND) == 0) | ||
203 | 178 | return false; | ||
204 | 179 | else | ||
205 | 180 | return g_strcmp0 (a->GetDBusPath (), b->GetDBusPath ()) == 0; | ||
206 | 181 | } | ||
207 | 182 | |||
208 | 150 | /* | 183 | /* |
209 | 151 | * C to C++ glue | 184 | * C to C++ glue |
210 | 152 | */ | 185 | */ |
211 | 153 | 186 | ||
212 | === modified file 'src/PlaceFactoryFile.h' | |||
213 | --- src/PlaceFactoryFile.h 2010-12-10 18:40:26 +0000 | |||
214 | +++ src/PlaceFactoryFile.h 2011-04-07 13:41:22 +0000 | |||
215 | @@ -42,10 +42,12 @@ | |||
216 | 42 | /* Callbacks, not interesting to others */ | 42 | /* Callbacks, not interesting to others */ |
217 | 43 | void OnDirectoryEnumerationReady (GObject *source, | 43 | void OnDirectoryEnumerationReady (GObject *source, |
218 | 44 | GAsyncResult *result); | 44 | GAsyncResult *result); |
220 | 45 | 45 | private: | |
221 | 46 | static bool DoSortThemMister (Place *a, Place *b); | ||
222 | 47 | |||
223 | 46 | public: | 48 | public: |
224 | 47 | /* For Debugging */ | 49 | /* For Debugging */ |
226 | 48 | bool read_directory; | 50 | bool read_directory; |
227 | 49 | 51 | ||
228 | 50 | private: | 52 | private: |
229 | 51 | char *_directory; | 53 | char *_directory; |
230 | 52 | 54 | ||
231 | === modified file 'src/PlaceLauncherSection.cpp' | |||
232 | --- src/PlaceLauncherSection.cpp 2011-03-29 14:36:45 +0000 | |||
233 | +++ src/PlaceLauncherSection.cpp 2011-04-07 13:41:22 +0000 | |||
234 | @@ -21,7 +21,8 @@ | |||
235 | 21 | #include "PlaceLauncherSection.h" | 21 | #include "PlaceLauncherSection.h" |
236 | 22 | 22 | ||
237 | 23 | PlaceLauncherSection::PlaceLauncherSection (Launcher *launcher) | 23 | PlaceLauncherSection::PlaceLauncherSection (Launcher *launcher) |
239 | 24 | : _launcher (launcher) | 24 | : _launcher (launcher), |
240 | 25 | _priority (10000) | ||
241 | 25 | { | 26 | { |
242 | 26 | _factory = PlaceFactory::GetDefault (); | 27 | _factory = PlaceFactory::GetDefault (); |
243 | 27 | _on_place_added_connection = (sigc::connection) _factory->place_added.connect (sigc::mem_fun (this, | 28 | _on_place_added_connection = (sigc::connection) _factory->place_added.connect (sigc::mem_fun (this, |
244 | @@ -49,6 +50,7 @@ | |||
245 | 49 | if (entry->ShowInLauncher ()) | 50 | if (entry->ShowInLauncher ()) |
246 | 50 | { | 51 | { |
247 | 51 | PlaceLauncherIcon *icon = new PlaceLauncherIcon (_launcher, entry); | 52 | PlaceLauncherIcon *icon = new PlaceLauncherIcon (_launcher, entry); |
248 | 53 | icon->SetSortPriority (_priority++); | ||
249 | 52 | IconAdded.emit (icon); | 54 | IconAdded.emit (icon); |
250 | 53 | } | 55 | } |
251 | 54 | } | 56 | } |
252 | @@ -73,9 +75,9 @@ | |||
253 | 73 | if (entry->ShowInLauncher ()) | 75 | if (entry->ShowInLauncher ()) |
254 | 74 | { | 76 | { |
255 | 75 | PlaceLauncherIcon *icon = new PlaceLauncherIcon (_launcher, entry); | 77 | PlaceLauncherIcon *icon = new PlaceLauncherIcon (_launcher, entry); |
256 | 78 | icon->SetSortPriority (_priority++); | ||
257 | 76 | IconAdded.emit (icon); | 79 | IconAdded.emit (icon); |
258 | 77 | } | 80 | } |
259 | 78 | } | 81 | } |
260 | 79 | } | 82 | } |
261 | 80 | } | 83 | } |
262 | 81 | |||
263 | 82 | 84 | ||
264 | === modified file 'src/PlaceLauncherSection.h' | |||
265 | --- src/PlaceLauncherSection.h 2011-03-29 14:36:45 +0000 | |||
266 | +++ src/PlaceLauncherSection.h 2011-04-07 13:41:22 +0000 | |||
267 | @@ -43,6 +43,8 @@ | |||
268 | 43 | Launcher *_launcher; | 43 | Launcher *_launcher; |
269 | 44 | PlaceFactory *_factory; | 44 | PlaceFactory *_factory; |
270 | 45 | sigc::connection _on_place_added_connection; | 45 | sigc::connection _on_place_added_connection; |
271 | 46 | |||
272 | 47 | guint32 _priority; | ||
273 | 46 | }; | 48 | }; |
274 | 47 | 49 | ||
275 | 48 | #endif // _PLACE_LAUNCHER_SECTION_H_ | 50 | #endif // _PLACE_LAUNCHER_SECTION_H_ |
276 | 49 | 51 | ||
277 | === modified file 'src/PlaceRemote.cpp' | |||
278 | --- src/PlaceRemote.cpp 2011-03-09 19:57:01 +0000 | |||
279 | +++ src/PlaceRemote.cpp 2011-04-07 13:41:22 +0000 | |||
280 | @@ -204,6 +204,12 @@ | |||
281 | 204 | g_object_unref (_activation_proxy); | 204 | g_object_unref (_activation_proxy); |
282 | 205 | } | 205 | } |
283 | 206 | 206 | ||
284 | 207 | const gchar * | ||
285 | 208 | PlaceRemote::GetDBusPath () | ||
286 | 209 | { | ||
287 | 210 | return _dbus_path; | ||
288 | 211 | } | ||
289 | 212 | |||
290 | 207 | void | 213 | void |
291 | 208 | PlaceRemote::Connect () | 214 | PlaceRemote::Connect () |
292 | 209 | { | 215 | { |
293 | 210 | 216 | ||
294 | === modified file 'src/PlaceRemote.h' | |||
295 | --- src/PlaceRemote.h 2011-03-09 16:26:43 +0000 | |||
296 | +++ src/PlaceRemote.h 2011-04-07 13:41:22 +0000 | |||
297 | @@ -47,7 +47,7 @@ | |||
298 | 47 | void OnEntryAdded (GVariant *args); | 47 | void OnEntryAdded (GVariant *args); |
299 | 48 | void OnEntryRemoved (const gchar *dbus_path); | 48 | void OnEntryRemoved (const gchar *dbus_path); |
300 | 49 | 49 | ||
302 | 50 | const gchar * GetDBusName (); | 50 | const gchar * GetDBusPath (); |
303 | 51 | 51 | ||
304 | 52 | void ActivateResult (const char *uri, const char *mimetype); | 52 | void ActivateResult (const char *uri, const char *mimetype); |
305 | 53 | 53 | ||
306 | 54 | 54 | ||
307 | === modified file 'src/PlacesController.cpp' | |||
308 | --- src/PlacesController.cpp 2011-04-06 16:35:35 +0000 | |||
309 | +++ src/PlacesController.cpp 2011-04-07 13:41:22 +0000 | |||
310 | @@ -252,7 +252,7 @@ | |||
311 | 252 | width += tile_width; | 252 | width += tile_width; |
312 | 253 | 253 | ||
313 | 254 | width = MAX (width, tile_width * 7); | 254 | width = MAX (width, tile_width * 7); |
315 | 255 | height = ((width/tile_width) - 3) * tile_width; | 255 | height = MIN (rect.height, (style->GetTileHeight () * 5.5) + 12); |
316 | 256 | 256 | ||
317 | 257 | _view->SetSizeMode (PlacesView::SIZE_MODE_HOVER); | 257 | _view->SetSizeMode (PlacesView::SIZE_MODE_HOVER); |
318 | 258 | style->SetDefaultNColumns (6); | 258 | style->SetDefaultNColumns (6); |
319 | 259 | 259 | ||
320 | === modified file 'src/PlacesHorizontalTile.cpp' | |||
321 | --- src/PlacesHorizontalTile.cpp 2011-03-29 22:16:19 +0000 | |||
322 | +++ src/PlacesHorizontalTile.cpp 2011-04-07 13:41:22 +0000 | |||
323 | @@ -47,16 +47,17 @@ | |||
324 | 47 | _comment = g_strdup_printf ("<small>%s</small>", comment); | 47 | _comment = g_strdup_printf ("<small>%s</small>", comment); |
325 | 48 | 48 | ||
326 | 49 | int w = (PlacesSettings::GetDefault ()->GetDefaultTileWidth () * 2) - icon_size - 24;//padding | 49 | int w = (PlacesSettings::GetDefault ()->GetDefaultTileWidth () * 2) - icon_size - 24;//padding |
327 | 50 | int lines = 0; | ||
328 | 50 | 51 | ||
329 | 51 | nux::HLayout *layout = new nux::HLayout ("", NUX_TRACKER_LOCATION); | 52 | nux::HLayout *layout = new nux::HLayout ("", NUX_TRACKER_LOCATION); |
331 | 52 | layout->AddLayout (new nux::SpaceLayout (0, 0, 12, 12)); | 53 | layout->AddLayout (new nux::SpaceLayout (6, 6, 0, 0)); |
332 | 53 | 54 | ||
333 | 54 | _icontex = new IconTexture (_icon, icon_size, defer_icon_loading); | 55 | _icontex = new IconTexture (_icon, icon_size, defer_icon_loading); |
335 | 55 | _icontex->SetMinMaxSize (icon_size * 1.5, icon_size); | 56 | _icontex->SetMinMaxSize (icon_size, icon_size); |
336 | 56 | AddChild (_icontex); | 57 | AddChild (_icontex); |
338 | 57 | layout->AddView (_icontex, 0, nux::eCenter, nux::eFull); | 58 | layout->AddView (_icontex, 0, nux::eLeft, nux::eFix); |
339 | 58 | 59 | ||
341 | 59 | layout->AddLayout (new nux::SpaceLayout (0, 0, 12, 12)); | 60 | layout->AddLayout (new nux::SpaceLayout (6, 6, 0, 0)); |
342 | 60 | 61 | ||
343 | 61 | nux::VLayout *vlayout = new nux::VLayout ("", NUX_TRACKER_LOCATION); | 62 | nux::VLayout *vlayout = new nux::VLayout ("", NUX_TRACKER_LOCATION); |
344 | 62 | layout->AddView (vlayout, 1, nux::eLeft, nux::eFull); | 63 | layout->AddView (vlayout, 1, nux::eLeft, nux::eFull); |
345 | @@ -66,12 +67,14 @@ | |||
346 | 66 | _cairotext = new nux::StaticCairoText (_label); | 67 | _cairotext = new nux::StaticCairoText (_label); |
347 | 67 | _cairotext->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_LEFT); | 68 | _cairotext->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_LEFT); |
348 | 68 | _cairotext->SetMaximumWidth (w); | 69 | _cairotext->SetMaximumWidth (w); |
349 | 70 | _cairotext->SetLines (-2); | ||
350 | 69 | vlayout->AddView (_cairotext, 0, nux::eLeft, nux::eFull); | 71 | vlayout->AddView (_cairotext, 0, nux::eLeft, nux::eFull); |
351 | 72 | lines = _cairotext->GetLineCount (); | ||
352 | 70 | 73 | ||
353 | 71 | _cairotext = new nux::StaticCairoText (_comment); | 74 | _cairotext = new nux::StaticCairoText (_comment); |
354 | 72 | _cairotext->SetTextEllipsize (nux::StaticCairoText::NUX_ELLIPSIZE_END); | 75 | _cairotext->SetTextEllipsize (nux::StaticCairoText::NUX_ELLIPSIZE_END); |
355 | 73 | _cairotext->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_LEFT); | 76 | _cairotext->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_LEFT); |
357 | 74 | _cairotext->SetLines (-3); | 77 | _cairotext->SetLines (-1 * (4 - lines)); |
358 | 75 | _cairotext->SetMaximumWidth (w); | 78 | _cairotext->SetMaximumWidth (w); |
359 | 76 | _cairotext->SetTextColor (nux::Color (1.0f, 1.0f, 1.0f, 0.8f)); | 79 | _cairotext->SetTextColor (nux::Color (1.0f, 1.0f, 1.0f, 0.8f)); |
360 | 77 | vlayout->AddView (_cairotext, 1, nux::eLeft, nux::eFull); | 80 | vlayout->AddView (_cairotext, 1, nux::eLeft, nux::eFull); |
361 | @@ -197,13 +200,12 @@ | |||
362 | 197 | { | 200 | { |
363 | 198 | nux::Geometry base = GetGeometry (); | 201 | nux::Geometry base = GetGeometry (); |
364 | 199 | int width = 0, height = 0; | 202 | int width = 0, height = 0; |
365 | 200 | |||
366 | 201 | _icontex->GetTextureSize (&width, &height); | 203 | _icontex->GetTextureSize (&width, &height); |
372 | 202 | 204 | ||
373 | 203 | _highlight_geometry.x = 12; | 205 | _highlight_geometry.x = 6; |
374 | 204 | _highlight_geometry.y = 12; | 206 | _highlight_geometry.y = 6; |
375 | 205 | _highlight_geometry.width = width; | 207 | _highlight_geometry.width = _icontex->GetMaximumWidth (); |
376 | 206 | _highlight_geometry.height = height; | 208 | _highlight_geometry.height = base.height - 12; |
377 | 207 | 209 | ||
378 | 208 | return _highlight_geometry; | 210 | return _highlight_geometry; |
379 | 209 | } | 211 | } |
380 | 210 | 212 | ||
381 | === modified file 'src/PlacesSettings.cpp' | |||
382 | --- src/PlacesSettings.cpp 2011-03-13 19:23:11 +0000 | |||
383 | +++ src/PlacesSettings.cpp 2011-04-07 13:41:22 +0000 | |||
384 | @@ -20,6 +20,7 @@ | |||
385 | 20 | #include "gdk/gdk.h" | 20 | #include "gdk/gdk.h" |
386 | 21 | 21 | ||
387 | 22 | #include "PlacesSettings.h" | 22 | #include "PlacesSettings.h" |
388 | 23 | #include "PlacesStyle.h" | ||
389 | 23 | 24 | ||
390 | 24 | #define HOME_EXPANDED "home-expanded" | 25 | #define HOME_EXPANDED "home-expanded" |
391 | 25 | 26 | ||
392 | @@ -91,8 +92,7 @@ | |||
393 | 91 | int | 92 | int |
394 | 92 | PlacesSettings::GetDefaultTileWidth () | 93 | PlacesSettings::GetDefaultTileWidth () |
395 | 93 | { | 94 | { |
398 | 94 | //FIXME: We want to calculate this from DPI | 95 | return PlacesStyle::GetDefault ()->GetTileWidth (); |
397 | 95 | return 140; | ||
399 | 96 | } | 96 | } |
400 | 97 | 97 | ||
401 | 98 | PlacesSettings::DashBlurType | 98 | PlacesSettings::DashBlurType |
402 | 99 | 99 | ||
403 | === modified file 'src/PlacesSimpleTile.cpp' | |||
404 | --- src/PlacesSimpleTile.cpp 2011-03-29 15:57:38 +0000 | |||
405 | +++ src/PlacesSimpleTile.cpp 2011-04-07 13:41:22 +0000 | |||
406 | @@ -20,7 +20,7 @@ | |||
407 | 20 | * | 20 | * |
408 | 21 | */ | 21 | */ |
409 | 22 | 22 | ||
411 | 23 | #include "PlacesSettings.h" | 23 | #include "PlacesStyle.h" |
412 | 24 | #include "ubus-server.h" | 24 | #include "ubus-server.h" |
413 | 25 | #include "UBusMessages.h" | 25 | #include "UBusMessages.h" |
414 | 26 | 26 | ||
415 | @@ -40,29 +40,30 @@ | |||
416 | 40 | _icon (NULL), | 40 | _icon (NULL), |
417 | 41 | _uri (NULL) | 41 | _uri (NULL) |
418 | 42 | { | 42 | { |
419 | 43 | PlacesStyle *style = PlacesStyle::GetDefault (); | ||
420 | 43 | nux::VLayout *layout = new nux::VLayout ("", NUX_TRACKER_LOCATION); | 44 | nux::VLayout *layout = new nux::VLayout ("", NUX_TRACKER_LOCATION); |
421 | 44 | 45 | ||
422 | 45 | _label = g_strdup (label); | 46 | _label = g_strdup (label); |
423 | 46 | _icon = g_strdup (icon_name); | 47 | _icon = g_strdup (icon_name); |
424 | 47 | 48 | ||
425 | 48 | _icontex = new IconTexture (_icon, icon_size, defer_icon_loading); | 49 | _icontex = new IconTexture (_icon, icon_size, defer_icon_loading); |
427 | 49 | _icontex->SetMinMaxSize (PlacesSettings::GetDefault ()->GetDefaultTileWidth (), icon_size); | 50 | _icontex->SetMinMaxSize (style->GetTileWidth (), icon_size); |
428 | 50 | _icontex->SinkReference (); | 51 | _icontex->SinkReference (); |
429 | 51 | AddChild (_icontex); | 52 | AddChild (_icontex); |
430 | 52 | 53 | ||
432 | 53 | _cairotext = new nux::StaticCairoText (_label); | 54 | _cairotext = new nux::StaticCairoText (""); |
433 | 55 | _cairotext->SetMaximumWidth (style->GetTileWidth ()); | ||
434 | 54 | _cairotext->SinkReference (); | 56 | _cairotext->SinkReference (); |
435 | 55 | |||
436 | 56 | _cairotext->SetTextEllipsize (nux::StaticCairoText::NUX_ELLIPSIZE_START); | 57 | _cairotext->SetTextEllipsize (nux::StaticCairoText::NUX_ELLIPSIZE_START); |
437 | 57 | _cairotext->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_CENTRE); | 58 | _cairotext->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_CENTRE); |
440 | 58 | _cairotext->SetMaximumWidth (140); | 59 | _cairotext->SetText (_label); |
441 | 59 | 60 | ||
442 | 60 | layout->AddLayout (new nux::SpaceLayout (0, 0, 12, 12)); | 61 | layout->AddLayout (new nux::SpaceLayout (0, 0, 12, 12)); |
443 | 61 | layout->AddView (_icontex, 0, nux::eCenter, nux::eFull); | 62 | layout->AddView (_icontex, 0, nux::eCenter, nux::eFull); |
444 | 62 | layout->AddLayout (new nux::SpaceLayout (0, 0, 12, 12)); | 63 | layout->AddLayout (new nux::SpaceLayout (0, 0, 12, 12)); |
445 | 63 | layout->AddView (_cairotext, 0, nux::eCenter, nux::eFull); | 64 | layout->AddView (_cairotext, 0, nux::eCenter, nux::eFull); |
446 | 64 | 65 | ||
448 | 65 | SetMinMaxSize (160, 128); | 66 | SetMinMaxSize (style->GetTileWidth (), style->GetTileHeight ()); |
449 | 66 | 67 | ||
450 | 67 | SetLayout (layout); | 68 | SetLayout (layout); |
451 | 68 | 69 | ||
452 | 69 | 70 | ||
453 | === modified file 'src/PlacesTile.cpp' | |||
454 | --- src/PlacesTile.cpp 2011-04-06 17:53:41 +0000 | |||
455 | +++ src/PlacesTile.cpp 2011-04-07 13:41:22 +0000 | |||
456 | @@ -115,9 +115,7 @@ | |||
457 | 115 | true); | 115 | true); |
458 | 116 | cairo_fill (cr); | 116 | cairo_fill (cr); |
459 | 117 | cairo_graphics->BlurSurface (BLUR_SIZE - 2); | 117 | cairo_graphics->BlurSurface (BLUR_SIZE - 2); |
463 | 118 | 118 | ||
461 | 119 | // draw tiled background | ||
462 | 120 | // set up clip path | ||
464 | 121 | cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); | 119 | cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); |
465 | 122 | cairo_graphics->DrawRoundedRectangle (cr, | 120 | cairo_graphics->DrawRoundedRectangle (cr, |
466 | 123 | 1.0, | 121 | 1.0, |
467 | @@ -128,44 +126,21 @@ | |||
468 | 128 | bg_height, | 126 | bg_height, |
469 | 129 | true); | 127 | true); |
470 | 130 | cairo_clip (cr); | 128 | cairo_clip (cr); |
471 | 131 | |||
472 | 132 | int w, h; | ||
473 | 133 | cairo_surface_t *image; | ||
474 | 134 | cairo_pattern_t *pattern; | ||
475 | 135 | |||
476 | 136 | cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0); | ||
477 | 137 | image = cairo_image_surface_create_from_png (PKGDATADIR"/places-tile-bg-tilable.png"); | ||
478 | 138 | w = cairo_image_surface_get_width (image); | ||
479 | 139 | h = cairo_image_surface_get_height (image); | ||
480 | 140 | |||
481 | 141 | |||
482 | 142 | pattern = cairo_pattern_create_for_surface (image); | ||
483 | 143 | cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); | ||
484 | 144 | |||
485 | 145 | cairo_set_source (cr, pattern); | ||
486 | 146 | |||
487 | 147 | cairo_rectangle (cr, 0, 0, base.width, base.height); | ||
488 | 148 | cairo_fill (cr); | ||
489 | 149 | |||
490 | 150 | cairo_pattern_destroy (pattern); | ||
491 | 151 | cairo_surface_destroy (image); | ||
492 | 152 | |||
493 | 153 | // draw the outline | ||
494 | 154 | |||
495 | 155 | cairo_set_operator (cr, CAIRO_OPERATOR_OVER); | 129 | cairo_set_operator (cr, CAIRO_OPERATOR_OVER); |
496 | 156 | 130 | ||
497 | 157 | cairo_graphics->DrawRoundedRectangle (cr, | 131 | cairo_graphics->DrawRoundedRectangle (cr, |
498 | 158 | 1.0, | 132 | 1.0, |
499 | 159 | bg_x, | 133 | bg_x, |
501 | 160 | bg_y, | 134 | bg_y, |
502 | 161 | 5.0, | 135 | 5.0, |
503 | 162 | bg_width, | 136 | bg_width, |
504 | 163 | bg_height, | 137 | bg_height, |
505 | 164 | true); | 138 | true); |
510 | 165 | cairo_set_source_rgba (cr, 0.66, 0.66, 0.66, 1.0); | 139 | cairo_set_source_rgba (cr, 240/255.0f, 240/255.0f, 240/255.0f, 1.0f); |
511 | 166 | cairo_set_line_width (cr, 1.0); | 140 | cairo_fill_preserve (cr); |
512 | 167 | cairo_stroke (cr); | 141 | |
513 | 168 | 142 | cairo_set_source_rgba (cr, 1.0f, 1.0f, 1.0f, 1.0); | |
514 | 143 | cairo_stroke (cr); | ||
515 | 169 | 144 | ||
516 | 170 | cairo_destroy (cr); | 145 | cairo_destroy (cr); |
517 | 171 | 146 | ||
518 | 172 | 147 | ||
519 | === modified file 'src/QuicklistMenuItemCheckmark.cpp' | |||
520 | --- src/QuicklistMenuItemCheckmark.cpp 2011-04-06 17:53:41 +0000 | |||
521 | +++ src/QuicklistMenuItemCheckmark.cpp 2011-04-07 13:41:22 +0000 | |||
522 | @@ -191,7 +191,7 @@ | |||
523 | 191 | texture = _normalTexture[0]->GetDeviceTexture (); | 191 | texture = _normalTexture[0]->GetDeviceTexture (); |
524 | 192 | } | 192 | } |
525 | 193 | 193 | ||
527 | 194 | _color = nux::Colors::Gray; | 194 | _color = nux::Color (0.8f, 0.8f, 0.8f, 1.0f); |
528 | 195 | } | 195 | } |
529 | 196 | 196 | ||
530 | 197 | gfxContext.QRP_1Tex (base.x, | 197 | gfxContext.QRP_1Tex (base.x, |
531 | 198 | 198 | ||
532 | === modified file 'src/QuicklistMenuItemLabel.cpp' | |||
533 | --- src/QuicklistMenuItemLabel.cpp 2011-04-06 17:53:41 +0000 | |||
534 | +++ src/QuicklistMenuItemLabel.cpp 2011-04-07 13:41:22 +0000 | |||
535 | @@ -162,7 +162,7 @@ | |||
536 | 162 | else | 162 | else |
537 | 163 | { | 163 | { |
538 | 164 | texture = _normalTexture[0]->GetDeviceTexture (); | 164 | texture = _normalTexture[0]->GetDeviceTexture (); |
540 | 165 | _color = nux::Colors::Gray; | 165 | _color = nux::Color (0.8f, 0.8f, 0.8f, 1.0f); |
541 | 166 | } | 166 | } |
542 | 167 | 167 | ||
543 | 168 | gfxContext.QRP_1Tex (base.x, | 168 | gfxContext.QRP_1Tex (base.x, |
544 | 169 | 169 | ||
545 | === modified file 'src/QuicklistMenuItemRadio.cpp' | |||
546 | --- src/QuicklistMenuItemRadio.cpp 2011-04-06 17:53:41 +0000 | |||
547 | +++ src/QuicklistMenuItemRadio.cpp 2011-04-07 13:41:22 +0000 | |||
548 | @@ -191,7 +191,7 @@ | |||
549 | 191 | texture = _normalTexture[0]->GetDeviceTexture (); | 191 | texture = _normalTexture[0]->GetDeviceTexture (); |
550 | 192 | } | 192 | } |
551 | 193 | 193 | ||
553 | 194 | _color = nux::Colors::Gray; | 194 | _color = nux::Color (0.8f, 0.8f, 0.8f, 1.0f); |
554 | 195 | } | 195 | } |
555 | 196 | 196 | ||
556 | 197 | gfxContext.QRP_1Tex (base.x, | 197 | gfxContext.QRP_1Tex (base.x, |
557 | 198 | 198 | ||
558 | === modified file 'src/StaticCairoText.cpp' | |||
559 | --- src/StaticCairoText.cpp 2011-03-29 22:16:19 +0000 | |||
560 | +++ src/StaticCairoText.cpp 2011-04-07 13:41:22 +0000 | |||
561 | @@ -36,7 +36,8 @@ | |||
562 | 36 | _fontstring (NULL), | 36 | _fontstring (NULL), |
563 | 37 | _cairoGraphics (NULL), | 37 | _cairoGraphics (NULL), |
564 | 38 | _texture2D (NULL), | 38 | _texture2D (NULL), |
566 | 39 | _lines (-2) | 39 | _lines (-2), |
567 | 40 | _actual_lines (0) | ||
568 | 40 | 41 | ||
569 | 41 | { | 42 | { |
570 | 42 | _textColor = Color(1.0f, 1.0f, 1.0f, 1.0f); | 43 | _textColor = Color(1.0f, 1.0f, 1.0f, 1.0f); |
571 | @@ -260,6 +261,11 @@ | |||
572 | 260 | sigFontChanged.emit (this); | 261 | sigFontChanged.emit (this); |
573 | 261 | } | 262 | } |
574 | 262 | 263 | ||
575 | 264 | int | ||
576 | 265 | StaticCairoText::GetLineCount () | ||
577 | 266 | { | ||
578 | 267 | return _actual_lines; | ||
579 | 268 | } | ||
580 | 263 | 269 | ||
581 | 264 | void StaticCairoText::GetTextExtents (int &width, int &height) | 270 | void StaticCairoText::GetTextExtents (int &width, int &height) |
582 | 265 | { | 271 | { |
583 | @@ -447,6 +453,8 @@ | |||
584 | 447 | cairo_move_to (cr, 0.0f, 0.0f); | 453 | cairo_move_to (cr, 0.0f, 0.0f); |
585 | 448 | pango_cairo_show_layout (cr, layout); | 454 | pango_cairo_show_layout (cr, layout); |
586 | 449 | 455 | ||
587 | 456 | _actual_lines = pango_layout_get_line_count (layout); | ||
588 | 457 | |||
589 | 450 | // clean up | 458 | // clean up |
590 | 451 | pango_font_description_free (desc); | 459 | pango_font_description_free (desc); |
591 | 452 | g_object_unref (layout); | 460 | g_object_unref (layout); |
592 | 453 | 461 | ||
593 | === modified file 'src/StaticCairoText.h' | |||
594 | --- src/StaticCairoText.h 2011-03-29 22:16:19 +0000 | |||
595 | +++ src/StaticCairoText.h 2011-04-07 13:41:22 +0000 | |||
596 | @@ -86,7 +86,9 @@ | |||
597 | 86 | void SetTextAlignment (AlignState state); | 86 | void SetTextAlignment (AlignState state); |
598 | 87 | void SetTextVerticalAlignment (AlignState state); | 87 | void SetTextVerticalAlignment (AlignState state); |
599 | 88 | void SetFont (const char *fontstring); | 88 | void SetFont (const char *fontstring); |
601 | 89 | void SetLines (int lines); | 89 | void SetLines (int maximum_lines); |
602 | 90 | |||
603 | 91 | int GetLineCount (); | ||
604 | 90 | 92 | ||
605 | 91 | void GetTextExtents (int &width, int &height); | 93 | void GetTextExtents (int &width, int &height); |
606 | 92 | 94 | ||
607 | @@ -113,6 +115,7 @@ | |||
608 | 113 | int _pre_layout_height; | 115 | int _pre_layout_height; |
609 | 114 | 116 | ||
610 | 115 | int _lines; | 117 | int _lines; |
611 | 118 | int _actual_lines; | ||
612 | 116 | 119 | ||
613 | 117 | void GetTextExtents (const TCHAR* font, | 120 | void GetTextExtents (const TCHAR* font, |
614 | 118 | int& width, | 121 | int& width, |
On Fri, 08 Apr 2011 01:42:07 you wrote: le::DoSortThemM ister (Place *aa, Place *bb) /unity/ applicationspla ce" /unity/ filesplace"
> +bool
> +PlaceFactoryFi
> +{
> +#define FIRST "/com/canonical
> +#define SECOND "/com/canonical
> +
For the love of clean code, what is wrong with:
static const char* const apps_place = /unity/ applicationspla ce"; /unity/ filesplace" ;
"/com/canonical
static const char* const files_place = "/com/canonical
#defines are brutal hammers that just aren't needed in places like this.