Merge lp:~cimi/unity/unity.fix-836655_and_fix-838875 into lp:unity
- unity.fix-836655_and_fix-838875
- Merge into trunk
Proposed by
Andrea Cimitan
Status: | Merged |
---|---|
Approved by: | Neil J. Patel |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1482 |
Proposed branch: | lp:~cimi/unity/unity.fix-836655_and_fix-838875 |
Merge into: | lp:unity |
Diff against target: |
313 lines (+177/-17) 3 files modified
plugins/unityshell/src/PanelMenuView.cpp (+6/-2) plugins/unityshell/src/WindowButtons.cpp (+171/-14) plugins/unityshell/src/WindowButtons.h (+0/-1) |
To merge this branch: | bzr merge lp:~cimi/unity/unity.fix-836655_and_fix-838875 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Neil J. Patel | Pending | ||
Review via email: mp+73699@code.launchpad.net |
Commit message
Description of the change
Update assets and new behavior
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 | === added file 'plugins/unityshell/resources/close_dash.png' | |||
2 | 0 | Binary files plugins/unityshell/resources/close_dash.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/close_dash.png 2011-09-01 17:04:25 +0000 differ | 0 | Binary files plugins/unityshell/resources/close_dash.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/close_dash.png 2011-09-01 17:04:25 +0000 differ |
3 | === added file 'plugins/unityshell/resources/close_dash_prelight.png' | |||
4 | 1 | Binary files plugins/unityshell/resources/close_dash_prelight.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/close_dash_prelight.png 2011-09-01 17:04:25 +0000 differ | 1 | Binary files plugins/unityshell/resources/close_dash_prelight.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/close_dash_prelight.png 2011-09-01 17:04:25 +0000 differ |
5 | === added file 'plugins/unityshell/resources/close_dash_pressed.png' | |||
6 | 2 | Binary files plugins/unityshell/resources/close_dash_pressed.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/close_dash_pressed.png 2011-09-01 17:04:25 +0000 differ | 2 | Binary files plugins/unityshell/resources/close_dash_pressed.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/close_dash_pressed.png 2011-09-01 17:04:25 +0000 differ |
7 | === added file 'plugins/unityshell/resources/maximize_dash.png' | |||
8 | 3 | Binary files plugins/unityshell/resources/maximize_dash.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/maximize_dash.png 2011-09-01 17:04:25 +0000 differ | 3 | Binary files plugins/unityshell/resources/maximize_dash.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/maximize_dash.png 2011-09-01 17:04:25 +0000 differ |
9 | === added file 'plugins/unityshell/resources/maximize_dash_prelight.png' | |||
10 | 4 | Binary files plugins/unityshell/resources/maximize_dash_prelight.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/maximize_dash_prelight.png 2011-09-01 17:04:25 +0000 differ | 4 | Binary files plugins/unityshell/resources/maximize_dash_prelight.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/maximize_dash_prelight.png 2011-09-01 17:04:25 +0000 differ |
11 | === added file 'plugins/unityshell/resources/maximize_dash_pressed.png' | |||
12 | 5 | Binary files plugins/unityshell/resources/maximize_dash_pressed.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/maximize_dash_pressed.png 2011-09-01 17:04:25 +0000 differ | 5 | Binary files plugins/unityshell/resources/maximize_dash_pressed.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/maximize_dash_pressed.png 2011-09-01 17:04:25 +0000 differ |
13 | === added file 'plugins/unityshell/resources/minimize_dash.png' | |||
14 | 6 | Binary files plugins/unityshell/resources/minimize_dash.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/minimize_dash.png 2011-09-01 17:04:25 +0000 differ | 6 | Binary files plugins/unityshell/resources/minimize_dash.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/minimize_dash.png 2011-09-01 17:04:25 +0000 differ |
15 | === added file 'plugins/unityshell/resources/minimize_dash_prelight.png' | |||
16 | 7 | Binary files plugins/unityshell/resources/minimize_dash_prelight.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/minimize_dash_prelight.png 2011-09-01 17:04:25 +0000 differ | 7 | Binary files plugins/unityshell/resources/minimize_dash_prelight.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/minimize_dash_prelight.png 2011-09-01 17:04:25 +0000 differ |
17 | === added file 'plugins/unityshell/resources/minimize_dash_pressed.png' | |||
18 | 8 | Binary files plugins/unityshell/resources/minimize_dash_pressed.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/minimize_dash_pressed.png 2011-09-01 17:04:25 +0000 differ | 8 | Binary files plugins/unityshell/resources/minimize_dash_pressed.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/minimize_dash_pressed.png 2011-09-01 17:04:25 +0000 differ |
19 | === added file 'plugins/unityshell/resources/unmaximize_dash.png' | |||
20 | 9 | Binary files plugins/unityshell/resources/unmaximize_dash.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/unmaximize_dash.png 2011-09-01 17:04:25 +0000 differ | 9 | Binary files plugins/unityshell/resources/unmaximize_dash.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/unmaximize_dash.png 2011-09-01 17:04:25 +0000 differ |
21 | === added file 'plugins/unityshell/resources/unmaximize_dash_prelight.png' | |||
22 | 10 | Binary files plugins/unityshell/resources/unmaximize_dash_prelight.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/unmaximize_dash_prelight.png 2011-09-01 17:04:25 +0000 differ | 10 | Binary files plugins/unityshell/resources/unmaximize_dash_prelight.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/unmaximize_dash_prelight.png 2011-09-01 17:04:25 +0000 differ |
23 | === added file 'plugins/unityshell/resources/unmaximize_dash_pressed.png' | |||
24 | 11 | Binary files plugins/unityshell/resources/unmaximize_dash_pressed.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/unmaximize_dash_pressed.png 2011-09-01 17:04:25 +0000 differ | 11 | Binary files plugins/unityshell/resources/unmaximize_dash_pressed.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/unmaximize_dash_pressed.png 2011-09-01 17:04:25 +0000 differ |
25 | === modified file 'plugins/unityshell/src/PanelMenuView.cpp' | |||
26 | --- plugins/unityshell/src/PanelMenuView.cpp 2011-08-25 18:25:25 +0000 | |||
27 | +++ plugins/unityshell/src/PanelMenuView.cpp 2011-09-01 17:04:25 +0000 | |||
28 | @@ -969,7 +969,8 @@ | |||
29 | 969 | { | 969 | { |
30 | 970 | if (_places_showing) | 970 | if (_places_showing) |
31 | 971 | { | 971 | { |
33 | 972 | DashSettings::GetDefault()->SetFormFactor(DashSettings::DESKTOP); | 972 | // no action when dash is opened, LP bug #838875 |
34 | 973 | return; | ||
35 | 973 | } | 974 | } |
36 | 974 | else | 975 | else |
37 | 975 | { | 976 | { |
38 | @@ -986,7 +987,10 @@ | |||
39 | 986 | { | 987 | { |
40 | 987 | if (_places_showing) | 988 | if (_places_showing) |
41 | 988 | { | 989 | { |
43 | 989 | DashSettings::GetDefault()->SetFormFactor(DashSettings::NETBOOK); | 990 | if (DashSettings::GetDefault()->GetFormFactor() == DashSettings::DESKTOP) |
44 | 991 | DashSettings::GetDefault()->SetFormFactor(DashSettings::NETBOOK); | ||
45 | 992 | else | ||
46 | 993 | DashSettings::GetDefault()->SetFormFactor(DashSettings::DESKTOP); | ||
47 | 990 | } | 994 | } |
48 | 991 | else | 995 | else |
49 | 992 | { | 996 | { |
50 | 993 | 997 | ||
51 | === modified file 'plugins/unityshell/src/WindowButtons.cpp' | |||
52 | --- plugins/unityshell/src/WindowButtons.cpp 2011-08-19 15:17:30 +0000 | |||
53 | +++ plugins/unityshell/src/WindowButtons.cpp 2011-09-01 17:04:25 +0000 | |||
54 | @@ -16,6 +16,8 @@ | |||
55 | 16 | * Authored by: Neil Jagdish Patel <neil.patel@canonical.com> | 16 | * Authored by: Neil Jagdish Patel <neil.patel@canonical.com> |
56 | 17 | */ | 17 | */ |
57 | 18 | 18 | ||
58 | 19 | #include "config.h" | ||
59 | 20 | |||
60 | 19 | #include "Nux/Nux.h" | 21 | #include "Nux/Nux.h" |
61 | 20 | #include "Nux/HLayout.h" | 22 | #include "Nux/HLayout.h" |
62 | 21 | #include "Nux/VLayout.h" | 23 | #include "Nux/VLayout.h" |
63 | @@ -28,9 +30,16 @@ | |||
64 | 28 | #include <UnityCore/Variant.h> | 30 | #include <UnityCore/Variant.h> |
65 | 29 | #include "WindowButtons.h" | 31 | #include "WindowButtons.h" |
66 | 30 | 32 | ||
68 | 31 | #include <glib.h> | 33 | #include "ubus-server.h" |
69 | 34 | #include "UBusMessages.h" | ||
70 | 32 | 35 | ||
71 | 36 | #include "DashSettings.h" | ||
72 | 33 | #include "PanelStyle.h" | 37 | #include "PanelStyle.h" |
73 | 38 | |||
74 | 39 | #include <UnityCore/GLibWrapper.h> | ||
75 | 40 | |||
76 | 41 | using namespace unity; | ||
77 | 42 | |||
78 | 34 | class WindowButton : public nux::Button | 43 | class WindowButton : public nux::Button |
79 | 35 | { | 44 | { |
80 | 36 | // A single window button | 45 | // A single window button |
81 | @@ -40,10 +49,25 @@ | |||
82 | 40 | _type(type), | 49 | _type(type), |
83 | 41 | _normal_tex(NULL), | 50 | _normal_tex(NULL), |
84 | 42 | _prelight_tex(NULL), | 51 | _prelight_tex(NULL), |
86 | 43 | _pressed_tex(NULL) | 52 | _pressed_tex(NULL), |
87 | 53 | _normal_dash_tex(NULL), | ||
88 | 54 | _prelight_dash_tex(NULL), | ||
89 | 55 | _pressed_dash_tex(NULL), | ||
90 | 56 | _dash_is_open(false), | ||
91 | 57 | _place_shown_interest(0), | ||
92 | 58 | _place_hidden_interest(0) | ||
93 | 44 | { | 59 | { |
94 | 45 | LoadImages(); | 60 | LoadImages(); |
95 | 46 | PanelStyle::GetDefault()->changed.connect(sigc::mem_fun(this, &WindowButton::LoadImages)); | 61 | PanelStyle::GetDefault()->changed.connect(sigc::mem_fun(this, &WindowButton::LoadImages)); |
96 | 62 | DashSettings::GetDefault()->changed.connect(sigc::mem_fun(this, &WindowButton::UpdateDashUnmaximize)); | ||
97 | 63 | |||
98 | 64 | UBusServer* ubus = ubus_server_get_default(); | ||
99 | 65 | _place_shown_interest = ubus_server_register_interest(ubus, UBUS_PLACE_VIEW_SHOWN, | ||
100 | 66 | (UBusCallback)&WindowButton::OnPlaceViewShown, | ||
101 | 67 | this); | ||
102 | 68 | _place_hidden_interest = ubus_server_register_interest(ubus, UBUS_PLACE_VIEW_HIDDEN, | ||
103 | 69 | (UBusCallback)&WindowButton::OnPlaceViewHidden, | ||
104 | 70 | this); | ||
105 | 47 | } | 71 | } |
106 | 48 | 72 | ||
107 | 49 | ~WindowButton() | 73 | ~WindowButton() |
108 | @@ -51,27 +75,42 @@ | |||
109 | 51 | _normal_tex->UnReference(); | 75 | _normal_tex->UnReference(); |
110 | 52 | _prelight_tex->UnReference(); | 76 | _prelight_tex->UnReference(); |
111 | 53 | _pressed_tex->UnReference(); | 77 | _pressed_tex->UnReference(); |
112 | 78 | _normal_dash_tex->UnReference(); | ||
113 | 79 | _prelight_dash_tex->UnReference(); | ||
114 | 80 | _pressed_dash_tex->UnReference(); | ||
115 | 81 | |||
116 | 82 | UBusServer* ubus = ubus_server_get_default(); | ||
117 | 83 | if (_place_shown_interest != 0) | ||
118 | 84 | ubus_server_unregister_interest(ubus, _place_shown_interest); | ||
119 | 85 | if (_place_hidden_interest != 0) | ||
120 | 86 | ubus_server_unregister_interest(ubus, _place_hidden_interest); | ||
121 | 54 | } | 87 | } |
122 | 55 | 88 | ||
123 | 56 | void Draw(nux::GraphicsEngine& GfxContext, bool force_draw) | 89 | void Draw(nux::GraphicsEngine& GfxContext, bool force_draw) |
124 | 57 | { | 90 | { |
126 | 58 | nux::Geometry geo = GetGeometry(); | 91 | nux::Geometry geo = GetGeometry(); |
127 | 59 | nux::BaseTexture* tex; | 92 | nux::BaseTexture* tex; |
128 | 60 | nux::TexCoordXForm texxform; | 93 | nux::TexCoordXForm texxform; |
129 | 61 | 94 | ||
130 | 62 | GfxContext.PushClippingRectangle(geo); | 95 | GfxContext.PushClippingRectangle(geo); |
131 | 63 | 96 | ||
139 | 64 | if (HasMouseFocus() && IsMouseInside()) | 97 | if (_dash_is_open) |
140 | 65 | { | 98 | { |
141 | 66 | tex = _pressed_tex; | 99 | if (HasMouseFocus() && IsMouseInside()) |
142 | 67 | } | 100 | tex = _pressed_dash_tex; |
143 | 68 | else if (IsMouseInside()) | 101 | else if (IsMouseInside()) |
144 | 69 | { | 102 | tex = _prelight_dash_tex; |
145 | 70 | tex = _prelight_tex; | 103 | else |
146 | 104 | tex = _normal_dash_tex; | ||
147 | 71 | } | 105 | } |
148 | 72 | else | 106 | else |
149 | 73 | { | 107 | { |
151 | 74 | tex = _normal_tex; | 108 | if (HasMouseFocus() && IsMouseInside()) |
152 | 109 | tex = _pressed_tex; | ||
153 | 110 | else if (IsMouseInside()) | ||
154 | 111 | tex = _prelight_tex; | ||
155 | 112 | else | ||
156 | 113 | tex = _normal_tex; | ||
157 | 75 | } | 114 | } |
158 | 76 | 115 | ||
159 | 77 | GfxContext.GetRenderStates().SetBlend(true); | 116 | GfxContext.GetRenderStates().SetBlend(true); |
160 | @@ -99,13 +138,70 @@ | |||
161 | 99 | _prelight_tex->UnReference(); | 138 | _prelight_tex->UnReference(); |
162 | 100 | if (_pressed_tex) | 139 | if (_pressed_tex) |
163 | 101 | _pressed_tex->UnReference(); | 140 | _pressed_tex->UnReference(); |
164 | 141 | if (_normal_dash_tex) | ||
165 | 142 | _normal_dash_tex->UnReference(); | ||
166 | 143 | if (_prelight_dash_tex) | ||
167 | 144 | _prelight_dash_tex->UnReference(); | ||
168 | 145 | if (_pressed_dash_tex) | ||
169 | 146 | _pressed_dash_tex->UnReference(); | ||
170 | 102 | 147 | ||
171 | 103 | _normal_tex = style->GetWindowButton(_type, PanelStyle::WINDOW_STATE_NORMAL); | 148 | _normal_tex = style->GetWindowButton(_type, PanelStyle::WINDOW_STATE_NORMAL); |
172 | 104 | _prelight_tex = style->GetWindowButton(_type, PanelStyle::WINDOW_STATE_PRELIGHT); | 149 | _prelight_tex = style->GetWindowButton(_type, PanelStyle::WINDOW_STATE_PRELIGHT); |
173 | 105 | _pressed_tex = style->GetWindowButton(_type, PanelStyle::WINDOW_STATE_PRESSED); | 150 | _pressed_tex = style->GetWindowButton(_type, PanelStyle::WINDOW_STATE_PRESSED); |
177 | 106 | 151 | _normal_dash_tex = GetDashWindowButton(_type, PanelStyle::WINDOW_STATE_NORMAL); | |
178 | 107 | if (_normal_tex) | 152 | _prelight_dash_tex = GetDashWindowButton(_type, PanelStyle::WINDOW_STATE_PRELIGHT); |
179 | 108 | SetMinMaxSize(_normal_tex->GetWidth(), _normal_tex->GetHeight()); | 153 | _pressed_dash_tex = GetDashWindowButton(_type, PanelStyle::WINDOW_STATE_PRESSED); |
180 | 154 | |||
181 | 155 | if (_dash_is_open) | ||
182 | 156 | { | ||
183 | 157 | if (_normal_dash_tex) | ||
184 | 158 | SetMinMaxSize(_normal_dash_tex->GetWidth(), _normal_dash_tex->GetHeight()); | ||
185 | 159 | } | ||
186 | 160 | else | ||
187 | 161 | { | ||
188 | 162 | if (_normal_tex) | ||
189 | 163 | SetMinMaxSize(_normal_tex->GetWidth(), _normal_tex->GetHeight()); | ||
190 | 164 | } | ||
191 | 165 | |||
192 | 166 | QueueDraw(); | ||
193 | 167 | } | ||
194 | 168 | |||
195 | 169 | void UpdateDashUnmaximize() | ||
196 | 170 | { | ||
197 | 171 | // only update the unmaximize button | ||
198 | 172 | if (_type != PanelStyle::WINDOW_BUTTON_UNMAXIMIZE) | ||
199 | 173 | return; | ||
200 | 174 | |||
201 | 175 | if (_normal_dash_tex) | ||
202 | 176 | _normal_dash_tex->UnReference(); | ||
203 | 177 | if (_prelight_dash_tex) | ||
204 | 178 | _prelight_dash_tex->UnReference(); | ||
205 | 179 | if (_pressed_dash_tex) | ||
206 | 180 | _pressed_dash_tex->UnReference(); | ||
207 | 181 | |||
208 | 182 | if (DashSettings::GetDefault()->GetFormFactor() == DashSettings::DESKTOP) | ||
209 | 183 | { | ||
210 | 184 | // get maximize buttons | ||
211 | 185 | _normal_dash_tex = GetDashMaximizeWindowButton(PanelStyle::WINDOW_STATE_NORMAL); | ||
212 | 186 | _prelight_dash_tex = GetDashMaximizeWindowButton(PanelStyle::WINDOW_STATE_PRELIGHT); | ||
213 | 187 | _pressed_dash_tex = GetDashMaximizeWindowButton(PanelStyle::WINDOW_STATE_PRESSED); | ||
214 | 188 | } | ||
215 | 189 | else | ||
216 | 190 | { | ||
217 | 191 | // get unmaximize buttons | ||
218 | 192 | _normal_dash_tex = GetDashWindowButton(_type, PanelStyle::WINDOW_STATE_NORMAL); | ||
219 | 193 | _prelight_dash_tex = GetDashWindowButton(_type, PanelStyle::WINDOW_STATE_PRELIGHT); | ||
220 | 194 | _pressed_dash_tex = GetDashWindowButton(_type, PanelStyle::WINDOW_STATE_PRESSED); | ||
221 | 195 | } | ||
222 | 196 | |||
223 | 197 | // still check if the dash is really opened, | ||
224 | 198 | // someone could change the form factor through dconf | ||
225 | 199 | // when the dash is closed | ||
226 | 200 | if (_dash_is_open) | ||
227 | 201 | { | ||
228 | 202 | if (_normal_dash_tex) | ||
229 | 203 | SetMinMaxSize(_normal_dash_tex->GetWidth(), _normal_dash_tex->GetHeight()); | ||
230 | 204 | } | ||
231 | 109 | 205 | ||
232 | 110 | QueueDraw(); | 206 | QueueDraw(); |
233 | 111 | } | 207 | } |
234 | @@ -115,6 +211,67 @@ | |||
235 | 115 | nux::BaseTexture* _normal_tex; | 211 | nux::BaseTexture* _normal_tex; |
236 | 116 | nux::BaseTexture* _prelight_tex; | 212 | nux::BaseTexture* _prelight_tex; |
237 | 117 | nux::BaseTexture* _pressed_tex; | 213 | nux::BaseTexture* _pressed_tex; |
238 | 214 | nux::BaseTexture* _normal_dash_tex; | ||
239 | 215 | nux::BaseTexture* _prelight_dash_tex; | ||
240 | 216 | nux::BaseTexture* _pressed_dash_tex; | ||
241 | 217 | bool _dash_is_open; | ||
242 | 218 | guint32 _place_shown_interest; | ||
243 | 219 | guint32 _place_hidden_interest; | ||
244 | 220 | |||
245 | 221 | static void OnPlaceViewShown(GVariant* data, void* val) | ||
246 | 222 | { | ||
247 | 223 | WindowButton* self = (WindowButton*)val; | ||
248 | 224 | |||
249 | 225 | self->_dash_is_open = true; | ||
250 | 226 | if (self->_normal_dash_tex) | ||
251 | 227 | self->SetMinMaxSize(self->_normal_dash_tex->GetWidth(), self->_normal_dash_tex->GetHeight()); | ||
252 | 228 | |||
253 | 229 | self->QueueDraw(); | ||
254 | 230 | } | ||
255 | 231 | |||
256 | 232 | static void OnPlaceViewHidden(GVariant* data, void* val) | ||
257 | 233 | { | ||
258 | 234 | WindowButton* self = (WindowButton*)val; | ||
259 | 235 | |||
260 | 236 | self->_dash_is_open = false; | ||
261 | 237 | if (self->_normal_tex) | ||
262 | 238 | self->SetMinMaxSize(self->_normal_tex->GetWidth(), self->_normal_tex->GetHeight()); | ||
263 | 239 | |||
264 | 240 | self->QueueDraw(); | ||
265 | 241 | } | ||
266 | 242 | |||
267 | 243 | nux::BaseTexture* GetDashWindowButton(PanelStyle::WindowButtonType type, PanelStyle::WindowState state) | ||
268 | 244 | { | ||
269 | 245 | const char* names[] = { "close_dash", "minimize_dash", "unmaximize_dash" }; | ||
270 | 246 | const char* states[] = { "", "_prelight", "_pressed" }; | ||
271 | 247 | |||
272 | 248 | std::ostringstream subpath; | ||
273 | 249 | subpath << names[type] << states[state] << ".png"; | ||
274 | 250 | |||
275 | 251 | glib::String filename(g_build_filename(PKGDATADIR, subpath.str().c_str(), NULL)); | ||
276 | 252 | |||
277 | 253 | glib::Error error; | ||
278 | 254 | glib::Object<GdkPixbuf> pixbuf(gdk_pixbuf_new_from_file(filename.Value(), &error)); | ||
279 | 255 | |||
280 | 256 | // not handling broken texture or missing files | ||
281 | 257 | return nux::CreateTexture2DFromPixbuf(pixbuf, true); | ||
282 | 258 | } | ||
283 | 259 | |||
284 | 260 | nux::BaseTexture* GetDashMaximizeWindowButton(PanelStyle::WindowState state) | ||
285 | 261 | { | ||
286 | 262 | const char* states[] = { "", "_prelight", "_pressed" }; | ||
287 | 263 | |||
288 | 264 | std::ostringstream subpath; | ||
289 | 265 | subpath << "maximize_dash" << states[state] << ".png"; | ||
290 | 266 | |||
291 | 267 | glib::String filename(g_build_filename(PKGDATADIR, subpath.str().c_str(), NULL)); | ||
292 | 268 | |||
293 | 269 | glib::Error error; | ||
294 | 270 | glib::Object<GdkPixbuf> pixbuf(gdk_pixbuf_new_from_file(filename.Value(), &error)); | ||
295 | 271 | |||
296 | 272 | // not handling broken texture or missing files | ||
297 | 273 | return nux::CreateTexture2DFromPixbuf(pixbuf, true); | ||
298 | 274 | } | ||
299 | 118 | }; | 275 | }; |
300 | 119 | 276 | ||
301 | 120 | 277 | ||
302 | 121 | 278 | ||
303 | === modified file 'plugins/unityshell/src/WindowButtons.h' | |||
304 | --- plugins/unityshell/src/WindowButtons.h 2011-08-10 18:42:00 +0000 | |||
305 | +++ plugins/unityshell/src/WindowButtons.h 2011-09-01 17:04:25 +0000 | |||
306 | @@ -44,7 +44,6 @@ | |||
307 | 44 | const gchar* GetChildsName(); | 44 | const gchar* GetChildsName(); |
308 | 45 | void AddProperties(GVariantBuilder* builder); | 45 | void AddProperties(GVariantBuilder* builder); |
309 | 46 | 46 | ||
310 | 47 | |||
311 | 48 | private: | 47 | private: |
312 | 49 | void OnCloseClicked(nux::View *view); | 48 | void OnCloseClicked(nux::View *view); |
313 | 50 | void OnMinimizeClicked(nux::View *view); | 49 | void OnMinimizeClicked(nux::View *view); |