Status: | Merged |
---|---|
Approved by: | Omer Akram |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2692 |
Proposed branch: | lp:~gordallott/unity/newbg |
Merge into: | lp:unity |
Diff against target: |
1047 lines (+462/-82) 17 files modified
dash/FilterBar.cpp (+0/-22) dash/FilterBar.h (+0/-1) dash/LensView.cpp (+30/-2) dash/LensView.h (+1/-0) dash/PlacesGroup.cpp (+85/-22) dash/PlacesGroup.h (+5/-3) panel/PanelController.cpp (+14/-0) panel/PanelController.h (+2/-0) panel/PanelView.cpp (+146/-2) panel/PanelView.h (+11/-0) panel/StandalonePanel.cpp (+8/-6) plugins/unityshell/src/unityshell.cpp (+1/-0) unity-shared/DashStyle.cpp (+37/-0) unity-shared/DashStyle.h (+8/-1) unity-shared/OverlayRenderer.cpp (+108/-22) unity-shared/UBusMessages.h (+3/-0) unity-standalone/StandaloneUnity.cpp (+3/-1) |
To merge this branch: | bzr merge lp:~gordallott/unity/newbg |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Omer Akram (community) | Approve | ||
Andrea Azzarone (community) | Approve | ||
John Lea (community) | design | Approve | |
Gord Allott | Pending | ||
Review via email: mp+124241@code.launchpad.net |
This proposal supersedes a proposal from 2012-09-13.
Commit message
Adds a new background gradient to the dash and panel, as well as removes some separator lines
Description of the change
Adds a new background gradient to the dash and panel, as well as removes some separator lines
Design request, visual changes, no tests
Andrea Azzarone (azzar1) wrote : | # |
+ group->
Use GetBaseWidth. Plase remove magic number too :)
+ scroll_
Use GetBaseGeometry
+ SetMinimumWidth
Remove this magic number too.
+ else if (g_strcmp0(
Maybe I'm wrong, but are you sure that you don't need to check that g_strcmp(...) is == 0?
nux::TexCoordXForm texxform;
226 + if (_n_visible_
227 + {
Move 6 in a variable or something like that. Also rename _n_visible_
228 + _background_
229 + texxform,
230 + nux::color::White,
231 + false,
232 + rop));
Also fix the indentation.
+ bg_geo.width = std::min(bg_width, bg_geo.GetWidth()) + 10;
Remove magic number.
+ //_queued_draw = false;
Remove this line if we no longer need it.
+ for (auto window: windows_)
I think you can use auto const& window : windows_ here.
Omer Akram (om26er) wrote : | # |
Unity is crashing for me with this branch: http://
Gord Allott (gordallott) wrote : | # |
> Move 6 in a variable or something like that. Also rename
> _n_visible_
> new style for the private members (variable_).
the rest of the file doesn't follow that convention, the file style overrides the new style and i'm not going to change the entire thing in this mp
Gord Allott (gordallott) wrote : | # |
> Unity is crashing for me with this branch: http://
don't use fedoras pastebin, its a giant pain, has captchas just to view
it looks like you don't have refine_
John Lea (johnlea) : | # |
Andrea Azzarone (azzar1) wrote : | # |
Some indentation issues and GetGeometry().width not fixed. Not blocking.
Unity Merger (unity-merger) wrote : | # |
There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.
Omer Akram (om26er) : | # |
Preview Diff
1 | === modified file 'dash/FilterBar.cpp' |
2 | --- dash/FilterBar.cpp 2012-05-06 23:48:38 +0000 |
3 | +++ dash/FilterBar.cpp 2012-09-14 12:02:19 +0000 |
4 | @@ -82,8 +82,6 @@ |
5 | AddChild(filter_view); |
6 | filter_map_[filter] = filter_view; |
7 | GetLayout()->AddView(filter_view, 0, nux::MINOR_POSITION_LEFT, nux::MINOR_SIZE_FULL); |
8 | - |
9 | - UpdateDrawSeparators(); |
10 | } |
11 | |
12 | void FilterBar::RemoveFilter(Filter::Ptr const& filter) |
13 | @@ -99,8 +97,6 @@ |
14 | break; |
15 | } |
16 | } |
17 | - |
18 | - UpdateDrawSeparators(); |
19 | } |
20 | |
21 | void FilterBar::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) |
22 | @@ -120,24 +116,6 @@ |
23 | GfxContext.PopClippingRectangle(); |
24 | } |
25 | |
26 | -void FilterBar::UpdateDrawSeparators() |
27 | -{ |
28 | - std::list<Area*> children = GetLayout()->GetChildren(); |
29 | - std::list<Area*>::reverse_iterator rit; |
30 | - bool found_one = false; |
31 | - |
32 | - for (rit = children.rbegin(); rit != children.rend(); ++rit) |
33 | - { |
34 | - FilterExpanderLabel* widget = dynamic_cast<FilterExpanderLabel*>(*rit); |
35 | - |
36 | - if (!widget) |
37 | - continue; |
38 | - |
39 | - widget->draw_separator = found_one; |
40 | - found_one = true; |
41 | - } |
42 | -} |
43 | - |
44 | // |
45 | // Key navigation |
46 | // |
47 | |
48 | === modified file 'dash/FilterBar.h' |
49 | --- dash/FilterBar.h 2012-05-06 23:48:38 +0000 |
50 | +++ dash/FilterBar.h 2012-09-14 12:02:19 +0000 |
51 | @@ -60,7 +60,6 @@ |
52 | |
53 | private: |
54 | void Init(); |
55 | - void UpdateDrawSeparators(); |
56 | |
57 | FilterFactory factory_; |
58 | Filters::Ptr filters_; |
59 | |
60 | === modified file 'dash/LensView.cpp' |
61 | --- dash/LensView.cpp 2012-09-14 10:52:01 +0000 |
62 | +++ dash/LensView.cpp 2012-09-14 12:02:19 +0000 |
63 | @@ -147,7 +147,14 @@ |
64 | lens_->connected.changed.connect([&](bool is_connected) { if (is_connected) initial_activation_ = true; }); |
65 | lens_->categories_reordered.connect(sigc::mem_fun(this, &LensView::OnCategoryOrderChanged)); |
66 | search_string.SetGetterFunction(sigc::mem_fun(this, &LensView::get_search_string)); |
67 | - filters_expanded.changed.connect([&](bool expanded) { fscroll_view_->SetVisible(expanded); QueueRelayout(); OnColumnsChanged(); }); |
68 | + filters_expanded.changed.connect([&](bool expanded) |
69 | + { |
70 | + fscroll_view_->SetVisible(expanded); |
71 | + QueueRelayout(); |
72 | + OnColumnsChanged(); |
73 | + ubus_manager_.SendMessage(UBUS_REFINE_STATUS, |
74 | + g_variant_new(UBUS_REFINE_STATUS_FORMAT_STRING, expanded ? TRUE : FALSE)); |
75 | + }); |
76 | view_type.changed.connect(sigc::mem_fun(this, &LensView::OnViewTypeChanged)); |
77 | |
78 | ubus_manager_.RegisterInterest(UBUS_RESULT_VIEW_KEYNAV_CHANGED, [&] (GVariant* data) { |
79 | @@ -189,10 +196,15 @@ |
80 | |
81 | scroll_view_ = new LensScrollView(new PlacesVScrollBar(NUX_TRACKER_LOCATION), |
82 | NUX_TRACKER_LOCATION); |
83 | - scroll_view_->EnableVerticalScrollBar(true); |
84 | + scroll_view_->EnableVerticalScrollBar(false); |
85 | scroll_view_->EnableHorizontalScrollBar(false); |
86 | layout_->AddView(scroll_view_); |
87 | |
88 | + scroll_view_->OnGeometryChanged.connect([this] (nux::Area *area, nux::Geometry& geo) |
89 | + { |
90 | + CheckScrollBarState(); |
91 | + }); |
92 | + |
93 | scroll_layout_ = new nux::VLayout(NUX_TRACKER_LOCATION); |
94 | scroll_view_->SetLayout(scroll_layout_); |
95 | scroll_view_->SetRightArea(show_filters); |
96 | @@ -388,6 +400,8 @@ |
97 | scroll_layout_->AddView(group, 0, nux::MinorDimensionPosition::eAbove, |
98 | nux::MinorDimensionSize::eFull, 100.0f, |
99 | (nux::LayoutPosition)index); |
100 | + |
101 | + group->SetMinimumWidth(GetGeometry().width); |
102 | } |
103 | |
104 | void LensView::OnCategoryOrderChanged() |
105 | @@ -624,6 +638,20 @@ |
106 | ResultViewGrid* grid = static_cast<ResultViewGrid*>(group->GetChildView()); |
107 | grid->expanded = group->GetExpanded(); |
108 | ubus_manager_.SendMessage(UBUS_PLACE_VIEW_QUEUE_DRAW); |
109 | + |
110 | + CheckScrollBarState(); |
111 | +} |
112 | + |
113 | +void LensView::CheckScrollBarState() |
114 | +{ |
115 | + if (scroll_layout_->GetGeometry().height > scroll_view_->GetGeometry().height) |
116 | + { |
117 | + scroll_view_->EnableVerticalScrollBar(true); |
118 | + } |
119 | + else |
120 | + { |
121 | + scroll_view_->EnableVerticalScrollBar(false); |
122 | + } |
123 | } |
124 | |
125 | void LensView::OnColumnsChanged() |
126 | |
127 | === modified file 'dash/LensView.h' |
128 | --- dash/LensView.h 2012-09-13 09:05:42 +0000 |
129 | +++ dash/LensView.h 2012-09-14 12:02:19 +0000 |
130 | @@ -88,6 +88,7 @@ |
131 | void OnResultRemoved(Result const& result); |
132 | void UpdateCounts(PlacesGroup* group); |
133 | void OnGroupExpanded(PlacesGroup* group); |
134 | + void CheckScrollBarState(); |
135 | void OnColumnsChanged(); |
136 | void OnFilterAdded(Filter::Ptr filter); |
137 | void OnFilterRemoved(Filter::Ptr filter); |
138 | |
139 | === modified file 'dash/PlacesGroup.cpp' |
140 | --- dash/PlacesGroup.cpp 2012-09-11 12:57:32 +0000 |
141 | +++ dash/PlacesGroup.cpp 2012-09-14 12:02:19 +0000 |
142 | @@ -115,7 +115,7 @@ |
143 | PlacesGroup::PlacesGroup() |
144 | : AbstractPlacesGroup(), |
145 | _child_view(nullptr), |
146 | - _is_expanded(true), |
147 | + _is_expanded(false), |
148 | _n_visible_items_in_unexpand_mode(0), |
149 | _n_total_items(0), |
150 | _category_index(0), |
151 | @@ -128,6 +128,21 @@ |
152 | SetAcceptKeyNavFocusOnMouseEnter(false); |
153 | |
154 | nux::BaseTexture* arrow = style.GetGroupUnexpandIcon(); |
155 | + |
156 | + _background = style.GetCategoryBackground(); |
157 | + _background_nofilters = style.GetCategoryBackgroundNoFilters(); |
158 | + |
159 | + nux::ROPConfig rop; |
160 | + rop.Blend = true; |
161 | + rop.SrcBlend = GL_ONE; |
162 | + rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA; |
163 | + |
164 | + nux::TexCoordXForm texxform; |
165 | + _background_layer.reset(new nux::TextureLayer(_background_nofilters->GetDeviceTexture(), |
166 | + texxform, |
167 | + nux::color::White, |
168 | + false, |
169 | + rop)); |
170 | |
171 | _group_layout = new nux::VLayout("", NUX_TRACKER_LOCATION); |
172 | |
173 | @@ -177,15 +192,6 @@ |
174 | _expand_icon->SetVisible(false); |
175 | _expand_layout->AddView(_expand_icon, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FIX); |
176 | |
177 | - separator_layout_ = new nux::HLayout(); |
178 | - separator_layout_->SetLeftAndRightPadding(style.GetCategorySeparatorLeftPadding(), |
179 | - style.GetCategorySeparatorRightPadding() - style.GetScrollbarWidth()); |
180 | - |
181 | - separator_ = new HSeparator; |
182 | - separator_layout_->AddView(separator_, 1); |
183 | - |
184 | - draw_separator.changed.connect(sigc::mem_fun(this, &PlacesGroup::DrawSeparatorChanged)); |
185 | - |
186 | SetLayout(_group_layout); |
187 | |
188 | // don't need to disconnect these signals as they are disconnected when this object destroys the contents |
189 | @@ -207,15 +213,40 @@ |
190 | else |
191 | nux::GetWindowCompositor().SetKeyFocusArea(GetHeaderFocusableView(), direction); |
192 | }); |
193 | -} |
194 | - |
195 | -void PlacesGroup::DrawSeparatorChanged(bool draw) |
196 | -{ |
197 | - if (draw and !separator_layout_->IsChildOf(_group_layout)) |
198 | - _group_layout->AddView(separator_layout_.GetPointer(), 0); |
199 | - else if (!draw and separator_layout_->IsChildOf(_group_layout)) |
200 | - _group_layout->RemoveChildObject(separator_layout_.GetPointer()); |
201 | - QueueDraw(); |
202 | + |
203 | + _ubus.RegisterInterest(UBUS_REFINE_STATUS, [this] (GVariant *data) |
204 | + { |
205 | + gboolean status; |
206 | + g_variant_get(data, UBUS_REFINE_STATUS_FORMAT_STRING, &status); |
207 | + |
208 | + nux::ROPConfig rop; |
209 | + rop.Blend = true; |
210 | + rop.SrcBlend = GL_ONE; |
211 | + rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA; |
212 | + |
213 | + nux::TexCoordXForm texxform; |
214 | + if (status && _using_nofilters_background) |
215 | + { |
216 | + _background_layer.reset(new nux::TextureLayer(_background->GetDeviceTexture(), |
217 | + texxform, |
218 | + nux::color::White, |
219 | + false, |
220 | + rop)); |
221 | + _using_nofilters_background = false; |
222 | + } |
223 | + else if (!status && !_using_nofilters_background) |
224 | + { |
225 | + _background_layer.reset(new nux::TextureLayer(_background_nofilters->GetDeviceTexture(), |
226 | + texxform, |
227 | + nux::color::White, |
228 | + false, |
229 | + rop)); |
230 | + |
231 | + _using_nofilters_background = true; |
232 | + } |
233 | + QueueDraw(); |
234 | + }); |
235 | + |
236 | } |
237 | |
238 | void |
239 | @@ -253,7 +284,7 @@ |
240 | |
241 | if (g_strcmp0(renderer_name, "tile-horizontal") == 0) |
242 | (static_cast<dash::ResultView*>(_child_view))->SetModelRenderer(new dash::ResultRendererHorizontalTile(NUX_TRACKER_LOCATION)); |
243 | - else |
244 | + else if (g_strcmp0(renderer_name, "tile-vertical") == 0) |
245 | (static_cast<dash::ResultView*>(_child_view))->SetModelRenderer(new dash::ResultRendererTile(NUX_TRACKER_LOCATION)); |
246 | } |
247 | |
248 | @@ -396,6 +427,8 @@ |
249 | { |
250 | if (GetChildView()) |
251 | { |
252 | + |
253 | + |
254 | Refresh(); |
255 | QueueDraw(); |
256 | _group_layout->QueueDraw(); |
257 | @@ -417,10 +450,8 @@ |
258 | if (_cached_geometry.GetWidth() != geo.GetWidth()) |
259 | { |
260 | _focus_layer.reset(dash::Style::Instance().FocusOverlay(geo.width - kHighlightLeftPadding - kHighlightRightPadding, kHighlightHeight)); |
261 | - |
262 | _cached_geometry = geo; |
263 | } |
264 | - |
265 | return ret; |
266 | } |
267 | |
268 | @@ -430,6 +461,7 @@ |
269 | nux::Geometry const& base = GetGeometry(); |
270 | graphics_engine.PushClippingRectangle(base); |
271 | |
272 | + |
273 | if (ShouldBeHighlighted()) |
274 | { |
275 | nux::Geometry geo(_header_layout->GetGeometry()); |
276 | @@ -440,6 +472,20 @@ |
277 | _focus_layer->Renderlayer(graphics_engine); |
278 | } |
279 | |
280 | + nux::Geometry bg_geo = GetGeometry(); |
281 | + int bg_width = 0; |
282 | + if (_using_nofilters_background) |
283 | + bg_width = _background_nofilters->GetWidth(); |
284 | + else |
285 | + bg_width = _background->GetWidth(); |
286 | + |
287 | + bg_geo.x = std::max(bg_geo.width - bg_width,0); |
288 | + |
289 | + bg_geo.width = std::min(bg_width, bg_geo.GetWidth()) + 1; // to render into a space left over by the scrollview |
290 | + bg_geo.height = _background->GetHeight(); |
291 | + |
292 | + _background_layer->SetGeometry(bg_geo); |
293 | + _background_layer->Renderlayer(graphics_engine); |
294 | graphics_engine.PopClippingRectangle(); |
295 | } |
296 | |
297 | @@ -449,7 +495,24 @@ |
298 | nux::Geometry const& base = GetGeometry(); |
299 | |
300 | graphics_engine.PushClippingRectangle(base); |
301 | + nux::Geometry bg_geo = GetGeometry(); |
302 | + |
303 | + int bg_width = 0; |
304 | + if (_using_nofilters_background) |
305 | + bg_width = _background_nofilters->GetWidth(); |
306 | + else |
307 | + bg_width = _background->GetWidth(); |
308 | + |
309 | + // if the dash is smaller, resize to fit, otherwise move to the right edge |
310 | + bg_geo.x = std::max(bg_geo.width - bg_width, 0); |
311 | + bg_geo.width = std::min(bg_width, bg_geo.GetWidth()) + 1; // to render into a space left over by the scrollview |
312 | + |
313 | + bg_geo.height = _background->GetHeight(); |
314 | |
315 | + if (!IsFullRedraw()) |
316 | + { |
317 | + nux::GetPainter().PushLayer(graphics_engine, bg_geo, _background_layer.get()); |
318 | + } |
319 | if (ShouldBeHighlighted() && !IsFullRedraw() && _focus_layer) |
320 | { |
321 | nux::GetPainter().PushLayer(graphics_engine, _focus_layer->GetGeometry(), _focus_layer.get()); |
322 | |
323 | === modified file 'dash/PlacesGroup.h' |
324 | --- dash/PlacesGroup.h 2012-08-20 16:49:10 +0000 |
325 | +++ dash/PlacesGroup.h 2012-09-14 12:02:19 +0000 |
326 | @@ -123,8 +123,6 @@ |
327 | nux::HLayout* _expand_label_layout; |
328 | nux::HLayout* _expand_layout; |
329 | nux::View* _child_view; |
330 | - nux::ObjectPtr<nux::HLayout> separator_layout_; |
331 | - HSeparator* separator_; |
332 | std::unique_ptr<nux::AbstractPaintLayer> _focus_layer; |
333 | |
334 | IconTexture* _icon; |
335 | @@ -132,12 +130,16 @@ |
336 | nux::StaticCairoText* _expand_label; |
337 | IconTexture* _expand_icon; |
338 | |
339 | + nux::BaseTexture* _background; |
340 | + nux::BaseTexture* _background_nofilters; |
341 | + bool _using_nofilters_background; |
342 | + std::unique_ptr<nux::AbstractPaintLayer> _background_layer; |
343 | + |
344 | bool _is_expanded; |
345 | unsigned _n_visible_items_in_unexpand_mode; |
346 | unsigned _n_total_items; |
347 | unsigned _category_index; |
348 | std::string _cached_name; |
349 | - bool _draw_sep; |
350 | nux::Geometry _cached_geometry; |
351 | |
352 | std::string _renderer_name; |
353 | |
354 | === modified file 'panel/PanelController.cpp' |
355 | --- panel/PanelController.cpp 2012-07-23 21:50:30 +0000 |
356 | +++ panel/PanelController.cpp 2012-09-14 12:02:19 +0000 |
357 | @@ -53,6 +53,7 @@ |
358 | std::vector<nux::Geometry> GetGeometries() const; |
359 | |
360 | // NOTE: nux::Property maybe? |
361 | + void SetLauncherWidth(int width); |
362 | void SetOpacity(float opacity); |
363 | void SetOpacityMaximizedToggle(bool enabled); |
364 | |
365 | @@ -147,6 +148,14 @@ |
366 | } |
367 | } |
368 | |
369 | +void Controller::Impl::SetLauncherWidth(int width) |
370 | +{ |
371 | + for (auto const& window: windows_) |
372 | + { |
373 | + ViewForWindow(window)->SetLauncherWidth(width); |
374 | + } |
375 | +} |
376 | + |
377 | void Controller::Impl::SetOpacityMaximizedToggle(bool enabled) |
378 | { |
379 | opacity_maximized_toggle_ = enabled; |
380 | @@ -297,6 +306,11 @@ |
381 | UScreen* screen = UScreen::GetDefault(); |
382 | screen->changed.connect(sigc::mem_fun(this, &Controller::OnScreenChanged)); |
383 | OnScreenChanged(screen->GetPrimaryMonitor(), screen->GetMonitors()); |
384 | + |
385 | + launcher_width.changed.connect([&] (int width) |
386 | + { |
387 | + pimpl->SetLauncherWidth(width); |
388 | + }); |
389 | } |
390 | |
391 | Controller::~Controller() |
392 | |
393 | === modified file 'panel/PanelController.h' |
394 | --- panel/PanelController.h 2012-06-19 08:52:39 +0000 |
395 | +++ panel/PanelController.h 2012-09-14 12:02:19 +0000 |
396 | @@ -44,6 +44,8 @@ |
397 | std::vector<nux::View*> GetPanelViews() const; |
398 | std::vector<nux::Geometry> GetGeometries() const; |
399 | |
400 | + nux::Property<int> launcher_width; |
401 | + |
402 | // NOTE: nux::Property maybe? |
403 | void SetOpacity(float opacity); |
404 | void SetOpacityMaximizedToggle(bool enabled); |
405 | |
406 | === modified file 'panel/PanelView.cpp' |
407 | --- panel/PanelView.cpp 2012-07-26 09:56:17 +0000 |
408 | +++ panel/PanelView.cpp 2012-09-14 12:02:19 +0000 |
409 | @@ -44,7 +44,8 @@ |
410 | |
411 | namespace |
412 | { |
413 | -nux::logging::Logger logger("unity.PanelView"); |
414 | +nux::logging::Logger logger("unity.panel.view"); |
415 | +const int refine_gradient_midpoint = 959; |
416 | } |
417 | |
418 | namespace unity |
419 | @@ -61,6 +62,8 @@ |
420 | , _overlay_is_open(false) |
421 | , _opacity(1.0f) |
422 | , _monitor(0) |
423 | + , _stored_dash_width(0) |
424 | + , _launcher_width(0) |
425 | { |
426 | panel::Style::Instance().changed.connect(sigc::mem_fun(this, &PanelView::ForceUpdateBackground)); |
427 | |
428 | @@ -98,7 +101,47 @@ |
429 | _ubus_manager.RegisterInterest(UBUS_BACKGROUND_COLOR_CHANGED, sigc::mem_fun(this, &PanelView::OnBackgroundUpdate)); |
430 | _ubus_manager.RegisterInterest(UBUS_OVERLAY_HIDDEN, sigc::mem_fun(this, &PanelView::OnOverlayHidden)); |
431 | _ubus_manager.RegisterInterest(UBUS_OVERLAY_SHOWN, sigc::mem_fun(this, &PanelView::OnOverlayShown)); |
432 | - |
433 | + _ubus_manager.RegisterInterest(UBUS_DASH_SIZE_CHANGED, [&] (GVariant *data) |
434 | + { |
435 | + int width, height; |
436 | + g_variant_get(data, "(ii)", &width, &height); |
437 | + _stored_dash_width = width; |
438 | + QueueDraw(); |
439 | + }); |
440 | + |
441 | + _ubus_manager.RegisterInterest(UBUS_REFINE_STATUS, [this] (GVariant *data) |
442 | + { |
443 | + gboolean status; |
444 | + g_variant_get(data, UBUS_REFINE_STATUS_FORMAT_STRING, &status); |
445 | + |
446 | + _refine_is_open = status; |
447 | + |
448 | + nux::ROPConfig rop; |
449 | + rop.Blend = true; |
450 | + rop.SrcBlend = GL_ONE; |
451 | + rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA; |
452 | + |
453 | + nux::TexCoordXForm texxform; |
454 | + if (_refine_is_open) |
455 | + { |
456 | + _bg_refine_layer.reset(new nux::TextureLayer(_bg_refine_tex->GetDeviceTexture(), |
457 | + texxform, |
458 | + nux::color::White, |
459 | + false, |
460 | + rop)); |
461 | + } |
462 | + else |
463 | + { |
464 | + _bg_refine_layer.reset(new nux::TextureLayer(_bg_refine_no_refine_tex->GetDeviceTexture(), |
465 | + texxform, |
466 | + nux::color::White, |
467 | + false, |
468 | + rop)); |
469 | + |
470 | + } |
471 | + QueueDraw(); |
472 | + }); |
473 | + |
474 | // request the latest colour from bghash |
475 | _ubus_manager.SendMessage(UBUS_BACKGROUND_REQUEST_COLOUR_EMIT); |
476 | |
477 | @@ -116,6 +159,61 @@ |
478 | { |
479 | _panel_sheen.Adopt(nux::CreateTexture2DFromPixbuf(pixbuf, true)); |
480 | } |
481 | + |
482 | + //FIXME (gord) like 12 months later, still not async loading! |
483 | + pixbuf = gdk_pixbuf_new_from_file(PKGDATADIR "/refine_gradient_panel.png", &error); |
484 | + if (error) |
485 | + { |
486 | + LOG_WARN(logger) << "Unable to texture " << PKGDATADIR << "/refine_gradient_panel.png"; |
487 | + } |
488 | + else |
489 | + { |
490 | + _bg_refine_tex.Adopt(nux::CreateTexture2DFromPixbuf(pixbuf, true)); |
491 | + } |
492 | + |
493 | + //FIXME (gord) like 12 months later, still not async loading! |
494 | + pixbuf = gdk_pixbuf_new_from_file(PKGDATADIR "/refine_gradient_panel_no_refine.png", &error); |
495 | + if (error) |
496 | + { |
497 | + LOG_WARN(logger) << "Unable to texture " << PKGDATADIR << "/refine_gradient_panel_no_refine.png"; |
498 | + } |
499 | + else |
500 | + { |
501 | + _bg_refine_no_refine_tex.Adopt(nux::CreateTexture2DFromPixbuf(pixbuf, true)); |
502 | + } |
503 | + |
504 | + rop.Blend = true; |
505 | + rop.SrcBlend = GL_ONE; |
506 | + rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA; |
507 | + |
508 | + nux::TexCoordXForm texxform; |
509 | + _bg_refine_layer.reset(new nux::TextureLayer(_bg_refine_tex->GetDeviceTexture(), |
510 | + texxform, |
511 | + nux::color::White, |
512 | + false, |
513 | + rop)); |
514 | + |
515 | + //FIXME (gord) like 12 months later, still not async loading! |
516 | + pixbuf = gdk_pixbuf_new_from_file(PKGDATADIR "/refine_gradient_panel_single_column.png", &error); |
517 | + if (error) |
518 | + { |
519 | + LOG_WARN(logger) << "Unable to texture " << PKGDATADIR << "/refine_gradient_panel_single_column.png"; |
520 | + } |
521 | + else |
522 | + { |
523 | + _bg_refine_single_column_tex.Adopt(nux::CreateTexture2DFromPixbuf(pixbuf, true)); |
524 | + } |
525 | + |
526 | + rop.Blend = true; |
527 | + rop.SrcBlend = GL_ONE; |
528 | + rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA; |
529 | + |
530 | + _bg_refine_single_column_layer.reset(new nux::TextureLayer(_bg_refine_single_column_tex->GetDeviceTexture(), |
531 | + texxform, |
532 | + nux::color::White, |
533 | + false, |
534 | + rop)); |
535 | + |
536 | } |
537 | |
538 | PanelView::~PanelView() |
539 | @@ -138,6 +236,12 @@ |
540 | return _tray->xid(); |
541 | } |
542 | |
543 | +void PanelView::SetLauncherWidth(int width) |
544 | +{ |
545 | + _launcher_width = width; |
546 | + QueueDraw(); |
547 | +} |
548 | + |
549 | void PanelView::OnBackgroundUpdate(GVariant *data) |
550 | { |
551 | gdouble red, green, blue, alpha; |
552 | @@ -285,6 +389,28 @@ |
553 | if (_overlay_is_open) |
554 | { |
555 | nux::GetPainter().RenderSinglePaintLayer(GfxContext, geo, _bg_darken_layer.get()); |
556 | + |
557 | + GfxContext.GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
558 | + nux::TexCoordXForm refine_texxform; |
559 | + |
560 | + int refine_x_pos = geo.x + (_stored_dash_width - refine_gradient_midpoint); |
561 | + |
562 | + refine_x_pos += _launcher_width; |
563 | + GfxContext.QRP_1Tex(refine_x_pos, |
564 | + geo.y, |
565 | + _bg_refine_tex->GetWidth(), |
566 | + _bg_refine_tex->GetHeight(), |
567 | + _bg_refine_tex->GetDeviceTexture(), |
568 | + refine_texxform, |
569 | + nux::color::White); |
570 | + |
571 | + GfxContext.QRP_1Tex(refine_x_pos + _bg_refine_tex->GetWidth(), |
572 | + geo.y, |
573 | + geo.width, |
574 | + geo.height, |
575 | + _bg_refine_single_column_tex->GetDeviceTexture(), |
576 | + refine_texxform, |
577 | + nux::color::White); |
578 | } |
579 | } |
580 | |
581 | @@ -360,6 +486,24 @@ |
582 | { |
583 | nux::GetPainter().PushLayer(GfxContext, geo, _bg_darken_layer.get()); |
584 | bgs++; |
585 | + |
586 | + nux::Geometry refine_geo = geo; |
587 | + |
588 | + int refine_x_pos = geo.x + (_stored_dash_width - refine_gradient_midpoint); |
589 | + refine_x_pos += _launcher_width; |
590 | + |
591 | + refine_geo.x = refine_x_pos; |
592 | + refine_geo.width = _bg_refine_tex->GetWidth(); |
593 | + refine_geo.height = _bg_refine_tex->GetHeight(); |
594 | + |
595 | + nux::GetPainter().PushLayer(GfxContext, refine_geo, _bg_refine_layer.get()); |
596 | + bgs++; |
597 | + |
598 | + refine_geo.x += refine_geo.width; |
599 | + refine_geo.width = geo.width; |
600 | + refine_geo.height = geo.height; |
601 | + nux::GetPainter().PushLayer(GfxContext, refine_geo, _bg_refine_single_column_layer.get()); |
602 | + bgs++; |
603 | } |
604 | } |
605 | |
606 | |
607 | === modified file 'panel/PanelView.h' |
608 | --- panel/PanelView.h 2012-07-04 02:37:23 +0000 |
609 | +++ panel/PanelView.h 2012-09-14 12:02:19 +0000 |
610 | @@ -64,6 +64,8 @@ |
611 | |
612 | Window GetTrayXid() const; |
613 | |
614 | + void SetLauncherWidth(int width); |
615 | + |
616 | protected: |
617 | void Draw(nux::GraphicsEngine& GfxContext, bool force_draw); |
618 | void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw); |
619 | @@ -105,6 +107,12 @@ |
620 | nux::ObjectPtr<nux::BaseTexture> _panel_sheen; |
621 | nux::HLayout* _layout; |
622 | |
623 | + nux::ObjectPtr <nux::BaseTexture> _bg_refine_tex; |
624 | + nux::ObjectPtr <nux::BaseTexture> _bg_refine_no_refine_tex; |
625 | + |
626 | + std::unique_ptr<nux::AbstractPaintLayer> _bg_refine_layer; |
627 | + nux::ObjectPtr <nux::BaseTexture> _bg_refine_single_column_tex; |
628 | + std::unique_ptr<nux::AbstractPaintLayer> _bg_refine_single_column_layer; |
629 | nux::Geometry _last_geo; |
630 | |
631 | nux::Color _bg_color; |
632 | @@ -115,6 +123,9 @@ |
633 | bool _overlay_is_open; |
634 | float _opacity; |
635 | int _monitor; |
636 | + int _stored_dash_width; |
637 | + int _launcher_width; |
638 | + bool _refine_is_open; |
639 | |
640 | std::string _active_overlay; |
641 | |
642 | |
643 | === modified file 'panel/StandalonePanel.cpp' |
644 | --- panel/StandalonePanel.cpp 2012-08-15 02:51:33 +0000 |
645 | +++ panel/StandalonePanel.cpp 2012-09-14 12:02:19 +0000 |
646 | @@ -18,11 +18,12 @@ |
647 | * |
648 | */ |
649 | |
650 | -#include "Nux/Nux.h" |
651 | -#include "Nux/VLayout.h" |
652 | -#include "Nux/HLayout.h" |
653 | -#include "Nux/WindowThread.h" |
654 | -#include "NuxGraphics/GraphicsEngine.h" |
655 | +#include <Nux/Nux.h> |
656 | +#include <Nux/VLayout.h> |
657 | +#include <Nux/HLayout.h> |
658 | +#include <Nux/WindowThread.h> |
659 | +#include <NuxGraphics/GraphicsEngine.h> |
660 | +#include <NuxCore/Logger.h> |
661 | #include <gtk/gtk.h> |
662 | |
663 | #include "unity-shared/UnitySettings.h" |
664 | @@ -47,7 +48,8 @@ |
665 | g_type_init(); |
666 | gtk_init(&argc, &argv); |
667 | nux::NuxInitialize(0); |
668 | - |
669 | + nux::logging::configure_logging(::getenv("UNITY_LOG_SEVERITY")); |
670 | + |
671 | // The instances for the pseudo-singletons. |
672 | unity::Settings settings; |
673 | unity::panel::Style panel_style; |
674 | |
675 | === added file 'plugins/unityshell/resources/category_gradient.png' |
676 | Binary files plugins/unityshell/resources/category_gradient.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/category_gradient.png 2012-09-14 12:02:19 +0000 differ |
677 | === added file 'plugins/unityshell/resources/category_gradient_no_refine.png' |
678 | Binary files plugins/unityshell/resources/category_gradient_no_refine.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/category_gradient_no_refine.png 2012-09-14 12:02:19 +0000 differ |
679 | === added file 'plugins/unityshell/resources/refine_gradient.png' |
680 | Binary files plugins/unityshell/resources/refine_gradient.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/refine_gradient.png 2012-09-14 12:02:19 +0000 differ |
681 | === added file 'plugins/unityshell/resources/refine_gradient_corner.png' |
682 | Binary files plugins/unityshell/resources/refine_gradient_corner.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/refine_gradient_corner.png 2012-09-14 12:02:19 +0000 differ |
683 | === added file 'plugins/unityshell/resources/refine_gradient_dash.png' |
684 | Binary files plugins/unityshell/resources/refine_gradient_dash.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/refine_gradient_dash.png 2012-09-14 12:02:19 +0000 differ |
685 | === added file 'plugins/unityshell/resources/refine_gradient_dash_no_refine.png' |
686 | Binary files plugins/unityshell/resources/refine_gradient_dash_no_refine.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/refine_gradient_dash_no_refine.png 2012-09-14 12:02:19 +0000 differ |
687 | === added file 'plugins/unityshell/resources/refine_gradient_no_refine_dash.png' |
688 | Binary files plugins/unityshell/resources/refine_gradient_no_refine_dash.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/refine_gradient_no_refine_dash.png 2012-09-14 12:02:19 +0000 differ |
689 | === added file 'plugins/unityshell/resources/refine_gradient_panel.png' |
690 | Binary files plugins/unityshell/resources/refine_gradient_panel.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/refine_gradient_panel.png 2012-09-14 12:02:19 +0000 differ |
691 | === added file 'plugins/unityshell/resources/refine_gradient_panel_no_refine.png' |
692 | Binary files plugins/unityshell/resources/refine_gradient_panel_no_refine.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/refine_gradient_panel_no_refine.png 2012-09-14 12:02:19 +0000 differ |
693 | === added file 'plugins/unityshell/resources/refine_gradient_panel_single_column.png' |
694 | Binary files plugins/unityshell/resources/refine_gradient_panel_single_column.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/refine_gradient_panel_single_column.png 2012-09-14 12:02:19 +0000 differ |
695 | === modified file 'plugins/unityshell/src/unityshell.cpp' |
696 | --- plugins/unityshell/src/unityshell.cpp 2012-09-12 18:00:22 +0000 |
697 | +++ plugins/unityshell/src/unityshell.cpp 2012-09-14 12:02:19 +0000 |
698 | @@ -2783,6 +2783,7 @@ |
699 | * that must not be considered when drawing an overlay */ |
700 | hud_controller_->launcher_width = launcher_controller_->launcher().GetAbsoluteWidth() - 1; |
701 | dash_controller_->launcher_width = launcher_controller_->launcher().GetAbsoluteWidth() - 1; |
702 | + panel_controller_->launcher_width = launcher_controller_->launcher().GetAbsoluteWidth() - 1; |
703 | |
704 | if (p) |
705 | { |
706 | |
707 | === modified file 'unity-shared/DashStyle.cpp' |
708 | --- unity-shared/DashStyle.cpp 2012-09-11 13:44:47 +0000 |
709 | +++ unity-shared/DashStyle.cpp 2012-09-14 12:02:19 +0000 |
710 | @@ -196,6 +196,8 @@ |
711 | int text_height_; |
712 | int number_of_columns_; |
713 | |
714 | + LazyLoadTexture category_texture_; |
715 | + LazyLoadTexture category_texture_no_filters_; |
716 | LazyLoadTexture dash_bottom_texture_; |
717 | LazyLoadTexture dash_bottom_texture_mask_; |
718 | LazyLoadTexture dash_right_texture_; |
719 | @@ -218,6 +220,11 @@ |
720 | LazyLoadTexture search_close_texture_; |
721 | LazyLoadTexture search_spin_texture_; |
722 | |
723 | + |
724 | + LazyLoadTexture refine_gradient_corner_; |
725 | + LazyLoadTexture refine_gradient_dash_; |
726 | + LazyLoadTexture refine_gradient_no_refine_dash_; |
727 | + |
728 | LazyLoadTexture group_unexpand_texture_; |
729 | LazyLoadTexture group_expand_texture_; |
730 | |
731 | @@ -239,6 +246,8 @@ |
732 | , text_width_(0) |
733 | , text_height_(0) |
734 | , number_of_columns_(6) |
735 | + , category_texture_("/category_gradient.png") |
736 | + , category_texture_no_filters_("/category_gradient_no_refine.png") |
737 | , dash_bottom_texture_("/dash_bottom_border_tile.png") |
738 | , dash_bottom_texture_mask_("/dash_bottom_border_tile_mask.png") |
739 | , dash_right_texture_("/dash_right_border_tile.png") |
740 | @@ -258,6 +267,9 @@ |
741 | , search_circle_texture_("/search_circle.svg", 32) |
742 | , search_close_texture_("/search_close.svg", 32) |
743 | , search_spin_texture_("/search_spin.svg", 32) |
744 | + , refine_gradient_corner_("/refine_gradient_corner.png") |
745 | + , refine_gradient_dash_("/refine_gradient_dash.png") |
746 | + , refine_gradient_no_refine_dash_("/refine_gradient_dash_no_refine.png") |
747 | , group_unexpand_texture_("/dash_group_unexpand.png") |
748 | , group_expand_texture_("/dash_group_expand.png") |
749 | , star_deselected_texture_("/star_deselected.png") |
750 | @@ -2096,6 +2108,16 @@ |
751 | } |
752 | |
753 | |
754 | +nux::BaseTexture* Style::GetCategoryBackground() |
755 | +{ |
756 | + return pimpl->category_texture_.texture(); |
757 | +} |
758 | + |
759 | +nux::BaseTexture* Style::GetCategoryBackgroundNoFilters() |
760 | +{ |
761 | + return pimpl->category_texture_no_filters_.texture(); |
762 | +} |
763 | + |
764 | nux::BaseTexture* Style::GetDashBottomTile() |
765 | { |
766 | return pimpl->dash_bottom_texture_.texture(); |
767 | @@ -2186,6 +2208,21 @@ |
768 | return pimpl->search_spin_texture_.texture(); |
769 | } |
770 | |
771 | +nux::BaseTexture* Style::GetRefineTextureCorner() |
772 | +{ |
773 | + return pimpl->refine_gradient_corner_.texture(); |
774 | +} |
775 | + |
776 | +nux::BaseTexture* Style::GetRefineNoRefineTextureDash() |
777 | +{ |
778 | + return pimpl->refine_gradient_no_refine_dash_.texture(); |
779 | +} |
780 | + |
781 | +nux::BaseTexture* Style::GetRefineTextureDash() |
782 | +{ |
783 | + return pimpl->refine_gradient_dash_.texture(); |
784 | +} |
785 | + |
786 | nux::BaseTexture* Style::GetGroupUnexpandIcon() |
787 | { |
788 | return pimpl->group_unexpand_texture_.texture(); |
789 | |
790 | === modified file 'unity-shared/DashStyle.h' |
791 | --- unity-shared/DashStyle.h 2012-09-11 13:44:47 +0000 |
792 | +++ unity-shared/DashStyle.h 2012-09-14 12:02:19 +0000 |
793 | @@ -168,6 +168,8 @@ |
794 | |
795 | int GetTextLineHeight() const; |
796 | |
797 | + nux::BaseTexture* GetCategoryBackground(); |
798 | + nux::BaseTexture* GetCategoryBackgroundNoFilters(); |
799 | nux::BaseTexture* GetDashBottomTile(); |
800 | nux::BaseTexture* GetDashBottomTileMask(); |
801 | nux::BaseTexture* GetDashRightTile(); |
802 | @@ -199,7 +201,11 @@ |
803 | nux::BaseTexture* GetStarDeselectedIcon(); |
804 | nux::BaseTexture* GetStarSelectedIcon(); |
805 | nux::BaseTexture* GetStarHighlightIcon(); |
806 | - |
807 | + |
808 | + nux::BaseTexture* GetRefineTextureCorner(); |
809 | + nux::BaseTexture* GetRefineTextureDash(); |
810 | + nux::BaseTexture* GetRefineNoRefineTextureDash(); |
811 | + |
812 | // Returns the width of the separator between the dash and the launcher. |
813 | int GetVSeparatorSize() const; |
814 | |
815 | @@ -209,6 +215,7 @@ |
816 | // Practically it is the space between the top border of the dash and the searchbar. |
817 | int GetDashViewTopPadding() const; |
818 | |
819 | + |
820 | // Search bar |
821 | int GetSearchBarLeftPadding() const; |
822 | int GetSearchBarRightPadding() const; |
823 | |
824 | === modified file 'unity-shared/OverlayRenderer.cpp' |
825 | --- unity-shared/OverlayRenderer.cpp 2012-05-22 10:15:47 +0000 |
826 | +++ unity-shared/OverlayRenderer.cpp 2012-09-14 12:02:19 +0000 |
827 | @@ -64,10 +64,19 @@ |
828 | nux::ObjectPtr <nux::IOpenGLBaseTexture> bg_blur_texture_; |
829 | nux::ObjectPtr <nux::IOpenGLBaseTexture> bg_shine_texture_; |
830 | |
831 | + |
832 | + nux::ObjectPtr<nux::BaseTexture> bg_refine_tex_; |
833 | + nux::ObjectPtr<nux::BaseTexture> bg_refine_no_refine_tex_; |
834 | + nux::ObjectPtr<nux::BaseTexture> bg_refine_corner_tex_; |
835 | + std::unique_ptr<nux::AbstractPaintLayer> bg_refine_gradient_; |
836 | + std::unique_ptr<nux::AbstractPaintLayer> bg_refine_gradient_corner_; |
837 | + |
838 | // temporary variable that stores the number of backgrounds we have rendered |
839 | int bgs; |
840 | bool visible; |
841 | |
842 | + bool refine_is_open_; |
843 | + |
844 | UBusManager ubus_manager_; |
845 | |
846 | OverlayRenderer *parent; |
847 | @@ -107,16 +116,67 @@ |
848 | rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA; |
849 | bg_layer_ = new nux::ColorLayer(nux::Color(0.0f, 0.0f, 0.0f, 0.9), true, rop); |
850 | |
851 | + nux::TexCoordXForm texxform; |
852 | + bg_refine_tex_ = unity::dash::Style::Instance().GetRefineTextureDash(); |
853 | + bg_refine_no_refine_tex_ = unity::dash::Style::Instance().GetRefineNoRefineTextureDash(); |
854 | + |
855 | + bg_refine_gradient_.reset(new nux::TextureLayer(bg_refine_tex_->GetDeviceTexture(), |
856 | + texxform, |
857 | + nux::color::White, |
858 | + false, |
859 | + rop)); |
860 | + |
861 | + bg_refine_corner_tex_ = unity::dash::Style::Instance().GetRefineTextureCorner(); |
862 | + |
863 | + bg_refine_gradient_corner_.reset(new nux::TextureLayer(bg_refine_corner_tex_->GetDeviceTexture(), |
864 | + texxform, |
865 | + nux::color::White, |
866 | + false, |
867 | + rop)); |
868 | + |
869 | + ubus_manager_.RegisterInterest(UBUS_BACKGROUND_COLOR_CHANGED, |
870 | + sigc::mem_fun(this, &OverlayRendererImpl::OnBackgroundColorChanged)); |
871 | + |
872 | rop.Blend = true; |
873 | rop.SrcBlend = GL_ZERO; |
874 | rop.DstBlend = GL_SRC_COLOR; |
875 | bg_darken_layer_ = new nux::ColorLayer(nux::Color(0.9f, 0.9f, 0.9f, 1.0f), false, rop); |
876 | bg_shine_texture_ = unity::dash::Style::Instance().GetDashShine()->GetDeviceTexture(); |
877 | |
878 | - ubus_manager_.RegisterInterest(UBUS_BACKGROUND_COLOR_CHANGED, |
879 | - sigc::mem_fun(this, &OverlayRendererImpl::OnBackgroundColorChanged)); |
880 | - |
881 | ubus_manager_.SendMessage(UBUS_BACKGROUND_REQUEST_COLOUR_EMIT); |
882 | + |
883 | + ubus_manager_.RegisterInterest(UBUS_REFINE_STATUS, [this] (GVariant *data) |
884 | + { |
885 | + gboolean status; |
886 | + g_variant_get(data, UBUS_REFINE_STATUS_FORMAT_STRING, &status); |
887 | + |
888 | + refine_is_open_ = status; |
889 | + nux::ROPConfig rop; |
890 | + rop.Blend = true; |
891 | + rop.SrcBlend = GL_ONE; |
892 | + rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA; |
893 | + |
894 | + nux::TexCoordXForm texxform; |
895 | + |
896 | + if (refine_is_open_) |
897 | + { |
898 | + bg_refine_gradient_.reset(new nux::TextureLayer(bg_refine_tex_->GetDeviceTexture(), |
899 | + texxform, |
900 | + nux::color::White, |
901 | + false, |
902 | + rop)); |
903 | + } |
904 | + else |
905 | + { |
906 | + bg_refine_gradient_.reset(new nux::TextureLayer(bg_refine_no_refine_tex_->GetDeviceTexture(), |
907 | + texxform, |
908 | + nux::color::White, |
909 | + false, |
910 | + rop)); |
911 | + } |
912 | + |
913 | + parent->need_redraw.emit(); |
914 | + }); |
915 | } |
916 | |
917 | void OverlayRendererImpl::OnBackgroundColorChanged(GVariant* args) |
918 | @@ -442,9 +502,7 @@ |
919 | gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER); |
920 | |
921 | const double line_opacity = 0.1f; |
922 | - const int gradient_width = 130; |
923 | const int gradient_height = 50; |
924 | - const int horizontal_padding = 40; |
925 | const int vertical_padding = 20; |
926 | |
927 | // Now that we mask the corners of the dash, |
928 | @@ -470,23 +528,6 @@ |
929 | geometry.y + content_geo.height + INNER_CORNER_RADIUS + corner_overlap, |
930 | line_color * 0.7f); // less opacity |
931 | |
932 | - // Horizontal panel/dash separator |
933 | - nux::GetPainter().Paint2DQuadColor(gfx_context, |
934 | - nux::Geometry(geometry.x + horizontal_padding, |
935 | - geometry.y, |
936 | - gradient_width, |
937 | - style.GetHSeparatorSize()), |
938 | - nux::color::Transparent, |
939 | - nux::color::Transparent, |
940 | - line_color, |
941 | - line_color); |
942 | - nux::GetPainter().Draw2DLine(gfx_context, |
943 | - geometry.x + horizontal_padding + gradient_width, |
944 | - geometry.y, |
945 | - geometry.x + content_geo.width + INNER_CORNER_RADIUS + corner_overlap, |
946 | - style.GetHSeparatorSize(), |
947 | - line_color); |
948 | - |
949 | // Draw the background |
950 | bg_darken_layer_->SetGeometry(larger_content_geo); |
951 | nux::GetPainter().RenderSinglePaintLayer(gfx_context, larger_content_geo, bg_darken_layer_); |
952 | @@ -510,6 +551,33 @@ |
953 | larger_content_geo.width, larger_content_geo.height, |
954 | bg_shine_texture_, texxform_absolute_bg, nux::color::White); |
955 | |
956 | + gfx_context.GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
957 | + nux::TexCoordXForm refine_texxform; |
958 | + |
959 | + if (refine_is_open_) |
960 | + { |
961 | + gfx_context.QRP_1Tex(larger_content_geo.x + larger_content_geo.width - bg_refine_tex_->GetWidth(), |
962 | + larger_content_geo.y, |
963 | + bg_refine_tex_->GetWidth(), |
964 | + std::min(bg_refine_tex_->GetHeight(), larger_content_geo.height), |
965 | + bg_refine_tex_->GetDeviceTexture(), |
966 | + refine_texxform, |
967 | + nux::color::White |
968 | + ); |
969 | + } |
970 | + else |
971 | + { |
972 | + gfx_context.QRP_1Tex(larger_content_geo.x + larger_content_geo.width - bg_refine_no_refine_tex_->GetWidth(), |
973 | + larger_content_geo.y, |
974 | + bg_refine_no_refine_tex_->GetWidth(), |
975 | + std::min(bg_refine_no_refine_tex_->GetHeight(), larger_content_geo.height), |
976 | + bg_refine_no_refine_tex_->GetDeviceTexture(), |
977 | + refine_texxform, |
978 | + nux::color::White |
979 | + ); |
980 | + } |
981 | + |
982 | + |
983 | if (Settings::Instance().GetFormFactor() != FormFactor::NETBOOK || force_edges) |
984 | { |
985 | // Paint the edges |
986 | @@ -850,6 +918,24 @@ |
987 | false, |
988 | rop); |
989 | bgs++; |
990 | + |
991 | + nux::Geometry refine_geo = larger_content_geo; |
992 | + |
993 | + if (refine_is_open_) |
994 | + { |
995 | + refine_geo.x += larger_content_geo.width - bg_refine_tex_->GetWidth(); |
996 | + refine_geo.width = bg_refine_tex_->GetWidth(); |
997 | + refine_geo.height = bg_refine_tex_->GetHeight(); |
998 | + } |
999 | + else |
1000 | + { |
1001 | + refine_geo.x += larger_content_geo.width - bg_refine_no_refine_tex_->GetWidth(); |
1002 | + refine_geo.width = bg_refine_no_refine_tex_->GetWidth(); |
1003 | + refine_geo.height = bg_refine_no_refine_tex_->GetHeight(); |
1004 | + } |
1005 | + |
1006 | + nux::GetPainter().PushLayer(gfx_context, refine_geo, bg_refine_gradient_.get()); |
1007 | + bgs++; |
1008 | } |
1009 | |
1010 | void OverlayRendererImpl::DrawContentCleanup(nux::GraphicsEngine& gfx_context, nux::Geometry content_geo, nux::Geometry absolute_geo, nux::Geometry geometry) |
1011 | |
1012 | === modified file 'unity-shared/UBusMessages.h' |
1013 | --- unity-shared/UBusMessages.h 2012-08-27 03:00:42 +0000 |
1014 | +++ unity-shared/UBusMessages.h 2012-09-14 12:02:19 +0000 |
1015 | @@ -40,6 +40,9 @@ |
1016 | #define UBUS_OVERLAY_HIDDEN "OVERLAY_HIDDEN" |
1017 | #define UBUS_OVERLAY_SHOWN "OVERLAY_SHOWN" |
1018 | |
1019 | +#define UBUS_REFINE_STATUS_FORMAT_STRING "(b)" |
1020 | +#define UBUS_REFINE_STATUS "REFINE_STATUS" |
1021 | + |
1022 | #define UBUS_PLACE_VIEW_QUEUE_DRAW "PLACE_VIEW_QUEUE_DRAW" |
1023 | |
1024 | // Signal send by Launcher/Quicklist when it wants to exit key-nav and wants to |
1025 | |
1026 | === modified file 'unity-standalone/StandaloneUnity.cpp' |
1027 | --- unity-standalone/StandaloneUnity.cpp 2012-07-27 20:20:29 +0000 |
1028 | +++ unity-standalone/StandaloneUnity.cpp 2012-09-14 12:02:19 +0000 |
1029 | @@ -45,7 +45,7 @@ |
1030 | |
1031 | namespace |
1032 | { |
1033 | - static int display_width = 1280; |
1034 | + static int display_width = 1200; |
1035 | static int display_height = 720; |
1036 | static gboolean no_window_decorations = FALSE; |
1037 | static gboolean force_tv = FALSE; |
1038 | @@ -89,7 +89,9 @@ |
1039 | launcher_controller.reset(new launcher::Controller(0)); |
1040 | panel_controller.reset(new panel::Controller()); |
1041 | dash_controller.reset(new dash::Controller()); |
1042 | + |
1043 | dash_controller->launcher_width = launcher_controller->launcher().GetAbsoluteWidth() - 1; |
1044 | + panel_controller->launcher_width = launcher_controller->launcher().GetAbsoluteWidth() - 1; |
1045 | } |
1046 | |
1047 | void UnityStandalone::InitWindowThread(nux::NThread* thread, void* InitData) |
Can you link the bugs to the MP?