Merge lp:~gordallott/unity/newbg into lp:unity

Proposed by Gord Allott
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
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

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

Can you link the bugs to the MP?

review: Needs Information
Revision history for this message
Andrea Azzarone (azzar1) wrote :

+ group->SetMinimumWidth(GetGeometry().width+20);

Use GetBaseWidth. Plase remove magic number too :)

+ scroll_layout_->GetGeometry().height > scroll_view_->GetGeometry().height

Use GetBaseGeometryHeight here too.

+ SetMinimumWidth(2000);

Remove this magic number too.

+ else if (g_strcmp0(renderer_name, "tile-vertical"))

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_items_in_unexpand_mode < 6 && _using_nofilters_background)
227 + {

Move 6 in a variable or something like that. Also rename _n_visible_items_in_unexpand_mode and _using_nofilters_background using the new style for the private members (variable_).

228 + _background_layer.reset(new nux::TextureLayer(_background->GetDeviceTexture(),
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.

review: Needs Fixing
Revision history for this message
Omer Akram (om26er) wrote :

Unity is crashing for me with this branch: http://fpaste.org/VcFL/raw/

Revision history for this message
Gord Allott (gordallott) wrote :

> Move 6 in a variable or something like that. Also rename
> _n_visible_items_in_unexpand_mode and _using_nofilters_background using the
> 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

Revision history for this message
Gord Allott (gordallott) wrote :

> Unity is crashing for me with this branch: http://fpaste.org/VcFL/raw/

don't use fedoras pastebin, its a giant pain, has captchas just to view

it looks like you don't have refine_gradient_panel_single_column.png installed. crashes are expected if you don't have the required resources

Revision history for this message
John Lea (johnlea) :
review: Approve (design)
Revision history for this message
Andrea Azzarone (azzar1) wrote :

Some indentation issues and GetGeometry().width not fixed. Not blocking.

review: Approve
Revision history for this message
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.

Revision history for this message
Omer Akram (om26er) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'dash/FilterBar.cpp'
--- dash/FilterBar.cpp 2012-05-06 23:48:38 +0000
+++ dash/FilterBar.cpp 2012-09-14 12:02:19 +0000
@@ -82,8 +82,6 @@
82 AddChild(filter_view);82 AddChild(filter_view);
83 filter_map_[filter] = filter_view;83 filter_map_[filter] = filter_view;
84 GetLayout()->AddView(filter_view, 0, nux::MINOR_POSITION_LEFT, nux::MINOR_SIZE_FULL);84 GetLayout()->AddView(filter_view, 0, nux::MINOR_POSITION_LEFT, nux::MINOR_SIZE_FULL);
85
86 UpdateDrawSeparators();
87}85}
8886
89void FilterBar::RemoveFilter(Filter::Ptr const& filter)87void FilterBar::RemoveFilter(Filter::Ptr const& filter)
@@ -99,8 +97,6 @@
99 break;97 break;
100 }98 }
101 }99 }
102
103 UpdateDrawSeparators();
104}100}
105101
106void FilterBar::Draw(nux::GraphicsEngine& GfxContext, bool force_draw)102void FilterBar::Draw(nux::GraphicsEngine& GfxContext, bool force_draw)
@@ -120,24 +116,6 @@
120 GfxContext.PopClippingRectangle();116 GfxContext.PopClippingRectangle();
121}117}
122118
123void FilterBar::UpdateDrawSeparators()
124{
125 std::list<Area*> children = GetLayout()->GetChildren();
126 std::list<Area*>::reverse_iterator rit;
127 bool found_one = false;
128
129 for (rit = children.rbegin(); rit != children.rend(); ++rit)
130 {
131 FilterExpanderLabel* widget = dynamic_cast<FilterExpanderLabel*>(*rit);
132
133 if (!widget)
134 continue;
135
136 widget->draw_separator = found_one;
137 found_one = true;
138 }
139}
140
141//119//
142// Key navigation120// Key navigation
143//121//
144122
=== modified file 'dash/FilterBar.h'
--- dash/FilterBar.h 2012-05-06 23:48:38 +0000
+++ dash/FilterBar.h 2012-09-14 12:02:19 +0000
@@ -60,7 +60,6 @@
6060
61private:61private:
62 void Init();62 void Init();
63 void UpdateDrawSeparators();
6463
65 FilterFactory factory_;64 FilterFactory factory_;
66 Filters::Ptr filters_;65 Filters::Ptr filters_;
6766
=== modified file 'dash/LensView.cpp'
--- dash/LensView.cpp 2012-09-14 10:52:01 +0000
+++ dash/LensView.cpp 2012-09-14 12:02:19 +0000
@@ -147,7 +147,14 @@
147 lens_->connected.changed.connect([&](bool is_connected) { if (is_connected) initial_activation_ = true; });147 lens_->connected.changed.connect([&](bool is_connected) { if (is_connected) initial_activation_ = true; });
148 lens_->categories_reordered.connect(sigc::mem_fun(this, &LensView::OnCategoryOrderChanged));148 lens_->categories_reordered.connect(sigc::mem_fun(this, &LensView::OnCategoryOrderChanged));
149 search_string.SetGetterFunction(sigc::mem_fun(this, &LensView::get_search_string));149 search_string.SetGetterFunction(sigc::mem_fun(this, &LensView::get_search_string));
150 filters_expanded.changed.connect([&](bool expanded) { fscroll_view_->SetVisible(expanded); QueueRelayout(); OnColumnsChanged(); });150 filters_expanded.changed.connect([&](bool expanded)
151 {
152 fscroll_view_->SetVisible(expanded);
153 QueueRelayout();
154 OnColumnsChanged();
155 ubus_manager_.SendMessage(UBUS_REFINE_STATUS,
156 g_variant_new(UBUS_REFINE_STATUS_FORMAT_STRING, expanded ? TRUE : FALSE));
157 });
151 view_type.changed.connect(sigc::mem_fun(this, &LensView::OnViewTypeChanged));158 view_type.changed.connect(sigc::mem_fun(this, &LensView::OnViewTypeChanged));
152159
153 ubus_manager_.RegisterInterest(UBUS_RESULT_VIEW_KEYNAV_CHANGED, [&] (GVariant* data) {160 ubus_manager_.RegisterInterest(UBUS_RESULT_VIEW_KEYNAV_CHANGED, [&] (GVariant* data) {
@@ -189,10 +196,15 @@
189196
190 scroll_view_ = new LensScrollView(new PlacesVScrollBar(NUX_TRACKER_LOCATION),197 scroll_view_ = new LensScrollView(new PlacesVScrollBar(NUX_TRACKER_LOCATION),
191 NUX_TRACKER_LOCATION);198 NUX_TRACKER_LOCATION);
192 scroll_view_->EnableVerticalScrollBar(true);199 scroll_view_->EnableVerticalScrollBar(false);
193 scroll_view_->EnableHorizontalScrollBar(false);200 scroll_view_->EnableHorizontalScrollBar(false);
194 layout_->AddView(scroll_view_);201 layout_->AddView(scroll_view_);
195202
203 scroll_view_->OnGeometryChanged.connect([this] (nux::Area *area, nux::Geometry& geo)
204 {
205 CheckScrollBarState();
206 });
207
196 scroll_layout_ = new nux::VLayout(NUX_TRACKER_LOCATION);208 scroll_layout_ = new nux::VLayout(NUX_TRACKER_LOCATION);
197 scroll_view_->SetLayout(scroll_layout_);209 scroll_view_->SetLayout(scroll_layout_);
198 scroll_view_->SetRightArea(show_filters);210 scroll_view_->SetRightArea(show_filters);
@@ -388,6 +400,8 @@
388 scroll_layout_->AddView(group, 0, nux::MinorDimensionPosition::eAbove,400 scroll_layout_->AddView(group, 0, nux::MinorDimensionPosition::eAbove,
389 nux::MinorDimensionSize::eFull, 100.0f,401 nux::MinorDimensionSize::eFull, 100.0f,
390 (nux::LayoutPosition)index);402 (nux::LayoutPosition)index);
403
404 group->SetMinimumWidth(GetGeometry().width);
391}405}
392406
393void LensView::OnCategoryOrderChanged()407void LensView::OnCategoryOrderChanged()
@@ -624,6 +638,20 @@
624 ResultViewGrid* grid = static_cast<ResultViewGrid*>(group->GetChildView());638 ResultViewGrid* grid = static_cast<ResultViewGrid*>(group->GetChildView());
625 grid->expanded = group->GetExpanded();639 grid->expanded = group->GetExpanded();
626 ubus_manager_.SendMessage(UBUS_PLACE_VIEW_QUEUE_DRAW);640 ubus_manager_.SendMessage(UBUS_PLACE_VIEW_QUEUE_DRAW);
641
642 CheckScrollBarState();
643}
644
645void LensView::CheckScrollBarState()
646{
647 if (scroll_layout_->GetGeometry().height > scroll_view_->GetGeometry().height)
648 {
649 scroll_view_->EnableVerticalScrollBar(true);
650 }
651 else
652 {
653 scroll_view_->EnableVerticalScrollBar(false);
654 }
627}655}
628656
629void LensView::OnColumnsChanged()657void LensView::OnColumnsChanged()
630658
=== modified file 'dash/LensView.h'
--- dash/LensView.h 2012-09-13 09:05:42 +0000
+++ dash/LensView.h 2012-09-14 12:02:19 +0000
@@ -88,6 +88,7 @@
88 void OnResultRemoved(Result const& result);88 void OnResultRemoved(Result const& result);
89 void UpdateCounts(PlacesGroup* group);89 void UpdateCounts(PlacesGroup* group);
90 void OnGroupExpanded(PlacesGroup* group);90 void OnGroupExpanded(PlacesGroup* group);
91 void CheckScrollBarState();
91 void OnColumnsChanged();92 void OnColumnsChanged();
92 void OnFilterAdded(Filter::Ptr filter);93 void OnFilterAdded(Filter::Ptr filter);
93 void OnFilterRemoved(Filter::Ptr filter);94 void OnFilterRemoved(Filter::Ptr filter);
9495
=== modified file 'dash/PlacesGroup.cpp'
--- dash/PlacesGroup.cpp 2012-09-11 12:57:32 +0000
+++ dash/PlacesGroup.cpp 2012-09-14 12:02:19 +0000
@@ -115,7 +115,7 @@
115PlacesGroup::PlacesGroup()115PlacesGroup::PlacesGroup()
116 : AbstractPlacesGroup(),116 : AbstractPlacesGroup(),
117 _child_view(nullptr),117 _child_view(nullptr),
118 _is_expanded(true),118 _is_expanded(false),
119 _n_visible_items_in_unexpand_mode(0),119 _n_visible_items_in_unexpand_mode(0),
120 _n_total_items(0),120 _n_total_items(0),
121 _category_index(0),121 _category_index(0),
@@ -128,6 +128,21 @@
128 SetAcceptKeyNavFocusOnMouseEnter(false);128 SetAcceptKeyNavFocusOnMouseEnter(false);
129129
130 nux::BaseTexture* arrow = style.GetGroupUnexpandIcon();130 nux::BaseTexture* arrow = style.GetGroupUnexpandIcon();
131
132 _background = style.GetCategoryBackground();
133 _background_nofilters = style.GetCategoryBackgroundNoFilters();
134
135 nux::ROPConfig rop;
136 rop.Blend = true;
137 rop.SrcBlend = GL_ONE;
138 rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
139
140 nux::TexCoordXForm texxform;
141 _background_layer.reset(new nux::TextureLayer(_background_nofilters->GetDeviceTexture(),
142 texxform,
143 nux::color::White,
144 false,
145 rop));
131146
132 _group_layout = new nux::VLayout("", NUX_TRACKER_LOCATION);147 _group_layout = new nux::VLayout("", NUX_TRACKER_LOCATION);
133148
@@ -177,15 +192,6 @@
177 _expand_icon->SetVisible(false);192 _expand_icon->SetVisible(false);
178 _expand_layout->AddView(_expand_icon, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FIX);193 _expand_layout->AddView(_expand_icon, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FIX);
179194
180 separator_layout_ = new nux::HLayout();
181 separator_layout_->SetLeftAndRightPadding(style.GetCategorySeparatorLeftPadding(),
182 style.GetCategorySeparatorRightPadding() - style.GetScrollbarWidth());
183
184 separator_ = new HSeparator;
185 separator_layout_->AddView(separator_, 1);
186
187 draw_separator.changed.connect(sigc::mem_fun(this, &PlacesGroup::DrawSeparatorChanged));
188
189 SetLayout(_group_layout);195 SetLayout(_group_layout);
190196
191 // don't need to disconnect these signals as they are disconnected when this object destroys the contents197 // don't need to disconnect these signals as they are disconnected when this object destroys the contents
@@ -207,15 +213,40 @@
207 else213 else
208 nux::GetWindowCompositor().SetKeyFocusArea(GetHeaderFocusableView(), direction);214 nux::GetWindowCompositor().SetKeyFocusArea(GetHeaderFocusableView(), direction);
209 });215 });
210}216
211217 _ubus.RegisterInterest(UBUS_REFINE_STATUS, [this] (GVariant *data)
212void PlacesGroup::DrawSeparatorChanged(bool draw)218 {
213{219 gboolean status;
214 if (draw and !separator_layout_->IsChildOf(_group_layout))220 g_variant_get(data, UBUS_REFINE_STATUS_FORMAT_STRING, &status);
215 _group_layout->AddView(separator_layout_.GetPointer(), 0);221
216 else if (!draw and separator_layout_->IsChildOf(_group_layout))222 nux::ROPConfig rop;
217 _group_layout->RemoveChildObject(separator_layout_.GetPointer());223 rop.Blend = true;
218 QueueDraw();224 rop.SrcBlend = GL_ONE;
225 rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
226
227 nux::TexCoordXForm texxform;
228 if (status && _using_nofilters_background)
229 {
230 _background_layer.reset(new nux::TextureLayer(_background->GetDeviceTexture(),
231 texxform,
232 nux::color::White,
233 false,
234 rop));
235 _using_nofilters_background = false;
236 }
237 else if (!status && !_using_nofilters_background)
238 {
239 _background_layer.reset(new nux::TextureLayer(_background_nofilters->GetDeviceTexture(),
240 texxform,
241 nux::color::White,
242 false,
243 rop));
244
245 _using_nofilters_background = true;
246 }
247 QueueDraw();
248 });
249
219}250}
220251
221void252void
@@ -253,7 +284,7 @@
253284
254 if (g_strcmp0(renderer_name, "tile-horizontal") == 0)285 if (g_strcmp0(renderer_name, "tile-horizontal") == 0)
255 (static_cast<dash::ResultView*>(_child_view))->SetModelRenderer(new dash::ResultRendererHorizontalTile(NUX_TRACKER_LOCATION));286 (static_cast<dash::ResultView*>(_child_view))->SetModelRenderer(new dash::ResultRendererHorizontalTile(NUX_TRACKER_LOCATION));
256 else287 else if (g_strcmp0(renderer_name, "tile-vertical") == 0)
257 (static_cast<dash::ResultView*>(_child_view))->SetModelRenderer(new dash::ResultRendererTile(NUX_TRACKER_LOCATION));288 (static_cast<dash::ResultView*>(_child_view))->SetModelRenderer(new dash::ResultRendererTile(NUX_TRACKER_LOCATION));
258}289}
259290
@@ -396,6 +427,8 @@
396{427{
397 if (GetChildView())428 if (GetChildView())
398 {429 {
430
431
399 Refresh();432 Refresh();
400 QueueDraw();433 QueueDraw();
401 _group_layout->QueueDraw();434 _group_layout->QueueDraw();
@@ -417,10 +450,8 @@
417 if (_cached_geometry.GetWidth() != geo.GetWidth())450 if (_cached_geometry.GetWidth() != geo.GetWidth())
418 {451 {
419 _focus_layer.reset(dash::Style::Instance().FocusOverlay(geo.width - kHighlightLeftPadding - kHighlightRightPadding, kHighlightHeight));452 _focus_layer.reset(dash::Style::Instance().FocusOverlay(geo.width - kHighlightLeftPadding - kHighlightRightPadding, kHighlightHeight));
420
421 _cached_geometry = geo;453 _cached_geometry = geo;
422 }454 }
423
424 return ret;455 return ret;
425}456}
426457
@@ -430,6 +461,7 @@
430 nux::Geometry const& base = GetGeometry();461 nux::Geometry const& base = GetGeometry();
431 graphics_engine.PushClippingRectangle(base);462 graphics_engine.PushClippingRectangle(base);
432463
464
433 if (ShouldBeHighlighted())465 if (ShouldBeHighlighted())
434 {466 {
435 nux::Geometry geo(_header_layout->GetGeometry());467 nux::Geometry geo(_header_layout->GetGeometry());
@@ -440,6 +472,20 @@
440 _focus_layer->Renderlayer(graphics_engine);472 _focus_layer->Renderlayer(graphics_engine);
441 }473 }
442474
475 nux::Geometry bg_geo = GetGeometry();
476 int bg_width = 0;
477 if (_using_nofilters_background)
478 bg_width = _background_nofilters->GetWidth();
479 else
480 bg_width = _background->GetWidth();
481
482 bg_geo.x = std::max(bg_geo.width - bg_width,0);
483
484 bg_geo.width = std::min(bg_width, bg_geo.GetWidth()) + 1; // to render into a space left over by the scrollview
485 bg_geo.height = _background->GetHeight();
486
487 _background_layer->SetGeometry(bg_geo);
488 _background_layer->Renderlayer(graphics_engine);
443 graphics_engine.PopClippingRectangle();489 graphics_engine.PopClippingRectangle();
444}490}
445491
@@ -449,7 +495,24 @@
449 nux::Geometry const& base = GetGeometry();495 nux::Geometry const& base = GetGeometry();
450496
451 graphics_engine.PushClippingRectangle(base);497 graphics_engine.PushClippingRectangle(base);
498 nux::Geometry bg_geo = GetGeometry();
499
500 int bg_width = 0;
501 if (_using_nofilters_background)
502 bg_width = _background_nofilters->GetWidth();
503 else
504 bg_width = _background->GetWidth();
505
506 // if the dash is smaller, resize to fit, otherwise move to the right edge
507 bg_geo.x = std::max(bg_geo.width - bg_width, 0);
508 bg_geo.width = std::min(bg_width, bg_geo.GetWidth()) + 1; // to render into a space left over by the scrollview
509
510 bg_geo.height = _background->GetHeight();
452511
512 if (!IsFullRedraw())
513 {
514 nux::GetPainter().PushLayer(graphics_engine, bg_geo, _background_layer.get());
515 }
453 if (ShouldBeHighlighted() && !IsFullRedraw() && _focus_layer)516 if (ShouldBeHighlighted() && !IsFullRedraw() && _focus_layer)
454 {517 {
455 nux::GetPainter().PushLayer(graphics_engine, _focus_layer->GetGeometry(), _focus_layer.get());518 nux::GetPainter().PushLayer(graphics_engine, _focus_layer->GetGeometry(), _focus_layer.get());
456519
=== modified file 'dash/PlacesGroup.h'
--- dash/PlacesGroup.h 2012-08-20 16:49:10 +0000
+++ dash/PlacesGroup.h 2012-09-14 12:02:19 +0000
@@ -123,8 +123,6 @@
123 nux::HLayout* _expand_label_layout;123 nux::HLayout* _expand_label_layout;
124 nux::HLayout* _expand_layout;124 nux::HLayout* _expand_layout;
125 nux::View* _child_view;125 nux::View* _child_view;
126 nux::ObjectPtr<nux::HLayout> separator_layout_;
127 HSeparator* separator_;
128 std::unique_ptr<nux::AbstractPaintLayer> _focus_layer;126 std::unique_ptr<nux::AbstractPaintLayer> _focus_layer;
129127
130 IconTexture* _icon;128 IconTexture* _icon;
@@ -132,12 +130,16 @@
132 nux::StaticCairoText* _expand_label;130 nux::StaticCairoText* _expand_label;
133 IconTexture* _expand_icon;131 IconTexture* _expand_icon;
134132
133 nux::BaseTexture* _background;
134 nux::BaseTexture* _background_nofilters;
135 bool _using_nofilters_background;
136 std::unique_ptr<nux::AbstractPaintLayer> _background_layer;
137
135 bool _is_expanded;138 bool _is_expanded;
136 unsigned _n_visible_items_in_unexpand_mode;139 unsigned _n_visible_items_in_unexpand_mode;
137 unsigned _n_total_items;140 unsigned _n_total_items;
138 unsigned _category_index;141 unsigned _category_index;
139 std::string _cached_name;142 std::string _cached_name;
140 bool _draw_sep;
141 nux::Geometry _cached_geometry;143 nux::Geometry _cached_geometry;
142 144
143 std::string _renderer_name;145 std::string _renderer_name;
144146
=== modified file 'panel/PanelController.cpp'
--- panel/PanelController.cpp 2012-07-23 21:50:30 +0000
+++ panel/PanelController.cpp 2012-09-14 12:02:19 +0000
@@ -53,6 +53,7 @@
53 std::vector<nux::Geometry> GetGeometries() const;53 std::vector<nux::Geometry> GetGeometries() const;
5454
55 // NOTE: nux::Property maybe?55 // NOTE: nux::Property maybe?
56 void SetLauncherWidth(int width);
56 void SetOpacity(float opacity);57 void SetOpacity(float opacity);
57 void SetOpacityMaximizedToggle(bool enabled);58 void SetOpacityMaximizedToggle(bool enabled);
5859
@@ -147,6 +148,14 @@
147 }148 }
148}149}
149150
151void Controller::Impl::SetLauncherWidth(int width)
152{
153 for (auto const& window: windows_)
154 {
155 ViewForWindow(window)->SetLauncherWidth(width);
156 }
157}
158
150void Controller::Impl::SetOpacityMaximizedToggle(bool enabled)159void Controller::Impl::SetOpacityMaximizedToggle(bool enabled)
151{160{
152 opacity_maximized_toggle_ = enabled;161 opacity_maximized_toggle_ = enabled;
@@ -297,6 +306,11 @@
297 UScreen* screen = UScreen::GetDefault();306 UScreen* screen = UScreen::GetDefault();
298 screen->changed.connect(sigc::mem_fun(this, &Controller::OnScreenChanged));307 screen->changed.connect(sigc::mem_fun(this, &Controller::OnScreenChanged));
299 OnScreenChanged(screen->GetPrimaryMonitor(), screen->GetMonitors());308 OnScreenChanged(screen->GetPrimaryMonitor(), screen->GetMonitors());
309
310 launcher_width.changed.connect([&] (int width)
311 {
312 pimpl->SetLauncherWidth(width);
313 });
300}314}
301315
302Controller::~Controller()316Controller::~Controller()
303317
=== modified file 'panel/PanelController.h'
--- panel/PanelController.h 2012-06-19 08:52:39 +0000
+++ panel/PanelController.h 2012-09-14 12:02:19 +0000
@@ -44,6 +44,8 @@
44 std::vector<nux::View*> GetPanelViews() const;44 std::vector<nux::View*> GetPanelViews() const;
45 std::vector<nux::Geometry> GetGeometries() const;45 std::vector<nux::Geometry> GetGeometries() const;
4646
47 nux::Property<int> launcher_width;
48
47 // NOTE: nux::Property maybe?49 // NOTE: nux::Property maybe?
48 void SetOpacity(float opacity);50 void SetOpacity(float opacity);
49 void SetOpacityMaximizedToggle(bool enabled);51 void SetOpacityMaximizedToggle(bool enabled);
5052
=== modified file 'panel/PanelView.cpp'
--- panel/PanelView.cpp 2012-07-26 09:56:17 +0000
+++ panel/PanelView.cpp 2012-09-14 12:02:19 +0000
@@ -44,7 +44,8 @@
4444
45namespace45namespace
46{46{
47nux::logging::Logger logger("unity.PanelView");47nux::logging::Logger logger("unity.panel.view");
48const int refine_gradient_midpoint = 959;
48}49}
4950
50namespace unity51namespace unity
@@ -61,6 +62,8 @@
61 , _overlay_is_open(false)62 , _overlay_is_open(false)
62 , _opacity(1.0f)63 , _opacity(1.0f)
63 , _monitor(0)64 , _monitor(0)
65 , _stored_dash_width(0)
66 , _launcher_width(0)
64{67{
65 panel::Style::Instance().changed.connect(sigc::mem_fun(this, &PanelView::ForceUpdateBackground));68 panel::Style::Instance().changed.connect(sigc::mem_fun(this, &PanelView::ForceUpdateBackground));
6669
@@ -98,7 +101,47 @@
98 _ubus_manager.RegisterInterest(UBUS_BACKGROUND_COLOR_CHANGED, sigc::mem_fun(this, &PanelView::OnBackgroundUpdate));101 _ubus_manager.RegisterInterest(UBUS_BACKGROUND_COLOR_CHANGED, sigc::mem_fun(this, &PanelView::OnBackgroundUpdate));
99 _ubus_manager.RegisterInterest(UBUS_OVERLAY_HIDDEN, sigc::mem_fun(this, &PanelView::OnOverlayHidden));102 _ubus_manager.RegisterInterest(UBUS_OVERLAY_HIDDEN, sigc::mem_fun(this, &PanelView::OnOverlayHidden));
100 _ubus_manager.RegisterInterest(UBUS_OVERLAY_SHOWN, sigc::mem_fun(this, &PanelView::OnOverlayShown));103 _ubus_manager.RegisterInterest(UBUS_OVERLAY_SHOWN, sigc::mem_fun(this, &PanelView::OnOverlayShown));
101104 _ubus_manager.RegisterInterest(UBUS_DASH_SIZE_CHANGED, [&] (GVariant *data)
105 {
106 int width, height;
107 g_variant_get(data, "(ii)", &width, &height);
108 _stored_dash_width = width;
109 QueueDraw();
110 });
111
112 _ubus_manager.RegisterInterest(UBUS_REFINE_STATUS, [this] (GVariant *data)
113 {
114 gboolean status;
115 g_variant_get(data, UBUS_REFINE_STATUS_FORMAT_STRING, &status);
116
117 _refine_is_open = status;
118
119 nux::ROPConfig rop;
120 rop.Blend = true;
121 rop.SrcBlend = GL_ONE;
122 rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
123
124 nux::TexCoordXForm texxform;
125 if (_refine_is_open)
126 {
127 _bg_refine_layer.reset(new nux::TextureLayer(_bg_refine_tex->GetDeviceTexture(),
128 texxform,
129 nux::color::White,
130 false,
131 rop));
132 }
133 else
134 {
135 _bg_refine_layer.reset(new nux::TextureLayer(_bg_refine_no_refine_tex->GetDeviceTexture(),
136 texxform,
137 nux::color::White,
138 false,
139 rop));
140
141 }
142 QueueDraw();
143 });
144
102 // request the latest colour from bghash145 // request the latest colour from bghash
103 _ubus_manager.SendMessage(UBUS_BACKGROUND_REQUEST_COLOUR_EMIT);146 _ubus_manager.SendMessage(UBUS_BACKGROUND_REQUEST_COLOUR_EMIT);
104147
@@ -116,6 +159,61 @@
116 {159 {
117 _panel_sheen.Adopt(nux::CreateTexture2DFromPixbuf(pixbuf, true));160 _panel_sheen.Adopt(nux::CreateTexture2DFromPixbuf(pixbuf, true));
118 }161 }
162
163 //FIXME (gord) like 12 months later, still not async loading!
164 pixbuf = gdk_pixbuf_new_from_file(PKGDATADIR "/refine_gradient_panel.png", &error);
165 if (error)
166 {
167 LOG_WARN(logger) << "Unable to texture " << PKGDATADIR << "/refine_gradient_panel.png";
168 }
169 else
170 {
171 _bg_refine_tex.Adopt(nux::CreateTexture2DFromPixbuf(pixbuf, true));
172 }
173
174 //FIXME (gord) like 12 months later, still not async loading!
175 pixbuf = gdk_pixbuf_new_from_file(PKGDATADIR "/refine_gradient_panel_no_refine.png", &error);
176 if (error)
177 {
178 LOG_WARN(logger) << "Unable to texture " << PKGDATADIR << "/refine_gradient_panel_no_refine.png";
179 }
180 else
181 {
182 _bg_refine_no_refine_tex.Adopt(nux::CreateTexture2DFromPixbuf(pixbuf, true));
183 }
184
185 rop.Blend = true;
186 rop.SrcBlend = GL_ONE;
187 rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
188
189 nux::TexCoordXForm texxform;
190 _bg_refine_layer.reset(new nux::TextureLayer(_bg_refine_tex->GetDeviceTexture(),
191 texxform,
192 nux::color::White,
193 false,
194 rop));
195
196 //FIXME (gord) like 12 months later, still not async loading!
197 pixbuf = gdk_pixbuf_new_from_file(PKGDATADIR "/refine_gradient_panel_single_column.png", &error);
198 if (error)
199 {
200 LOG_WARN(logger) << "Unable to texture " << PKGDATADIR << "/refine_gradient_panel_single_column.png";
201 }
202 else
203 {
204 _bg_refine_single_column_tex.Adopt(nux::CreateTexture2DFromPixbuf(pixbuf, true));
205 }
206
207 rop.Blend = true;
208 rop.SrcBlend = GL_ONE;
209 rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
210
211 _bg_refine_single_column_layer.reset(new nux::TextureLayer(_bg_refine_single_column_tex->GetDeviceTexture(),
212 texxform,
213 nux::color::White,
214 false,
215 rop));
216
119}217}
120218
121PanelView::~PanelView()219PanelView::~PanelView()
@@ -138,6 +236,12 @@
138 return _tray->xid();236 return _tray->xid();
139}237}
140238
239void PanelView::SetLauncherWidth(int width)
240{
241 _launcher_width = width;
242 QueueDraw();
243}
244
141void PanelView::OnBackgroundUpdate(GVariant *data)245void PanelView::OnBackgroundUpdate(GVariant *data)
142{246{
143 gdouble red, green, blue, alpha;247 gdouble red, green, blue, alpha;
@@ -285,6 +389,28 @@
285 if (_overlay_is_open)389 if (_overlay_is_open)
286 {390 {
287 nux::GetPainter().RenderSinglePaintLayer(GfxContext, geo, _bg_darken_layer.get());391 nux::GetPainter().RenderSinglePaintLayer(GfxContext, geo, _bg_darken_layer.get());
392
393 GfxContext.GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
394 nux::TexCoordXForm refine_texxform;
395
396 int refine_x_pos = geo.x + (_stored_dash_width - refine_gradient_midpoint);
397
398 refine_x_pos += _launcher_width;
399 GfxContext.QRP_1Tex(refine_x_pos,
400 geo.y,
401 _bg_refine_tex->GetWidth(),
402 _bg_refine_tex->GetHeight(),
403 _bg_refine_tex->GetDeviceTexture(),
404 refine_texxform,
405 nux::color::White);
406
407 GfxContext.QRP_1Tex(refine_x_pos + _bg_refine_tex->GetWidth(),
408 geo.y,
409 geo.width,
410 geo.height,
411 _bg_refine_single_column_tex->GetDeviceTexture(),
412 refine_texxform,
413 nux::color::White);
288 }414 }
289 }415 }
290416
@@ -360,6 +486,24 @@
360 {486 {
361 nux::GetPainter().PushLayer(GfxContext, geo, _bg_darken_layer.get());487 nux::GetPainter().PushLayer(GfxContext, geo, _bg_darken_layer.get());
362 bgs++;488 bgs++;
489
490 nux::Geometry refine_geo = geo;
491
492 int refine_x_pos = geo.x + (_stored_dash_width - refine_gradient_midpoint);
493 refine_x_pos += _launcher_width;
494
495 refine_geo.x = refine_x_pos;
496 refine_geo.width = _bg_refine_tex->GetWidth();
497 refine_geo.height = _bg_refine_tex->GetHeight();
498
499 nux::GetPainter().PushLayer(GfxContext, refine_geo, _bg_refine_layer.get());
500 bgs++;
501
502 refine_geo.x += refine_geo.width;
503 refine_geo.width = geo.width;
504 refine_geo.height = geo.height;
505 nux::GetPainter().PushLayer(GfxContext, refine_geo, _bg_refine_single_column_layer.get());
506 bgs++;
363 }507 }
364 }508 }
365509
366510
=== modified file 'panel/PanelView.h'
--- panel/PanelView.h 2012-07-04 02:37:23 +0000
+++ panel/PanelView.h 2012-09-14 12:02:19 +0000
@@ -64,6 +64,8 @@
6464
65 Window GetTrayXid() const;65 Window GetTrayXid() const;
6666
67 void SetLauncherWidth(int width);
68
67protected:69protected:
68 void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);70 void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
69 void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);71 void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);
@@ -105,6 +107,12 @@
105 nux::ObjectPtr<nux::BaseTexture> _panel_sheen;107 nux::ObjectPtr<nux::BaseTexture> _panel_sheen;
106 nux::HLayout* _layout;108 nux::HLayout* _layout;
107109
110 nux::ObjectPtr <nux::BaseTexture> _bg_refine_tex;
111 nux::ObjectPtr <nux::BaseTexture> _bg_refine_no_refine_tex;
112
113 std::unique_ptr<nux::AbstractPaintLayer> _bg_refine_layer;
114 nux::ObjectPtr <nux::BaseTexture> _bg_refine_single_column_tex;
115 std::unique_ptr<nux::AbstractPaintLayer> _bg_refine_single_column_layer;
108 nux::Geometry _last_geo;116 nux::Geometry _last_geo;
109117
110 nux::Color _bg_color;118 nux::Color _bg_color;
@@ -115,6 +123,9 @@
115 bool _overlay_is_open;123 bool _overlay_is_open;
116 float _opacity;124 float _opacity;
117 int _monitor;125 int _monitor;
126 int _stored_dash_width;
127 int _launcher_width;
128 bool _refine_is_open;
118129
119 std::string _active_overlay;130 std::string _active_overlay;
120131
121132
=== modified file 'panel/StandalonePanel.cpp'
--- panel/StandalonePanel.cpp 2012-08-15 02:51:33 +0000
+++ panel/StandalonePanel.cpp 2012-09-14 12:02:19 +0000
@@ -18,11 +18,12 @@
18 *18 *
19 */19 */
2020
21#include "Nux/Nux.h"21#include <Nux/Nux.h>
22#include "Nux/VLayout.h"22#include <Nux/VLayout.h>
23#include "Nux/HLayout.h"23#include <Nux/HLayout.h>
24#include "Nux/WindowThread.h"24#include <Nux/WindowThread.h>
25#include "NuxGraphics/GraphicsEngine.h"25#include <NuxGraphics/GraphicsEngine.h>
26#include <NuxCore/Logger.h>
26#include <gtk/gtk.h>27#include <gtk/gtk.h>
2728
28#include "unity-shared/UnitySettings.h"29#include "unity-shared/UnitySettings.h"
@@ -47,7 +48,8 @@
47 g_type_init();48 g_type_init();
48 gtk_init(&argc, &argv);49 gtk_init(&argc, &argv);
49 nux::NuxInitialize(0);50 nux::NuxInitialize(0);
5051 nux::logging::configure_logging(::getenv("UNITY_LOG_SEVERITY"));
52
51 // The instances for the pseudo-singletons.53 // The instances for the pseudo-singletons.
52 unity::Settings settings;54 unity::Settings settings;
53 unity::panel::Style panel_style;55 unity::panel::Style panel_style;
5456
=== added file 'plugins/unityshell/resources/category_gradient.png'
55Binary 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 differ57Binary 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
=== added file 'plugins/unityshell/resources/category_gradient_no_refine.png'
56Binary 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 differ58Binary 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
=== added file 'plugins/unityshell/resources/refine_gradient.png'
57Binary 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 differ59Binary 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
=== added file 'plugins/unityshell/resources/refine_gradient_corner.png'
58Binary 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 differ60Binary 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
=== added file 'plugins/unityshell/resources/refine_gradient_dash.png'
59Binary 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 differ61Binary 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
=== added file 'plugins/unityshell/resources/refine_gradient_dash_no_refine.png'
60Binary 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 differ62Binary 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
=== added file 'plugins/unityshell/resources/refine_gradient_no_refine_dash.png'
61Binary 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 differ63Binary 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
=== added file 'plugins/unityshell/resources/refine_gradient_panel.png'
62Binary 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 differ64Binary 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
=== added file 'plugins/unityshell/resources/refine_gradient_panel_no_refine.png'
63Binary 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 differ65Binary 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
=== added file 'plugins/unityshell/resources/refine_gradient_panel_single_column.png'
64Binary 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 differ66Binary 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
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2012-09-12 18:00:22 +0000
+++ plugins/unityshell/src/unityshell.cpp 2012-09-14 12:02:19 +0000
@@ -2783,6 +2783,7 @@
2783 * that must not be considered when drawing an overlay */2783 * that must not be considered when drawing an overlay */
2784 hud_controller_->launcher_width = launcher_controller_->launcher().GetAbsoluteWidth() - 1;2784 hud_controller_->launcher_width = launcher_controller_->launcher().GetAbsoluteWidth() - 1;
2785 dash_controller_->launcher_width = launcher_controller_->launcher().GetAbsoluteWidth() - 1;2785 dash_controller_->launcher_width = launcher_controller_->launcher().GetAbsoluteWidth() - 1;
2786 panel_controller_->launcher_width = launcher_controller_->launcher().GetAbsoluteWidth() - 1;
27862787
2787 if (p)2788 if (p)
2788 {2789 {
27892790
=== modified file 'unity-shared/DashStyle.cpp'
--- unity-shared/DashStyle.cpp 2012-09-11 13:44:47 +0000
+++ unity-shared/DashStyle.cpp 2012-09-14 12:02:19 +0000
@@ -196,6 +196,8 @@
196 int text_height_;196 int text_height_;
197 int number_of_columns_;197 int number_of_columns_;
198198
199 LazyLoadTexture category_texture_;
200 LazyLoadTexture category_texture_no_filters_;
199 LazyLoadTexture dash_bottom_texture_;201 LazyLoadTexture dash_bottom_texture_;
200 LazyLoadTexture dash_bottom_texture_mask_;202 LazyLoadTexture dash_bottom_texture_mask_;
201 LazyLoadTexture dash_right_texture_;203 LazyLoadTexture dash_right_texture_;
@@ -218,6 +220,11 @@
218 LazyLoadTexture search_close_texture_;220 LazyLoadTexture search_close_texture_;
219 LazyLoadTexture search_spin_texture_;221 LazyLoadTexture search_spin_texture_;
220222
223
224 LazyLoadTexture refine_gradient_corner_;
225 LazyLoadTexture refine_gradient_dash_;
226 LazyLoadTexture refine_gradient_no_refine_dash_;
227
221 LazyLoadTexture group_unexpand_texture_;228 LazyLoadTexture group_unexpand_texture_;
222 LazyLoadTexture group_expand_texture_;229 LazyLoadTexture group_expand_texture_;
223230
@@ -239,6 +246,8 @@
239 , text_width_(0)246 , text_width_(0)
240 , text_height_(0)247 , text_height_(0)
241 , number_of_columns_(6)248 , number_of_columns_(6)
249 , category_texture_("/category_gradient.png")
250 , category_texture_no_filters_("/category_gradient_no_refine.png")
242 , dash_bottom_texture_("/dash_bottom_border_tile.png")251 , dash_bottom_texture_("/dash_bottom_border_tile.png")
243 , dash_bottom_texture_mask_("/dash_bottom_border_tile_mask.png")252 , dash_bottom_texture_mask_("/dash_bottom_border_tile_mask.png")
244 , dash_right_texture_("/dash_right_border_tile.png")253 , dash_right_texture_("/dash_right_border_tile.png")
@@ -258,6 +267,9 @@
258 , search_circle_texture_("/search_circle.svg", 32)267 , search_circle_texture_("/search_circle.svg", 32)
259 , search_close_texture_("/search_close.svg", 32)268 , search_close_texture_("/search_close.svg", 32)
260 , search_spin_texture_("/search_spin.svg", 32)269 , search_spin_texture_("/search_spin.svg", 32)
270 , refine_gradient_corner_("/refine_gradient_corner.png")
271 , refine_gradient_dash_("/refine_gradient_dash.png")
272 , refine_gradient_no_refine_dash_("/refine_gradient_dash_no_refine.png")
261 , group_unexpand_texture_("/dash_group_unexpand.png")273 , group_unexpand_texture_("/dash_group_unexpand.png")
262 , group_expand_texture_("/dash_group_expand.png")274 , group_expand_texture_("/dash_group_expand.png")
263 , star_deselected_texture_("/star_deselected.png")275 , star_deselected_texture_("/star_deselected.png")
@@ -2096,6 +2108,16 @@
2096}2108}
20972109
20982110
2111nux::BaseTexture* Style::GetCategoryBackground()
2112{
2113 return pimpl->category_texture_.texture();
2114}
2115
2116nux::BaseTexture* Style::GetCategoryBackgroundNoFilters()
2117{
2118 return pimpl->category_texture_no_filters_.texture();
2119}
2120
2099nux::BaseTexture* Style::GetDashBottomTile()2121nux::BaseTexture* Style::GetDashBottomTile()
2100{2122{
2101 return pimpl->dash_bottom_texture_.texture();2123 return pimpl->dash_bottom_texture_.texture();
@@ -2186,6 +2208,21 @@
2186 return pimpl->search_spin_texture_.texture();2208 return pimpl->search_spin_texture_.texture();
2187}2209}
21882210
2211nux::BaseTexture* Style::GetRefineTextureCorner()
2212{
2213 return pimpl->refine_gradient_corner_.texture();
2214}
2215
2216nux::BaseTexture* Style::GetRefineNoRefineTextureDash()
2217{
2218 return pimpl->refine_gradient_no_refine_dash_.texture();
2219}
2220
2221nux::BaseTexture* Style::GetRefineTextureDash()
2222{
2223 return pimpl->refine_gradient_dash_.texture();
2224}
2225
2189nux::BaseTexture* Style::GetGroupUnexpandIcon()2226nux::BaseTexture* Style::GetGroupUnexpandIcon()
2190{2227{
2191 return pimpl->group_unexpand_texture_.texture();2228 return pimpl->group_unexpand_texture_.texture();
21922229
=== modified file 'unity-shared/DashStyle.h'
--- unity-shared/DashStyle.h 2012-09-11 13:44:47 +0000
+++ unity-shared/DashStyle.h 2012-09-14 12:02:19 +0000
@@ -168,6 +168,8 @@
168168
169 int GetTextLineHeight() const;169 int GetTextLineHeight() const;
170170
171 nux::BaseTexture* GetCategoryBackground();
172 nux::BaseTexture* GetCategoryBackgroundNoFilters();
171 nux::BaseTexture* GetDashBottomTile();173 nux::BaseTexture* GetDashBottomTile();
172 nux::BaseTexture* GetDashBottomTileMask();174 nux::BaseTexture* GetDashBottomTileMask();
173 nux::BaseTexture* GetDashRightTile();175 nux::BaseTexture* GetDashRightTile();
@@ -199,7 +201,11 @@
199 nux::BaseTexture* GetStarDeselectedIcon();201 nux::BaseTexture* GetStarDeselectedIcon();
200 nux::BaseTexture* GetStarSelectedIcon();202 nux::BaseTexture* GetStarSelectedIcon();
201 nux::BaseTexture* GetStarHighlightIcon();203 nux::BaseTexture* GetStarHighlightIcon();
202204
205 nux::BaseTexture* GetRefineTextureCorner();
206 nux::BaseTexture* GetRefineTextureDash();
207 nux::BaseTexture* GetRefineNoRefineTextureDash();
208
203 // Returns the width of the separator between the dash and the launcher.209 // Returns the width of the separator between the dash and the launcher.
204 int GetVSeparatorSize() const;210 int GetVSeparatorSize() const;
205211
@@ -209,6 +215,7 @@
209 // Practically it is the space between the top border of the dash and the searchbar.215 // Practically it is the space between the top border of the dash and the searchbar.
210 int GetDashViewTopPadding() const;216 int GetDashViewTopPadding() const;
211217
218
212 // Search bar219 // Search bar
213 int GetSearchBarLeftPadding() const;220 int GetSearchBarLeftPadding() const;
214 int GetSearchBarRightPadding() const;221 int GetSearchBarRightPadding() const;
215222
=== modified file 'unity-shared/OverlayRenderer.cpp'
--- unity-shared/OverlayRenderer.cpp 2012-05-22 10:15:47 +0000
+++ unity-shared/OverlayRenderer.cpp 2012-09-14 12:02:19 +0000
@@ -64,10 +64,19 @@
64 nux::ObjectPtr <nux::IOpenGLBaseTexture> bg_blur_texture_;64 nux::ObjectPtr <nux::IOpenGLBaseTexture> bg_blur_texture_;
65 nux::ObjectPtr <nux::IOpenGLBaseTexture> bg_shine_texture_;65 nux::ObjectPtr <nux::IOpenGLBaseTexture> bg_shine_texture_;
6666
67
68 nux::ObjectPtr<nux::BaseTexture> bg_refine_tex_;
69 nux::ObjectPtr<nux::BaseTexture> bg_refine_no_refine_tex_;
70 nux::ObjectPtr<nux::BaseTexture> bg_refine_corner_tex_;
71 std::unique_ptr<nux::AbstractPaintLayer> bg_refine_gradient_;
72 std::unique_ptr<nux::AbstractPaintLayer> bg_refine_gradient_corner_;
73
67 // temporary variable that stores the number of backgrounds we have rendered74 // temporary variable that stores the number of backgrounds we have rendered
68 int bgs;75 int bgs;
69 bool visible;76 bool visible;
7077
78 bool refine_is_open_;
79
71 UBusManager ubus_manager_;80 UBusManager ubus_manager_;
7281
73 OverlayRenderer *parent;82 OverlayRenderer *parent;
@@ -107,16 +116,67 @@
107 rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;116 rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
108 bg_layer_ = new nux::ColorLayer(nux::Color(0.0f, 0.0f, 0.0f, 0.9), true, rop);117 bg_layer_ = new nux::ColorLayer(nux::Color(0.0f, 0.0f, 0.0f, 0.9), true, rop);
109118
119 nux::TexCoordXForm texxform;
120 bg_refine_tex_ = unity::dash::Style::Instance().GetRefineTextureDash();
121 bg_refine_no_refine_tex_ = unity::dash::Style::Instance().GetRefineNoRefineTextureDash();
122
123 bg_refine_gradient_.reset(new nux::TextureLayer(bg_refine_tex_->GetDeviceTexture(),
124 texxform,
125 nux::color::White,
126 false,
127 rop));
128
129 bg_refine_corner_tex_ = unity::dash::Style::Instance().GetRefineTextureCorner();
130
131 bg_refine_gradient_corner_.reset(new nux::TextureLayer(bg_refine_corner_tex_->GetDeviceTexture(),
132 texxform,
133 nux::color::White,
134 false,
135 rop));
136
137 ubus_manager_.RegisterInterest(UBUS_BACKGROUND_COLOR_CHANGED,
138 sigc::mem_fun(this, &OverlayRendererImpl::OnBackgroundColorChanged));
139
110 rop.Blend = true;140 rop.Blend = true;
111 rop.SrcBlend = GL_ZERO;141 rop.SrcBlend = GL_ZERO;
112 rop.DstBlend = GL_SRC_COLOR;142 rop.DstBlend = GL_SRC_COLOR;
113 bg_darken_layer_ = new nux::ColorLayer(nux::Color(0.9f, 0.9f, 0.9f, 1.0f), false, rop);143 bg_darken_layer_ = new nux::ColorLayer(nux::Color(0.9f, 0.9f, 0.9f, 1.0f), false, rop);
114 bg_shine_texture_ = unity::dash::Style::Instance().GetDashShine()->GetDeviceTexture();144 bg_shine_texture_ = unity::dash::Style::Instance().GetDashShine()->GetDeviceTexture();
115145
116 ubus_manager_.RegisterInterest(UBUS_BACKGROUND_COLOR_CHANGED,
117 sigc::mem_fun(this, &OverlayRendererImpl::OnBackgroundColorChanged));
118
119 ubus_manager_.SendMessage(UBUS_BACKGROUND_REQUEST_COLOUR_EMIT);146 ubus_manager_.SendMessage(UBUS_BACKGROUND_REQUEST_COLOUR_EMIT);
147
148 ubus_manager_.RegisterInterest(UBUS_REFINE_STATUS, [this] (GVariant *data)
149 {
150 gboolean status;
151 g_variant_get(data, UBUS_REFINE_STATUS_FORMAT_STRING, &status);
152
153 refine_is_open_ = status;
154 nux::ROPConfig rop;
155 rop.Blend = true;
156 rop.SrcBlend = GL_ONE;
157 rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
158
159 nux::TexCoordXForm texxform;
160
161 if (refine_is_open_)
162 {
163 bg_refine_gradient_.reset(new nux::TextureLayer(bg_refine_tex_->GetDeviceTexture(),
164 texxform,
165 nux::color::White,
166 false,
167 rop));
168 }
169 else
170 {
171 bg_refine_gradient_.reset(new nux::TextureLayer(bg_refine_no_refine_tex_->GetDeviceTexture(),
172 texxform,
173 nux::color::White,
174 false,
175 rop));
176 }
177
178 parent->need_redraw.emit();
179 });
120}180}
121181
122void OverlayRendererImpl::OnBackgroundColorChanged(GVariant* args)182void OverlayRendererImpl::OnBackgroundColorChanged(GVariant* args)
@@ -442,9 +502,7 @@
442 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);502 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
443503
444 const double line_opacity = 0.1f;504 const double line_opacity = 0.1f;
445 const int gradient_width = 130;
446 const int gradient_height = 50;505 const int gradient_height = 50;
447 const int horizontal_padding = 40;
448 const int vertical_padding = 20;506 const int vertical_padding = 20;
449507
450 // Now that we mask the corners of the dash,508 // Now that we mask the corners of the dash,
@@ -470,23 +528,6 @@
470 geometry.y + content_geo.height + INNER_CORNER_RADIUS + corner_overlap,528 geometry.y + content_geo.height + INNER_CORNER_RADIUS + corner_overlap,
471 line_color * 0.7f); // less opacity529 line_color * 0.7f); // less opacity
472530
473 // Horizontal panel/dash separator
474 nux::GetPainter().Paint2DQuadColor(gfx_context,
475 nux::Geometry(geometry.x + horizontal_padding,
476 geometry.y,
477 gradient_width,
478 style.GetHSeparatorSize()),
479 nux::color::Transparent,
480 nux::color::Transparent,
481 line_color,
482 line_color);
483 nux::GetPainter().Draw2DLine(gfx_context,
484 geometry.x + horizontal_padding + gradient_width,
485 geometry.y,
486 geometry.x + content_geo.width + INNER_CORNER_RADIUS + corner_overlap,
487 style.GetHSeparatorSize(),
488 line_color);
489
490 // Draw the background531 // Draw the background
491 bg_darken_layer_->SetGeometry(larger_content_geo);532 bg_darken_layer_->SetGeometry(larger_content_geo);
492 nux::GetPainter().RenderSinglePaintLayer(gfx_context, larger_content_geo, bg_darken_layer_);533 nux::GetPainter().RenderSinglePaintLayer(gfx_context, larger_content_geo, bg_darken_layer_);
@@ -510,6 +551,33 @@
510 larger_content_geo.width, larger_content_geo.height,551 larger_content_geo.width, larger_content_geo.height,
511 bg_shine_texture_, texxform_absolute_bg, nux::color::White);552 bg_shine_texture_, texxform_absolute_bg, nux::color::White);
512553
554 gfx_context.GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
555 nux::TexCoordXForm refine_texxform;
556
557 if (refine_is_open_)
558 {
559 gfx_context.QRP_1Tex(larger_content_geo.x + larger_content_geo.width - bg_refine_tex_->GetWidth(),
560 larger_content_geo.y,
561 bg_refine_tex_->GetWidth(),
562 std::min(bg_refine_tex_->GetHeight(), larger_content_geo.height),
563 bg_refine_tex_->GetDeviceTexture(),
564 refine_texxform,
565 nux::color::White
566 );
567 }
568 else
569 {
570 gfx_context.QRP_1Tex(larger_content_geo.x + larger_content_geo.width - bg_refine_no_refine_tex_->GetWidth(),
571 larger_content_geo.y,
572 bg_refine_no_refine_tex_->GetWidth(),
573 std::min(bg_refine_no_refine_tex_->GetHeight(), larger_content_geo.height),
574 bg_refine_no_refine_tex_->GetDeviceTexture(),
575 refine_texxform,
576 nux::color::White
577 );
578 }
579
580
513 if (Settings::Instance().GetFormFactor() != FormFactor::NETBOOK || force_edges)581 if (Settings::Instance().GetFormFactor() != FormFactor::NETBOOK || force_edges)
514 {582 {
515 // Paint the edges583 // Paint the edges
@@ -850,6 +918,24 @@
850 false,918 false,
851 rop);919 rop);
852 bgs++;920 bgs++;
921
922 nux::Geometry refine_geo = larger_content_geo;
923
924 if (refine_is_open_)
925 {
926 refine_geo.x += larger_content_geo.width - bg_refine_tex_->GetWidth();
927 refine_geo.width = bg_refine_tex_->GetWidth();
928 refine_geo.height = bg_refine_tex_->GetHeight();
929 }
930 else
931 {
932 refine_geo.x += larger_content_geo.width - bg_refine_no_refine_tex_->GetWidth();
933 refine_geo.width = bg_refine_no_refine_tex_->GetWidth();
934 refine_geo.height = bg_refine_no_refine_tex_->GetHeight();
935 }
936
937 nux::GetPainter().PushLayer(gfx_context, refine_geo, bg_refine_gradient_.get());
938 bgs++;
853}939}
854940
855void OverlayRendererImpl::DrawContentCleanup(nux::GraphicsEngine& gfx_context, nux::Geometry content_geo, nux::Geometry absolute_geo, nux::Geometry geometry)941void OverlayRendererImpl::DrawContentCleanup(nux::GraphicsEngine& gfx_context, nux::Geometry content_geo, nux::Geometry absolute_geo, nux::Geometry geometry)
856942
=== modified file 'unity-shared/UBusMessages.h'
--- unity-shared/UBusMessages.h 2012-08-27 03:00:42 +0000
+++ unity-shared/UBusMessages.h 2012-09-14 12:02:19 +0000
@@ -40,6 +40,9 @@
40#define UBUS_OVERLAY_HIDDEN "OVERLAY_HIDDEN"40#define UBUS_OVERLAY_HIDDEN "OVERLAY_HIDDEN"
41#define UBUS_OVERLAY_SHOWN "OVERLAY_SHOWN"41#define UBUS_OVERLAY_SHOWN "OVERLAY_SHOWN"
4242
43#define UBUS_REFINE_STATUS_FORMAT_STRING "(b)"
44#define UBUS_REFINE_STATUS "REFINE_STATUS"
45
43#define UBUS_PLACE_VIEW_QUEUE_DRAW "PLACE_VIEW_QUEUE_DRAW"46#define UBUS_PLACE_VIEW_QUEUE_DRAW "PLACE_VIEW_QUEUE_DRAW"
4447
45// Signal send by Launcher/Quicklist when it wants to exit key-nav and wants to48// Signal send by Launcher/Quicklist when it wants to exit key-nav and wants to
4649
=== modified file 'unity-standalone/StandaloneUnity.cpp'
--- unity-standalone/StandaloneUnity.cpp 2012-07-27 20:20:29 +0000
+++ unity-standalone/StandaloneUnity.cpp 2012-09-14 12:02:19 +0000
@@ -45,7 +45,7 @@
4545
46namespace46namespace
47{47{
48 static int display_width = 1280;48 static int display_width = 1200;
49 static int display_height = 720;49 static int display_height = 720;
50 static gboolean no_window_decorations = FALSE;50 static gboolean no_window_decorations = FALSE;
51 static gboolean force_tv = FALSE;51 static gboolean force_tv = FALSE;
@@ -89,7 +89,9 @@
89 launcher_controller.reset(new launcher::Controller(0));89 launcher_controller.reset(new launcher::Controller(0));
90 panel_controller.reset(new panel::Controller());90 panel_controller.reset(new panel::Controller());
91 dash_controller.reset(new dash::Controller());91 dash_controller.reset(new dash::Controller());
92
92 dash_controller->launcher_width = launcher_controller->launcher().GetAbsoluteWidth() - 1;93 dash_controller->launcher_width = launcher_controller->launcher().GetAbsoluteWidth() - 1;
94 panel_controller->launcher_width = launcher_controller->launcher().GetAbsoluteWidth() - 1;
93}95}
9496
95void UnityStandalone::InitWindowThread(nux::NThread* thread, void* InitData)97void UnityStandalone::InitWindowThread(nux::NThread* thread, void* InitData)