Merge lp:~azzar1/unity/fix-713087 into lp:unity
- fix-713087
- Merge into trunk
Proposed by
Andrea Azzarone
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Gord Allott | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 931 | ||||
Proposed branch: | lp:~azzar1/unity/fix-713087 | ||||
Merge into: | lp:unity | ||||
Diff against target: |
279 lines (+59/-14) 8 files modified
src/Launcher.cpp (+1/-0) src/PanelHomeButton.cpp (+21/-9) src/PanelHomeButton.h (+3/-1) src/PlacesController.cpp (+12/-4) src/PlacesController.h (+2/-0) src/unityshell.cpp (+10/-0) src/unityshell.h (+2/-0) unityshell.xml.in (+8/-0) |
||||
To merge this branch: | bzr merge lp:~azzar1/unity/fix-713087 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gord Allott | Pending | ||
Review via email: mp+52206@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/Launcher.cpp' | |||
2 | --- src/Launcher.cpp 2011-03-01 11:25:44 +0000 | |||
3 | +++ src/Launcher.cpp 2011-03-04 15:16:33 +0000 | |||
4 | @@ -1844,6 +1844,7 @@ | |||
5 | 1844 | _icon_size = tile_size; | 1844 | _icon_size = tile_size; |
6 | 1845 | _icon_image_size = icon_size; | 1845 | _icon_image_size = icon_size; |
7 | 1846 | _icon_image_size_delta = tile_size - icon_size; | 1846 | _icon_image_size_delta = tile_size - icon_size; |
8 | 1847 | _icon_glow_size = icon_size + 14; | ||
9 | 1847 | 1848 | ||
10 | 1848 | // recreate tile textures | 1849 | // recreate tile textures |
11 | 1849 | 1850 | ||
12 | 1850 | 1851 | ||
13 | === modified file 'src/PanelHomeButton.cpp' | |||
14 | --- src/PanelHomeButton.cpp 2011-02-23 11:18:17 +0000 | |||
15 | +++ src/PanelHomeButton.cpp 2011-03-04 15:16:33 +0000 | |||
16 | @@ -35,15 +35,14 @@ | |||
17 | 35 | #include "PanelStyle.h" | 35 | #include "PanelStyle.h" |
18 | 36 | 36 | ||
19 | 37 | #define PANEL_HEIGHT 24 | 37 | #define PANEL_HEIGHT 24 |
20 | 38 | #define BUTTON_WIDTH 66 | ||
21 | 39 | 38 | ||
22 | 40 | NUX_IMPLEMENT_OBJECT_TYPE (PanelHomeButton); | 39 | NUX_IMPLEMENT_OBJECT_TYPE (PanelHomeButton); |
23 | 41 | 40 | ||
24 | 42 | PanelHomeButton::PanelHomeButton () | 41 | PanelHomeButton::PanelHomeButton () |
27 | 43 | : TextureArea (NUX_TRACKER_LOCATION), | 42 | : TextureArea (NUX_TRACKER_LOCATION) |
26 | 44 | _util_cg (CAIRO_FORMAT_ARGB32, BUTTON_WIDTH, PANEL_HEIGHT) | ||
28 | 45 | { | 43 | { |
30 | 46 | SetMinMaxSize (BUTTON_WIDTH, PANEL_HEIGHT); | 44 | _button_width = 66; |
31 | 45 | SetMinMaxSize (_button_width, PANEL_HEIGHT); | ||
32 | 47 | 46 | ||
33 | 48 | OnMouseClick.connect (sigc::mem_fun (this, &PanelHomeButton::RecvMouseClick)); | 47 | OnMouseClick.connect (sigc::mem_fun (this, &PanelHomeButton::RecvMouseClick)); |
34 | 49 | 48 | ||
35 | @@ -63,17 +62,19 @@ | |||
36 | 63 | void | 62 | void |
37 | 64 | PanelHomeButton::Refresh () | 63 | PanelHomeButton::Refresh () |
38 | 65 | { | 64 | { |
40 | 66 | int width = BUTTON_WIDTH; | 65 | int width = _button_width; |
41 | 67 | int height = PANEL_HEIGHT; | 66 | int height = PANEL_HEIGHT; |
42 | 68 | GdkPixbuf *pixbuf; | 67 | GdkPixbuf *pixbuf; |
43 | 69 | 68 | ||
44 | 69 | SetMinMaxSize (_button_width, PANEL_HEIGHT); | ||
45 | 70 | |||
46 | 70 | nux::CairoGraphics cairo_graphics(CAIRO_FORMAT_ARGB32, width, height); | 71 | nux::CairoGraphics cairo_graphics(CAIRO_FORMAT_ARGB32, width, height); |
47 | 71 | cairo_t *cr = cairo_graphics.GetContext(); | 72 | cairo_t *cr = cairo_graphics.GetContext(); |
48 | 72 | cairo_set_line_width (cr, 1); | 73 | cairo_set_line_width (cr, 1); |
49 | 73 | 74 | ||
50 | 74 | pixbuf = PanelStyle::GetDefault ()->GetHomeButton (); | 75 | pixbuf = PanelStyle::GetDefault ()->GetHomeButton (); |
51 | 75 | gdk_cairo_set_source_pixbuf (cr, pixbuf, | 76 | gdk_cairo_set_source_pixbuf (cr, pixbuf, |
53 | 76 | (BUTTON_WIDTH-gdk_pixbuf_get_width (pixbuf))/2, | 77 | (_button_width-gdk_pixbuf_get_width (pixbuf))/2, |
54 | 77 | (PANEL_HEIGHT-gdk_pixbuf_get_height (pixbuf))/2); | 78 | (PANEL_HEIGHT-gdk_pixbuf_get_height (pixbuf))/2); |
55 | 78 | g_object_unref (pixbuf); | 79 | g_object_unref (pixbuf); |
56 | 79 | 80 | ||
57 | @@ -144,7 +145,7 @@ | |||
58 | 144 | g_variant_builder_init (&builder, G_VARIANT_TYPE ("(iiiia{sv})")); | 145 | g_variant_builder_init (&builder, G_VARIANT_TYPE ("(iiiia{sv})")); |
59 | 145 | g_variant_builder_add (&builder, "i", x); | 146 | g_variant_builder_add (&builder, "i", x); |
60 | 146 | g_variant_builder_add (&builder, "i", y); | 147 | g_variant_builder_add (&builder, "i", y); |
62 | 147 | g_variant_builder_add (&builder, "i", BUTTON_WIDTH); | 148 | g_variant_builder_add (&builder, "i", _button_width); |
63 | 148 | g_variant_builder_add (&builder, "i", PANEL_HEIGHT); | 149 | g_variant_builder_add (&builder, "i", PANEL_HEIGHT); |
64 | 149 | 150 | ||
65 | 150 | g_variant_builder_open (&builder, G_VARIANT_TYPE ("a{sv}")); | 151 | g_variant_builder_open (&builder, G_VARIANT_TYPE ("a{sv}")); |
66 | @@ -164,7 +165,7 @@ | |||
67 | 164 | g_variant_builder_init (&builder, G_VARIANT_TYPE ("(iiiia{sv})")); | 165 | g_variant_builder_init (&builder, G_VARIANT_TYPE ("(iiiia{sv})")); |
68 | 165 | g_variant_builder_add (&builder, "i", x); | 166 | g_variant_builder_add (&builder, "i", x); |
69 | 166 | g_variant_builder_add (&builder, "i", y); | 167 | g_variant_builder_add (&builder, "i", y); |
71 | 167 | g_variant_builder_add (&builder, "i", BUTTON_WIDTH); | 168 | g_variant_builder_add (&builder, "i", _button_width); |
72 | 168 | g_variant_builder_add (&builder, "i", PANEL_HEIGHT); | 169 | g_variant_builder_add (&builder, "i", PANEL_HEIGHT); |
73 | 169 | 170 | ||
74 | 170 | g_variant_builder_open (&builder, G_VARIANT_TYPE ("a{sv}")); | 171 | g_variant_builder_open (&builder, G_VARIANT_TYPE ("a{sv}")); |
75 | @@ -184,7 +185,7 @@ | |||
76 | 184 | g_variant_builder_init (&builder, G_VARIANT_TYPE ("(iiiia{sv})")); | 185 | g_variant_builder_init (&builder, G_VARIANT_TYPE ("(iiiia{sv})")); |
77 | 185 | g_variant_builder_add (&builder, "i", x); | 186 | g_variant_builder_add (&builder, "i", x); |
78 | 186 | g_variant_builder_add (&builder, "i", y); | 187 | g_variant_builder_add (&builder, "i", y); |
80 | 187 | g_variant_builder_add (&builder, "i", BUTTON_WIDTH); | 188 | g_variant_builder_add (&builder, "i", _button_width); |
81 | 188 | g_variant_builder_add (&builder, "i", PANEL_HEIGHT); | 189 | g_variant_builder_add (&builder, "i", PANEL_HEIGHT); |
82 | 189 | 190 | ||
83 | 190 | g_variant_builder_open (&builder, G_VARIANT_TYPE ("a{sv}")); | 191 | g_variant_builder_open (&builder, G_VARIANT_TYPE ("a{sv}")); |
84 | @@ -195,6 +196,17 @@ | |||
85 | 195 | ubus_server_send_message (ubus, UBUS_HOME_BUTTON_TRIGGER_UPDATE, g_variant_builder_end (&builder)); | 196 | ubus_server_send_message (ubus, UBUS_HOME_BUTTON_TRIGGER_UPDATE, g_variant_builder_end (&builder)); |
86 | 196 | } | 197 | } |
87 | 197 | 198 | ||
88 | 199 | void | ||
89 | 200 | PanelHomeButton::SetButtonWidth (int button_width) | ||
90 | 201 | { | ||
91 | 202 | if (_button_width == button_width) | ||
92 | 203 | return; | ||
93 | 204 | |||
94 | 205 | _button_width = button_width; | ||
95 | 206 | |||
96 | 207 | Refresh(); | ||
97 | 208 | } | ||
98 | 209 | |||
99 | 198 | const gchar* | 210 | const gchar* |
100 | 199 | PanelHomeButton::GetName () | 211 | PanelHomeButton::GetName () |
101 | 200 | { | 212 | { |
102 | 201 | 213 | ||
103 | === modified file 'src/PanelHomeButton.h' | |||
104 | --- src/PanelHomeButton.h 2011-02-17 09:56:22 +0000 | |||
105 | +++ src/PanelHomeButton.h 2011-03-04 15:16:33 +0000 | |||
106 | @@ -42,6 +42,8 @@ | |||
107 | 42 | 42 | ||
108 | 43 | void RecvMouseMove(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags); | 43 | void RecvMouseMove(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags); |
109 | 44 | 44 | ||
110 | 45 | void SetButtonWidth (int button_width); | ||
111 | 46 | |||
112 | 45 | protected: | 47 | protected: |
113 | 46 | const gchar* GetName (); | 48 | const gchar* GetName (); |
114 | 47 | void AddProperties (GVariantBuilder *builder); | 49 | void AddProperties (GVariantBuilder *builder); |
115 | @@ -50,7 +52,7 @@ | |||
116 | 50 | void Refresh (); | 52 | void Refresh (); |
117 | 51 | 53 | ||
118 | 52 | private: | 54 | private: |
120 | 53 | nux::CairoGraphics _util_cg; | 55 | int _button_width; |
121 | 54 | }; | 56 | }; |
122 | 55 | 57 | ||
123 | 56 | #endif // PANEL_HOME_BUTTON_H | 58 | #endif // PANEL_HOME_BUTTON_H |
124 | 57 | 59 | ||
125 | === modified file 'src/PlacesController.cpp' | |||
126 | --- src/PlacesController.cpp 2011-02-28 16:49:11 +0000 | |||
127 | +++ src/PlacesController.cpp 2011-03-04 15:16:33 +0000 | |||
128 | @@ -32,6 +32,8 @@ | |||
129 | 32 | 32 | ||
130 | 33 | #include "PlacesController.h" | 33 | #include "PlacesController.h" |
131 | 34 | 34 | ||
132 | 35 | int PlacesController::_launcher_size = 66; | ||
133 | 36 | |||
134 | 35 | PlacesController::PlacesController () | 37 | PlacesController::PlacesController () |
135 | 36 | : _visible (false), | 38 | : _visible (false), |
136 | 37 | _fullscren_request (false) | 39 | _fullscren_request (false) |
137 | @@ -156,7 +158,7 @@ | |||
138 | 156 | } | 158 | } |
139 | 157 | else | 159 | else |
140 | 158 | { | 160 | { |
142 | 159 | width = rect.width - 66; | 161 | width = rect.width - _launcher_size; |
143 | 160 | height = rect.height - 24; | 162 | height = rect.height - 24; |
144 | 161 | 163 | ||
145 | 162 | _view->SetSizeMode (PlacesView::SIZE_MODE_FULLSCREEN); | 164 | _view->SetSizeMode (PlacesView::SIZE_MODE_FULLSCREEN); |
146 | @@ -173,7 +175,7 @@ | |||
147 | 173 | { | 175 | { |
148 | 174 | int width = 0, height = 0; | 176 | int width = 0, height = 0; |
149 | 175 | static_cast<PlacesController *> (user_data)->GetWindowSize (&width, &height); | 177 | static_cast<PlacesController *> (user_data)->GetWindowSize (&width, &height); |
151 | 176 | geo = nux::Geometry (66, 24, width, height); | 178 | geo = nux::Geometry (_launcher_size, 24, width, height); |
152 | 177 | } | 179 | } |
153 | 178 | 180 | ||
154 | 179 | void | 181 | void |
155 | @@ -182,7 +184,7 @@ | |||
156 | 182 | int width = 0, height = 0; | 184 | int width = 0, height = 0; |
157 | 183 | _fullscren_request = true; | 185 | _fullscren_request = true; |
158 | 184 | GetWindowSize (&width, &height); | 186 | GetWindowSize (&width, &height); |
160 | 185 | _window->SetGeometry (nux::Geometry (66, 24, width, height)); | 187 | _window->SetGeometry (nux::Geometry (_launcher_size, 24, width, height)); |
161 | 186 | } | 188 | } |
162 | 187 | 189 | ||
163 | 188 | void | 190 | void |
164 | @@ -203,7 +205,7 @@ | |||
165 | 203 | PlacesController::RecvMouseDownOutsideOfView (int x, int y, unsigned long button_flags, unsigned long key_flags) | 205 | PlacesController::RecvMouseDownOutsideOfView (int x, int y, unsigned long button_flags, unsigned long key_flags) |
166 | 204 | { | 206 | { |
167 | 205 | //FIXME: We need a way to get the real position/size of the homebutton | 207 | //FIXME: We need a way to get the real position/size of the homebutton |
169 | 206 | nux::Geometry geo (0, 0, 66, 24); | 208 | nux::Geometry geo (0, 0, _launcher_size, 24); |
170 | 207 | if (!geo.IsPointInside (x, y)) | 209 | if (!geo.IsPointInside (x, y)) |
171 | 208 | Hide (); | 210 | Hide (); |
172 | 209 | } | 211 | } |
173 | @@ -214,6 +216,12 @@ | |||
174 | 214 | entry ? Show () : Hide (); | 216 | entry ? Show () : Hide (); |
175 | 215 | } | 217 | } |
176 | 216 | 218 | ||
177 | 219 | void | ||
178 | 220 | PlacesController::SetLauncherSize (int launcher_size) | ||
179 | 221 | { | ||
180 | 222 | _launcher_size = launcher_size; | ||
181 | 223 | } | ||
182 | 224 | |||
183 | 217 | 225 | ||
184 | 218 | /* Introspection */ | 226 | /* Introspection */ |
185 | 219 | const gchar * | 227 | const gchar * |
186 | 220 | 228 | ||
187 | === modified file 'src/PlacesController.h' | |||
188 | --- src/PlacesController.h 2011-02-28 14:16:05 +0000 | |||
189 | +++ src/PlacesController.h 2011-03-04 15:16:33 +0000 | |||
190 | @@ -41,6 +41,7 @@ | |||
191 | 41 | void Show (); | 41 | void Show (); |
192 | 42 | void Hide (); | 42 | void Hide (); |
193 | 43 | void ToggleShowHide (); | 43 | void ToggleShowHide (); |
194 | 44 | static void SetLauncherSize (int launcher_size); | ||
195 | 44 | 45 | ||
196 | 45 | protected: | 46 | protected: |
197 | 46 | const gchar* GetName (); | 47 | const gchar* GetName (); |
198 | @@ -65,6 +66,7 @@ | |||
199 | 65 | PlaceFactoryFile *_factory; | 66 | PlaceFactoryFile *_factory; |
200 | 66 | bool _visible; | 67 | bool _visible; |
201 | 67 | bool _fullscren_request; | 68 | bool _fullscren_request; |
202 | 69 | static int _launcher_size; | ||
203 | 68 | }; | 70 | }; |
204 | 69 | 71 | ||
205 | 70 | #endif // PLACES_CONTROLLER_H | 72 | #endif // PLACES_CONTROLLER_H |
206 | 71 | 73 | ||
207 | === modified file 'src/unityshell.cpp' | |||
208 | --- src/unityshell.cpp 2011-03-01 09:41:36 +0000 | |||
209 | +++ src/unityshell.cpp 2011-03-04 15:16:33 +0000 | |||
210 | @@ -551,6 +551,13 @@ | |||
211 | 551 | break; | 551 | break; |
212 | 552 | case UnityshellOptions::PanelOpacity: | 552 | case UnityshellOptions::PanelOpacity: |
213 | 553 | panelView->SetOpacity (optionGetPanelOpacity ()); | 553 | panelView->SetOpacity (optionGetPanelOpacity ()); |
214 | 554 | break; | ||
215 | 555 | case UnityshellOptions::IconSize: | ||
216 | 556 | panelHomeButton->SetButtonWidth (optionGetIconSize()+18); | ||
217 | 557 | launcher->SetIconSize (optionGetIconSize()+6, optionGetIconSize()); | ||
218 | 558 | PlacesController::SetLauncherSize (optionGetIconSize()+18); | ||
219 | 559 | |||
220 | 560 | break; | ||
221 | 554 | case UnityshellOptions::AutohideAnimation: | 561 | case UnityshellOptions::AutohideAnimation: |
222 | 555 | launcher->SetAutoHideAnimation ((Launcher::AutoHideAnimation) optionGetAutohideAnimation ()); | 562 | launcher->SetAutoHideAnimation ((Launcher::AutoHideAnimation) optionGetAutohideAnimation ()); |
223 | 556 | break; | 563 | break; |
224 | @@ -733,6 +740,7 @@ | |||
225 | 733 | optionSetLaunchAnimationNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2)); | 740 | optionSetLaunchAnimationNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2)); |
226 | 734 | optionSetUrgentAnimationNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2)); | 741 | optionSetUrgentAnimationNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2)); |
227 | 735 | optionSetPanelOpacityNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2)); | 742 | optionSetPanelOpacityNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2)); |
228 | 743 | optionSetIconSizeNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2)); | ||
229 | 736 | optionSetAutohideAnimationNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2)); | 744 | optionSetAutohideAnimationNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2)); |
230 | 737 | optionSetShowLauncherInitiate (boost::bind (&UnityScreen::showLauncherKeyInitiate, this, _1, _2, _3)); | 745 | optionSetShowLauncherInitiate (boost::bind (&UnityScreen::showLauncherKeyInitiate, this, _1, _2, _3)); |
231 | 738 | optionSetShowLauncherTerminate (boost::bind (&UnityScreen::showLauncherKeyTerminate, this, _1, _2, _3)); | 746 | optionSetShowLauncherTerminate (boost::bind (&UnityScreen::showLauncherKeyTerminate, this, _1, _2, _3)); |
232 | @@ -837,6 +845,8 @@ | |||
233 | 837 | self->panelView = new PanelView (); | 845 | self->panelView = new PanelView (); |
234 | 838 | self->AddChild (self->panelView); | 846 | self->AddChild (self->panelView); |
235 | 839 | 847 | ||
236 | 848 | self->panelHomeButton = self->panelView->HomeButton (); | ||
237 | 849 | |||
238 | 840 | layout = new nux::HLayout(); | 850 | layout = new nux::HLayout(); |
239 | 841 | 851 | ||
240 | 842 | self->panelView->SetMaximumHeight(24); | 852 | self->panelView->SetMaximumHeight(24); |
241 | 843 | 853 | ||
242 | === modified file 'src/unityshell.h' | |||
243 | --- src/unityshell.h 2011-02-28 16:32:12 +0000 | |||
244 | +++ src/unityshell.h 2011-03-04 15:16:33 +0000 | |||
245 | @@ -34,6 +34,7 @@ | |||
246 | 34 | #include "Launcher.h" | 34 | #include "Launcher.h" |
247 | 35 | #include "LauncherController.h" | 35 | #include "LauncherController.h" |
248 | 36 | #include "PanelView.h" | 36 | #include "PanelView.h" |
249 | 37 | #include "PanelHomeButton.h" | ||
250 | 37 | #include "PlacesController.h" | 38 | #include "PlacesController.h" |
251 | 38 | #include "DebugDBusInterface.h" | 39 | #include "DebugDBusInterface.h" |
252 | 39 | #include <Nux/WindowThread.h> | 40 | #include <Nux/WindowThread.h> |
253 | @@ -191,6 +192,7 @@ | |||
254 | 191 | Launcher *launcher; | 192 | Launcher *launcher; |
255 | 192 | LauncherController *controller; | 193 | LauncherController *controller; |
256 | 193 | PanelView *panelView; | 194 | PanelView *panelView; |
257 | 195 | PanelHomeButton *panelHomeButton; | ||
258 | 194 | PlacesController *placesController; | 196 | PlacesController *placesController; |
259 | 195 | nux::WindowThread *wt; | 197 | nux::WindowThread *wt; |
260 | 196 | nux::BaseWindow *launcherWindow; | 198 | nux::BaseWindow *launcherWindow; |
261 | 197 | 199 | ||
262 | === modified file 'unityshell.xml.in' | |||
263 | --- unityshell.xml.in 2011-02-23 08:10:51 +0000 | |||
264 | +++ unityshell.xml.in 2011-03-04 15:16:33 +0000 | |||
265 | @@ -144,6 +144,14 @@ | |||
266 | 144 | <max>1.0</max> | 144 | <max>1.0</max> |
267 | 145 | <precision>0.01</precision> | 145 | <precision>0.01</precision> |
268 | 146 | </option> | 146 | </option> |
269 | 147 | <option name="icon_size" type="int"> | ||
270 | 148 | <_short>Launcher icon size</_short> | ||
271 | 149 | <_long>The size of the launcher icons</_long> | ||
272 | 150 | <default>48</default> | ||
273 | 151 | <min>32</min> | ||
274 | 152 | <max>64</max> | ||
275 | 153 | <precision>1</precision> | ||
276 | 154 | </option> | ||
277 | 147 | <option name="autohide_animation" type="int"> | 155 | <option name="autohide_animation" type="int"> |
278 | 148 | <_short>Hide Animation</_short> | 156 | <_short>Hide Animation</_short> |
279 | 149 | <_long>Animation played when the launcher is showing or hiding</_long> | 157 | <_long>Animation played when the launcher is showing or hiding</_long> |