Merge lp:~azzar1/unity/fix-713087 into lp:unity

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
Reviewer Review Type Date Requested Status
Gord Allott Pending
Review via email: mp+52206@code.launchpad.net
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 _icon_size = tile_size;
6 _icon_image_size = icon_size;
7 _icon_image_size_delta = tile_size - icon_size;
8+ _icon_glow_size = icon_size + 14;
9
10 // recreate tile textures
11
12
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 #include "PanelStyle.h"
18
19 #define PANEL_HEIGHT 24
20-#define BUTTON_WIDTH 66
21
22 NUX_IMPLEMENT_OBJECT_TYPE (PanelHomeButton);
23
24 PanelHomeButton::PanelHomeButton ()
25-: TextureArea (NUX_TRACKER_LOCATION),
26- _util_cg (CAIRO_FORMAT_ARGB32, BUTTON_WIDTH, PANEL_HEIGHT)
27+: TextureArea (NUX_TRACKER_LOCATION)
28 {
29- SetMinMaxSize (BUTTON_WIDTH, PANEL_HEIGHT);
30+ _button_width = 66;
31+ SetMinMaxSize (_button_width, PANEL_HEIGHT);
32
33 OnMouseClick.connect (sigc::mem_fun (this, &PanelHomeButton::RecvMouseClick));
34
35@@ -63,17 +62,19 @@
36 void
37 PanelHomeButton::Refresh ()
38 {
39- int width = BUTTON_WIDTH;
40+ int width = _button_width;
41 int height = PANEL_HEIGHT;
42 GdkPixbuf *pixbuf;
43
44+ SetMinMaxSize (_button_width, PANEL_HEIGHT);
45+
46 nux::CairoGraphics cairo_graphics(CAIRO_FORMAT_ARGB32, width, height);
47 cairo_t *cr = cairo_graphics.GetContext();
48 cairo_set_line_width (cr, 1);
49
50 pixbuf = PanelStyle::GetDefault ()->GetHomeButton ();
51 gdk_cairo_set_source_pixbuf (cr, pixbuf,
52- (BUTTON_WIDTH-gdk_pixbuf_get_width (pixbuf))/2,
53+ (_button_width-gdk_pixbuf_get_width (pixbuf))/2,
54 (PANEL_HEIGHT-gdk_pixbuf_get_height (pixbuf))/2);
55 g_object_unref (pixbuf);
56
57@@ -144,7 +145,7 @@
58 g_variant_builder_init (&builder, G_VARIANT_TYPE ("(iiiia{sv})"));
59 g_variant_builder_add (&builder, "i", x);
60 g_variant_builder_add (&builder, "i", y);
61- g_variant_builder_add (&builder, "i", BUTTON_WIDTH);
62+ g_variant_builder_add (&builder, "i", _button_width);
63 g_variant_builder_add (&builder, "i", PANEL_HEIGHT);
64
65 g_variant_builder_open (&builder, G_VARIANT_TYPE ("a{sv}"));
66@@ -164,7 +165,7 @@
67 g_variant_builder_init (&builder, G_VARIANT_TYPE ("(iiiia{sv})"));
68 g_variant_builder_add (&builder, "i", x);
69 g_variant_builder_add (&builder, "i", y);
70- g_variant_builder_add (&builder, "i", BUTTON_WIDTH);
71+ g_variant_builder_add (&builder, "i", _button_width);
72 g_variant_builder_add (&builder, "i", PANEL_HEIGHT);
73
74 g_variant_builder_open (&builder, G_VARIANT_TYPE ("a{sv}"));
75@@ -184,7 +185,7 @@
76 g_variant_builder_init (&builder, G_VARIANT_TYPE ("(iiiia{sv})"));
77 g_variant_builder_add (&builder, "i", x);
78 g_variant_builder_add (&builder, "i", y);
79- g_variant_builder_add (&builder, "i", BUTTON_WIDTH);
80+ g_variant_builder_add (&builder, "i", _button_width);
81 g_variant_builder_add (&builder, "i", PANEL_HEIGHT);
82
83 g_variant_builder_open (&builder, G_VARIANT_TYPE ("a{sv}"));
84@@ -195,6 +196,17 @@
85 ubus_server_send_message (ubus, UBUS_HOME_BUTTON_TRIGGER_UPDATE, g_variant_builder_end (&builder));
86 }
87
88+void
89+PanelHomeButton::SetButtonWidth (int button_width)
90+{
91+ if (_button_width == button_width)
92+ return;
93+
94+ _button_width = button_width;
95+
96+ Refresh();
97+}
98+
99 const gchar*
100 PanelHomeButton::GetName ()
101 {
102
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
108 void RecvMouseMove(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags);
109
110+ void SetButtonWidth (int button_width);
111+
112 protected:
113 const gchar* GetName ();
114 void AddProperties (GVariantBuilder *builder);
115@@ -50,7 +52,7 @@
116 void Refresh ();
117
118 private:
119- nux::CairoGraphics _util_cg;
120+ int _button_width;
121 };
122
123 #endif // PANEL_HOME_BUTTON_H
124
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
130 #include "PlacesController.h"
131
132+int PlacesController::_launcher_size = 66;
133+
134 PlacesController::PlacesController ()
135 : _visible (false),
136 _fullscren_request (false)
137@@ -156,7 +158,7 @@
138 }
139 else
140 {
141- width = rect.width - 66;
142+ width = rect.width - _launcher_size;
143 height = rect.height - 24;
144
145 _view->SetSizeMode (PlacesView::SIZE_MODE_FULLSCREEN);
146@@ -173,7 +175,7 @@
147 {
148 int width = 0, height = 0;
149 static_cast<PlacesController *> (user_data)->GetWindowSize (&width, &height);
150- geo = nux::Geometry (66, 24, width, height);
151+ geo = nux::Geometry (_launcher_size, 24, width, height);
152 }
153
154 void
155@@ -182,7 +184,7 @@
156 int width = 0, height = 0;
157 _fullscren_request = true;
158 GetWindowSize (&width, &height);
159- _window->SetGeometry (nux::Geometry (66, 24, width, height));
160+ _window->SetGeometry (nux::Geometry (_launcher_size, 24, width, height));
161 }
162
163 void
164@@ -203,7 +205,7 @@
165 PlacesController::RecvMouseDownOutsideOfView (int x, int y, unsigned long button_flags, unsigned long key_flags)
166 {
167 //FIXME: We need a way to get the real position/size of the homebutton
168- nux::Geometry geo (0, 0, 66, 24);
169+ nux::Geometry geo (0, 0, _launcher_size, 24);
170 if (!geo.IsPointInside (x, y))
171 Hide ();
172 }
173@@ -214,6 +216,12 @@
174 entry ? Show () : Hide ();
175 }
176
177+void
178+PlacesController::SetLauncherSize (int launcher_size)
179+{
180+ _launcher_size = launcher_size;
181+}
182+
183
184 /* Introspection */
185 const gchar *
186
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 void Show ();
192 void Hide ();
193 void ToggleShowHide ();
194+ static void SetLauncherSize (int launcher_size);
195
196 protected:
197 const gchar* GetName ();
198@@ -65,6 +66,7 @@
199 PlaceFactoryFile *_factory;
200 bool _visible;
201 bool _fullscren_request;
202+ static int _launcher_size;
203 };
204
205 #endif // PLACES_CONTROLLER_H
206
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 break;
212 case UnityshellOptions::PanelOpacity:
213 panelView->SetOpacity (optionGetPanelOpacity ());
214+ break;
215+ case UnityshellOptions::IconSize:
216+ panelHomeButton->SetButtonWidth (optionGetIconSize()+18);
217+ launcher->SetIconSize (optionGetIconSize()+6, optionGetIconSize());
218+ PlacesController::SetLauncherSize (optionGetIconSize()+18);
219+
220+ break;
221 case UnityshellOptions::AutohideAnimation:
222 launcher->SetAutoHideAnimation ((Launcher::AutoHideAnimation) optionGetAutohideAnimation ());
223 break;
224@@ -733,6 +740,7 @@
225 optionSetLaunchAnimationNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
226 optionSetUrgentAnimationNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
227 optionSetPanelOpacityNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
228+ optionSetIconSizeNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
229 optionSetAutohideAnimationNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
230 optionSetShowLauncherInitiate (boost::bind (&UnityScreen::showLauncherKeyInitiate, this, _1, _2, _3));
231 optionSetShowLauncherTerminate (boost::bind (&UnityScreen::showLauncherKeyTerminate, this, _1, _2, _3));
232@@ -837,6 +845,8 @@
233 self->panelView = new PanelView ();
234 self->AddChild (self->panelView);
235
236+ self->panelHomeButton = self->panelView->HomeButton ();
237+
238 layout = new nux::HLayout();
239
240 self->panelView->SetMaximumHeight(24);
241
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 #include "Launcher.h"
247 #include "LauncherController.h"
248 #include "PanelView.h"
249+#include "PanelHomeButton.h"
250 #include "PlacesController.h"
251 #include "DebugDBusInterface.h"
252 #include <Nux/WindowThread.h>
253@@ -191,6 +192,7 @@
254 Launcher *launcher;
255 LauncherController *controller;
256 PanelView *panelView;
257+ PanelHomeButton *panelHomeButton;
258 PlacesController *placesController;
259 nux::WindowThread *wt;
260 nux::BaseWindow *launcherWindow;
261
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 <max>1.0</max>
267 <precision>0.01</precision>
268 </option>
269+ <option name="icon_size" type="int">
270+ <_short>Launcher icon size</_short>
271+ <_long>The size of the launcher icons</_long>
272+ <default>48</default>
273+ <min>32</min>
274+ <max>64</max>
275+ <precision>1</precision>
276+ </option>
277 <option name="autohide_animation" type="int">
278 <_short>Hide Animation</_short>
279 <_long>Animation played when the launcher is showing or hiding</_long>