=== 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 @@
AddChild(filter_view);
filter_map_[filter] = filter_view;
GetLayout()->AddView(filter_view, 0, nux::MINOR_POSITION_LEFT, nux::MINOR_SIZE_FULL);
-
- UpdateDrawSeparators();
}
void FilterBar::RemoveFilter(Filter::Ptr const& filter)
@@ -99,8 +97,6 @@
break;
}
}
-
- UpdateDrawSeparators();
}
void FilterBar::Draw(nux::GraphicsEngine& GfxContext, bool force_draw)
@@ -120,24 +116,6 @@
GfxContext.PopClippingRectangle();
}
-void FilterBar::UpdateDrawSeparators()
-{
- std::list children = GetLayout()->GetChildren();
- std::list::reverse_iterator rit;
- bool found_one = false;
-
- for (rit = children.rbegin(); rit != children.rend(); ++rit)
- {
- FilterExpanderLabel* widget = dynamic_cast(*rit);
-
- if (!widget)
- continue;
-
- widget->draw_separator = found_one;
- found_one = true;
- }
-}
-
//
// Key navigation
//
=== 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 @@
private:
void Init();
- void UpdateDrawSeparators();
FilterFactory factory_;
Filters::Ptr filters_;
=== 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 @@
lens_->connected.changed.connect([&](bool is_connected) { if (is_connected) initial_activation_ = true; });
lens_->categories_reordered.connect(sigc::mem_fun(this, &LensView::OnCategoryOrderChanged));
search_string.SetGetterFunction(sigc::mem_fun(this, &LensView::get_search_string));
- filters_expanded.changed.connect([&](bool expanded) { fscroll_view_->SetVisible(expanded); QueueRelayout(); OnColumnsChanged(); });
+ filters_expanded.changed.connect([&](bool expanded)
+ {
+ fscroll_view_->SetVisible(expanded);
+ QueueRelayout();
+ OnColumnsChanged();
+ ubus_manager_.SendMessage(UBUS_REFINE_STATUS,
+ g_variant_new(UBUS_REFINE_STATUS_FORMAT_STRING, expanded ? TRUE : FALSE));
+ });
view_type.changed.connect(sigc::mem_fun(this, &LensView::OnViewTypeChanged));
ubus_manager_.RegisterInterest(UBUS_RESULT_VIEW_KEYNAV_CHANGED, [&] (GVariant* data) {
@@ -189,10 +196,15 @@
scroll_view_ = new LensScrollView(new PlacesVScrollBar(NUX_TRACKER_LOCATION),
NUX_TRACKER_LOCATION);
- scroll_view_->EnableVerticalScrollBar(true);
+ scroll_view_->EnableVerticalScrollBar(false);
scroll_view_->EnableHorizontalScrollBar(false);
layout_->AddView(scroll_view_);
+ scroll_view_->OnGeometryChanged.connect([this] (nux::Area *area, nux::Geometry& geo)
+ {
+ CheckScrollBarState();
+ });
+
scroll_layout_ = new nux::VLayout(NUX_TRACKER_LOCATION);
scroll_view_->SetLayout(scroll_layout_);
scroll_view_->SetRightArea(show_filters);
@@ -388,6 +400,8 @@
scroll_layout_->AddView(group, 0, nux::MinorDimensionPosition::eAbove,
nux::MinorDimensionSize::eFull, 100.0f,
(nux::LayoutPosition)index);
+
+ group->SetMinimumWidth(GetGeometry().width);
}
void LensView::OnCategoryOrderChanged()
@@ -624,6 +638,20 @@
ResultViewGrid* grid = static_cast(group->GetChildView());
grid->expanded = group->GetExpanded();
ubus_manager_.SendMessage(UBUS_PLACE_VIEW_QUEUE_DRAW);
+
+ CheckScrollBarState();
+}
+
+void LensView::CheckScrollBarState()
+{
+ if (scroll_layout_->GetGeometry().height > scroll_view_->GetGeometry().height)
+ {
+ scroll_view_->EnableVerticalScrollBar(true);
+ }
+ else
+ {
+ scroll_view_->EnableVerticalScrollBar(false);
+ }
}
void LensView::OnColumnsChanged()
=== 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 @@
void OnResultRemoved(Result const& result);
void UpdateCounts(PlacesGroup* group);
void OnGroupExpanded(PlacesGroup* group);
+ void CheckScrollBarState();
void OnColumnsChanged();
void OnFilterAdded(Filter::Ptr filter);
void OnFilterRemoved(Filter::Ptr filter);
=== 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 @@
PlacesGroup::PlacesGroup()
: AbstractPlacesGroup(),
_child_view(nullptr),
- _is_expanded(true),
+ _is_expanded(false),
_n_visible_items_in_unexpand_mode(0),
_n_total_items(0),
_category_index(0),
@@ -128,6 +128,21 @@
SetAcceptKeyNavFocusOnMouseEnter(false);
nux::BaseTexture* arrow = style.GetGroupUnexpandIcon();
+
+ _background = style.GetCategoryBackground();
+ _background_nofilters = style.GetCategoryBackgroundNoFilters();
+
+ nux::ROPConfig rop;
+ rop.Blend = true;
+ rop.SrcBlend = GL_ONE;
+ rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
+
+ nux::TexCoordXForm texxform;
+ _background_layer.reset(new nux::TextureLayer(_background_nofilters->GetDeviceTexture(),
+ texxform,
+ nux::color::White,
+ false,
+ rop));
_group_layout = new nux::VLayout("", NUX_TRACKER_LOCATION);
@@ -177,15 +192,6 @@
_expand_icon->SetVisible(false);
_expand_layout->AddView(_expand_icon, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FIX);
- separator_layout_ = new nux::HLayout();
- separator_layout_->SetLeftAndRightPadding(style.GetCategorySeparatorLeftPadding(),
- style.GetCategorySeparatorRightPadding() - style.GetScrollbarWidth());
-
- separator_ = new HSeparator;
- separator_layout_->AddView(separator_, 1);
-
- draw_separator.changed.connect(sigc::mem_fun(this, &PlacesGroup::DrawSeparatorChanged));
-
SetLayout(_group_layout);
// don't need to disconnect these signals as they are disconnected when this object destroys the contents
@@ -207,15 +213,40 @@
else
nux::GetWindowCompositor().SetKeyFocusArea(GetHeaderFocusableView(), direction);
});
-}
-
-void PlacesGroup::DrawSeparatorChanged(bool draw)
-{
- if (draw and !separator_layout_->IsChildOf(_group_layout))
- _group_layout->AddView(separator_layout_.GetPointer(), 0);
- else if (!draw and separator_layout_->IsChildOf(_group_layout))
- _group_layout->RemoveChildObject(separator_layout_.GetPointer());
- QueueDraw();
+
+ _ubus.RegisterInterest(UBUS_REFINE_STATUS, [this] (GVariant *data)
+ {
+ gboolean status;
+ g_variant_get(data, UBUS_REFINE_STATUS_FORMAT_STRING, &status);
+
+ nux::ROPConfig rop;
+ rop.Blend = true;
+ rop.SrcBlend = GL_ONE;
+ rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
+
+ nux::TexCoordXForm texxform;
+ if (status && _using_nofilters_background)
+ {
+ _background_layer.reset(new nux::TextureLayer(_background->GetDeviceTexture(),
+ texxform,
+ nux::color::White,
+ false,
+ rop));
+ _using_nofilters_background = false;
+ }
+ else if (!status && !_using_nofilters_background)
+ {
+ _background_layer.reset(new nux::TextureLayer(_background_nofilters->GetDeviceTexture(),
+ texxform,
+ nux::color::White,
+ false,
+ rop));
+
+ _using_nofilters_background = true;
+ }
+ QueueDraw();
+ });
+
}
void
@@ -253,7 +284,7 @@
if (g_strcmp0(renderer_name, "tile-horizontal") == 0)
(static_cast(_child_view))->SetModelRenderer(new dash::ResultRendererHorizontalTile(NUX_TRACKER_LOCATION));
- else
+ else if (g_strcmp0(renderer_name, "tile-vertical") == 0)
(static_cast(_child_view))->SetModelRenderer(new dash::ResultRendererTile(NUX_TRACKER_LOCATION));
}
@@ -396,6 +427,8 @@
{
if (GetChildView())
{
+
+
Refresh();
QueueDraw();
_group_layout->QueueDraw();
@@ -417,10 +450,8 @@
if (_cached_geometry.GetWidth() != geo.GetWidth())
{
_focus_layer.reset(dash::Style::Instance().FocusOverlay(geo.width - kHighlightLeftPadding - kHighlightRightPadding, kHighlightHeight));
-
_cached_geometry = geo;
}
-
return ret;
}
@@ -430,6 +461,7 @@
nux::Geometry const& base = GetGeometry();
graphics_engine.PushClippingRectangle(base);
+
if (ShouldBeHighlighted())
{
nux::Geometry geo(_header_layout->GetGeometry());
@@ -440,6 +472,20 @@
_focus_layer->Renderlayer(graphics_engine);
}
+ nux::Geometry bg_geo = GetGeometry();
+ int bg_width = 0;
+ if (_using_nofilters_background)
+ bg_width = _background_nofilters->GetWidth();
+ else
+ bg_width = _background->GetWidth();
+
+ bg_geo.x = std::max(bg_geo.width - bg_width,0);
+
+ bg_geo.width = std::min(bg_width, bg_geo.GetWidth()) + 1; // to render into a space left over by the scrollview
+ bg_geo.height = _background->GetHeight();
+
+ _background_layer->SetGeometry(bg_geo);
+ _background_layer->Renderlayer(graphics_engine);
graphics_engine.PopClippingRectangle();
}
@@ -449,7 +495,24 @@
nux::Geometry const& base = GetGeometry();
graphics_engine.PushClippingRectangle(base);
+ nux::Geometry bg_geo = GetGeometry();
+
+ int bg_width = 0;
+ if (_using_nofilters_background)
+ bg_width = _background_nofilters->GetWidth();
+ else
+ bg_width = _background->GetWidth();
+
+ // if the dash is smaller, resize to fit, otherwise move to the right edge
+ bg_geo.x = std::max(bg_geo.width - bg_width, 0);
+ bg_geo.width = std::min(bg_width, bg_geo.GetWidth()) + 1; // to render into a space left over by the scrollview
+
+ bg_geo.height = _background->GetHeight();
+ if (!IsFullRedraw())
+ {
+ nux::GetPainter().PushLayer(graphics_engine, bg_geo, _background_layer.get());
+ }
if (ShouldBeHighlighted() && !IsFullRedraw() && _focus_layer)
{
nux::GetPainter().PushLayer(graphics_engine, _focus_layer->GetGeometry(), _focus_layer.get());
=== 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 @@
nux::HLayout* _expand_label_layout;
nux::HLayout* _expand_layout;
nux::View* _child_view;
- nux::ObjectPtr separator_layout_;
- HSeparator* separator_;
std::unique_ptr _focus_layer;
IconTexture* _icon;
@@ -132,12 +130,16 @@
nux::StaticCairoText* _expand_label;
IconTexture* _expand_icon;
+ nux::BaseTexture* _background;
+ nux::BaseTexture* _background_nofilters;
+ bool _using_nofilters_background;
+ std::unique_ptr _background_layer;
+
bool _is_expanded;
unsigned _n_visible_items_in_unexpand_mode;
unsigned _n_total_items;
unsigned _category_index;
std::string _cached_name;
- bool _draw_sep;
nux::Geometry _cached_geometry;
std::string _renderer_name;
=== 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 @@
std::vector GetGeometries() const;
// NOTE: nux::Property maybe?
+ void SetLauncherWidth(int width);
void SetOpacity(float opacity);
void SetOpacityMaximizedToggle(bool enabled);
@@ -147,6 +148,14 @@
}
}
+void Controller::Impl::SetLauncherWidth(int width)
+{
+ for (auto const& window: windows_)
+ {
+ ViewForWindow(window)->SetLauncherWidth(width);
+ }
+}
+
void Controller::Impl::SetOpacityMaximizedToggle(bool enabled)
{
opacity_maximized_toggle_ = enabled;
@@ -297,6 +306,11 @@
UScreen* screen = UScreen::GetDefault();
screen->changed.connect(sigc::mem_fun(this, &Controller::OnScreenChanged));
OnScreenChanged(screen->GetPrimaryMonitor(), screen->GetMonitors());
+
+ launcher_width.changed.connect([&] (int width)
+ {
+ pimpl->SetLauncherWidth(width);
+ });
}
Controller::~Controller()
=== 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 @@
std::vector GetPanelViews() const;
std::vector GetGeometries() const;
+ nux::Property launcher_width;
+
// NOTE: nux::Property maybe?
void SetOpacity(float opacity);
void SetOpacityMaximizedToggle(bool enabled);
=== 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 @@
namespace
{
-nux::logging::Logger logger("unity.PanelView");
+nux::logging::Logger logger("unity.panel.view");
+const int refine_gradient_midpoint = 959;
}
namespace unity
@@ -61,6 +62,8 @@
, _overlay_is_open(false)
, _opacity(1.0f)
, _monitor(0)
+ , _stored_dash_width(0)
+ , _launcher_width(0)
{
panel::Style::Instance().changed.connect(sigc::mem_fun(this, &PanelView::ForceUpdateBackground));
@@ -98,7 +101,47 @@
_ubus_manager.RegisterInterest(UBUS_BACKGROUND_COLOR_CHANGED, sigc::mem_fun(this, &PanelView::OnBackgroundUpdate));
_ubus_manager.RegisterInterest(UBUS_OVERLAY_HIDDEN, sigc::mem_fun(this, &PanelView::OnOverlayHidden));
_ubus_manager.RegisterInterest(UBUS_OVERLAY_SHOWN, sigc::mem_fun(this, &PanelView::OnOverlayShown));
-
+ _ubus_manager.RegisterInterest(UBUS_DASH_SIZE_CHANGED, [&] (GVariant *data)
+ {
+ int width, height;
+ g_variant_get(data, "(ii)", &width, &height);
+ _stored_dash_width = width;
+ QueueDraw();
+ });
+
+ _ubus_manager.RegisterInterest(UBUS_REFINE_STATUS, [this] (GVariant *data)
+ {
+ gboolean status;
+ g_variant_get(data, UBUS_REFINE_STATUS_FORMAT_STRING, &status);
+
+ _refine_is_open = status;
+
+ nux::ROPConfig rop;
+ rop.Blend = true;
+ rop.SrcBlend = GL_ONE;
+ rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
+
+ nux::TexCoordXForm texxform;
+ if (_refine_is_open)
+ {
+ _bg_refine_layer.reset(new nux::TextureLayer(_bg_refine_tex->GetDeviceTexture(),
+ texxform,
+ nux::color::White,
+ false,
+ rop));
+ }
+ else
+ {
+ _bg_refine_layer.reset(new nux::TextureLayer(_bg_refine_no_refine_tex->GetDeviceTexture(),
+ texxform,
+ nux::color::White,
+ false,
+ rop));
+
+ }
+ QueueDraw();
+ });
+
// request the latest colour from bghash
_ubus_manager.SendMessage(UBUS_BACKGROUND_REQUEST_COLOUR_EMIT);
@@ -116,6 +159,61 @@
{
_panel_sheen.Adopt(nux::CreateTexture2DFromPixbuf(pixbuf, true));
}
+
+ //FIXME (gord) like 12 months later, still not async loading!
+ pixbuf = gdk_pixbuf_new_from_file(PKGDATADIR "/refine_gradient_panel.png", &error);
+ if (error)
+ {
+ LOG_WARN(logger) << "Unable to texture " << PKGDATADIR << "/refine_gradient_panel.png";
+ }
+ else
+ {
+ _bg_refine_tex.Adopt(nux::CreateTexture2DFromPixbuf(pixbuf, true));
+ }
+
+ //FIXME (gord) like 12 months later, still not async loading!
+ pixbuf = gdk_pixbuf_new_from_file(PKGDATADIR "/refine_gradient_panel_no_refine.png", &error);
+ if (error)
+ {
+ LOG_WARN(logger) << "Unable to texture " << PKGDATADIR << "/refine_gradient_panel_no_refine.png";
+ }
+ else
+ {
+ _bg_refine_no_refine_tex.Adopt(nux::CreateTexture2DFromPixbuf(pixbuf, true));
+ }
+
+ rop.Blend = true;
+ rop.SrcBlend = GL_ONE;
+ rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
+
+ nux::TexCoordXForm texxform;
+ _bg_refine_layer.reset(new nux::TextureLayer(_bg_refine_tex->GetDeviceTexture(),
+ texxform,
+ nux::color::White,
+ false,
+ rop));
+
+ //FIXME (gord) like 12 months later, still not async loading!
+ pixbuf = gdk_pixbuf_new_from_file(PKGDATADIR "/refine_gradient_panel_single_column.png", &error);
+ if (error)
+ {
+ LOG_WARN(logger) << "Unable to texture " << PKGDATADIR << "/refine_gradient_panel_single_column.png";
+ }
+ else
+ {
+ _bg_refine_single_column_tex.Adopt(nux::CreateTexture2DFromPixbuf(pixbuf, true));
+ }
+
+ rop.Blend = true;
+ rop.SrcBlend = GL_ONE;
+ rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
+
+ _bg_refine_single_column_layer.reset(new nux::TextureLayer(_bg_refine_single_column_tex->GetDeviceTexture(),
+ texxform,
+ nux::color::White,
+ false,
+ rop));
+
}
PanelView::~PanelView()
@@ -138,6 +236,12 @@
return _tray->xid();
}
+void PanelView::SetLauncherWidth(int width)
+{
+ _launcher_width = width;
+ QueueDraw();
+}
+
void PanelView::OnBackgroundUpdate(GVariant *data)
{
gdouble red, green, blue, alpha;
@@ -285,6 +389,28 @@
if (_overlay_is_open)
{
nux::GetPainter().RenderSinglePaintLayer(GfxContext, geo, _bg_darken_layer.get());
+
+ GfxContext.GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ nux::TexCoordXForm refine_texxform;
+
+ int refine_x_pos = geo.x + (_stored_dash_width - refine_gradient_midpoint);
+
+ refine_x_pos += _launcher_width;
+ GfxContext.QRP_1Tex(refine_x_pos,
+ geo.y,
+ _bg_refine_tex->GetWidth(),
+ _bg_refine_tex->GetHeight(),
+ _bg_refine_tex->GetDeviceTexture(),
+ refine_texxform,
+ nux::color::White);
+
+ GfxContext.QRP_1Tex(refine_x_pos + _bg_refine_tex->GetWidth(),
+ geo.y,
+ geo.width,
+ geo.height,
+ _bg_refine_single_column_tex->GetDeviceTexture(),
+ refine_texxform,
+ nux::color::White);
}
}
@@ -360,6 +486,24 @@
{
nux::GetPainter().PushLayer(GfxContext, geo, _bg_darken_layer.get());
bgs++;
+
+ nux::Geometry refine_geo = geo;
+
+ int refine_x_pos = geo.x + (_stored_dash_width - refine_gradient_midpoint);
+ refine_x_pos += _launcher_width;
+
+ refine_geo.x = refine_x_pos;
+ refine_geo.width = _bg_refine_tex->GetWidth();
+ refine_geo.height = _bg_refine_tex->GetHeight();
+
+ nux::GetPainter().PushLayer(GfxContext, refine_geo, _bg_refine_layer.get());
+ bgs++;
+
+ refine_geo.x += refine_geo.width;
+ refine_geo.width = geo.width;
+ refine_geo.height = geo.height;
+ nux::GetPainter().PushLayer(GfxContext, refine_geo, _bg_refine_single_column_layer.get());
+ bgs++;
}
}
=== 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 @@
Window GetTrayXid() const;
+ void SetLauncherWidth(int width);
+
protected:
void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);
@@ -105,6 +107,12 @@
nux::ObjectPtr _panel_sheen;
nux::HLayout* _layout;
+ nux::ObjectPtr _bg_refine_tex;
+ nux::ObjectPtr _bg_refine_no_refine_tex;
+
+ std::unique_ptr _bg_refine_layer;
+ nux::ObjectPtr _bg_refine_single_column_tex;
+ std::unique_ptr _bg_refine_single_column_layer;
nux::Geometry _last_geo;
nux::Color _bg_color;
@@ -115,6 +123,9 @@
bool _overlay_is_open;
float _opacity;
int _monitor;
+ int _stored_dash_width;
+ int _launcher_width;
+ bool _refine_is_open;
std::string _active_overlay;
=== 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 @@
*
*/
-#include "Nux/Nux.h"
-#include "Nux/VLayout.h"
-#include "Nux/HLayout.h"
-#include "Nux/WindowThread.h"
-#include "NuxGraphics/GraphicsEngine.h"
+#include
+#include
+#include
+#include
+#include
+#include
#include
#include "unity-shared/UnitySettings.h"
@@ -47,7 +48,8 @@
g_type_init();
gtk_init(&argc, &argv);
nux::NuxInitialize(0);
-
+ nux::logging::configure_logging(::getenv("UNITY_LOG_SEVERITY"));
+
// The instances for the pseudo-singletons.
unity::Settings settings;
unity::panel::Style panel_style;
=== added file 'plugins/unityshell/resources/category_gradient.png'
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
=== added file 'plugins/unityshell/resources/category_gradient_no_refine.png'
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
=== added file 'plugins/unityshell/resources/refine_gradient.png'
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
=== added file 'plugins/unityshell/resources/refine_gradient_corner.png'
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
=== added file 'plugins/unityshell/resources/refine_gradient_dash.png'
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
=== added file 'plugins/unityshell/resources/refine_gradient_dash_no_refine.png'
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
=== added file 'plugins/unityshell/resources/refine_gradient_no_refine_dash.png'
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
=== added file 'plugins/unityshell/resources/refine_gradient_panel.png'
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
=== added file 'plugins/unityshell/resources/refine_gradient_panel_no_refine.png'
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
=== added file 'plugins/unityshell/resources/refine_gradient_panel_single_column.png'
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
=== 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 @@
* that must not be considered when drawing an overlay */
hud_controller_->launcher_width = launcher_controller_->launcher().GetAbsoluteWidth() - 1;
dash_controller_->launcher_width = launcher_controller_->launcher().GetAbsoluteWidth() - 1;
+ panel_controller_->launcher_width = launcher_controller_->launcher().GetAbsoluteWidth() - 1;
if (p)
{
=== 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 @@
int text_height_;
int number_of_columns_;
+ LazyLoadTexture category_texture_;
+ LazyLoadTexture category_texture_no_filters_;
LazyLoadTexture dash_bottom_texture_;
LazyLoadTexture dash_bottom_texture_mask_;
LazyLoadTexture dash_right_texture_;
@@ -218,6 +220,11 @@
LazyLoadTexture search_close_texture_;
LazyLoadTexture search_spin_texture_;
+
+ LazyLoadTexture refine_gradient_corner_;
+ LazyLoadTexture refine_gradient_dash_;
+ LazyLoadTexture refine_gradient_no_refine_dash_;
+
LazyLoadTexture group_unexpand_texture_;
LazyLoadTexture group_expand_texture_;
@@ -239,6 +246,8 @@
, text_width_(0)
, text_height_(0)
, number_of_columns_(6)
+ , category_texture_("/category_gradient.png")
+ , category_texture_no_filters_("/category_gradient_no_refine.png")
, dash_bottom_texture_("/dash_bottom_border_tile.png")
, dash_bottom_texture_mask_("/dash_bottom_border_tile_mask.png")
, dash_right_texture_("/dash_right_border_tile.png")
@@ -258,6 +267,9 @@
, search_circle_texture_("/search_circle.svg", 32)
, search_close_texture_("/search_close.svg", 32)
, search_spin_texture_("/search_spin.svg", 32)
+ , refine_gradient_corner_("/refine_gradient_corner.png")
+ , refine_gradient_dash_("/refine_gradient_dash.png")
+ , refine_gradient_no_refine_dash_("/refine_gradient_dash_no_refine.png")
, group_unexpand_texture_("/dash_group_unexpand.png")
, group_expand_texture_("/dash_group_expand.png")
, star_deselected_texture_("/star_deselected.png")
@@ -2096,6 +2108,16 @@
}
+nux::BaseTexture* Style::GetCategoryBackground()
+{
+ return pimpl->category_texture_.texture();
+}
+
+nux::BaseTexture* Style::GetCategoryBackgroundNoFilters()
+{
+ return pimpl->category_texture_no_filters_.texture();
+}
+
nux::BaseTexture* Style::GetDashBottomTile()
{
return pimpl->dash_bottom_texture_.texture();
@@ -2186,6 +2208,21 @@
return pimpl->search_spin_texture_.texture();
}
+nux::BaseTexture* Style::GetRefineTextureCorner()
+{
+ return pimpl->refine_gradient_corner_.texture();
+}
+
+nux::BaseTexture* Style::GetRefineNoRefineTextureDash()
+{
+ return pimpl->refine_gradient_no_refine_dash_.texture();
+}
+
+nux::BaseTexture* Style::GetRefineTextureDash()
+{
+ return pimpl->refine_gradient_dash_.texture();
+}
+
nux::BaseTexture* Style::GetGroupUnexpandIcon()
{
return pimpl->group_unexpand_texture_.texture();
=== 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 @@
int GetTextLineHeight() const;
+ nux::BaseTexture* GetCategoryBackground();
+ nux::BaseTexture* GetCategoryBackgroundNoFilters();
nux::BaseTexture* GetDashBottomTile();
nux::BaseTexture* GetDashBottomTileMask();
nux::BaseTexture* GetDashRightTile();
@@ -199,7 +201,11 @@
nux::BaseTexture* GetStarDeselectedIcon();
nux::BaseTexture* GetStarSelectedIcon();
nux::BaseTexture* GetStarHighlightIcon();
-
+
+ nux::BaseTexture* GetRefineTextureCorner();
+ nux::BaseTexture* GetRefineTextureDash();
+ nux::BaseTexture* GetRefineNoRefineTextureDash();
+
// Returns the width of the separator between the dash and the launcher.
int GetVSeparatorSize() const;
@@ -209,6 +215,7 @@
// Practically it is the space between the top border of the dash and the searchbar.
int GetDashViewTopPadding() const;
+
// Search bar
int GetSearchBarLeftPadding() const;
int GetSearchBarRightPadding() const;
=== 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 @@
nux::ObjectPtr bg_blur_texture_;
nux::ObjectPtr bg_shine_texture_;
+
+ nux::ObjectPtr bg_refine_tex_;
+ nux::ObjectPtr bg_refine_no_refine_tex_;
+ nux::ObjectPtr bg_refine_corner_tex_;
+ std::unique_ptr bg_refine_gradient_;
+ std::unique_ptr bg_refine_gradient_corner_;
+
// temporary variable that stores the number of backgrounds we have rendered
int bgs;
bool visible;
+ bool refine_is_open_;
+
UBusManager ubus_manager_;
OverlayRenderer *parent;
@@ -107,16 +116,67 @@
rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
bg_layer_ = new nux::ColorLayer(nux::Color(0.0f, 0.0f, 0.0f, 0.9), true, rop);
+ nux::TexCoordXForm texxform;
+ bg_refine_tex_ = unity::dash::Style::Instance().GetRefineTextureDash();
+ bg_refine_no_refine_tex_ = unity::dash::Style::Instance().GetRefineNoRefineTextureDash();
+
+ bg_refine_gradient_.reset(new nux::TextureLayer(bg_refine_tex_->GetDeviceTexture(),
+ texxform,
+ nux::color::White,
+ false,
+ rop));
+
+ bg_refine_corner_tex_ = unity::dash::Style::Instance().GetRefineTextureCorner();
+
+ bg_refine_gradient_corner_.reset(new nux::TextureLayer(bg_refine_corner_tex_->GetDeviceTexture(),
+ texxform,
+ nux::color::White,
+ false,
+ rop));
+
+ ubus_manager_.RegisterInterest(UBUS_BACKGROUND_COLOR_CHANGED,
+ sigc::mem_fun(this, &OverlayRendererImpl::OnBackgroundColorChanged));
+
rop.Blend = true;
rop.SrcBlend = GL_ZERO;
rop.DstBlend = GL_SRC_COLOR;
bg_darken_layer_ = new nux::ColorLayer(nux::Color(0.9f, 0.9f, 0.9f, 1.0f), false, rop);
bg_shine_texture_ = unity::dash::Style::Instance().GetDashShine()->GetDeviceTexture();
- ubus_manager_.RegisterInterest(UBUS_BACKGROUND_COLOR_CHANGED,
- sigc::mem_fun(this, &OverlayRendererImpl::OnBackgroundColorChanged));
-
ubus_manager_.SendMessage(UBUS_BACKGROUND_REQUEST_COLOUR_EMIT);
+
+ ubus_manager_.RegisterInterest(UBUS_REFINE_STATUS, [this] (GVariant *data)
+ {
+ gboolean status;
+ g_variant_get(data, UBUS_REFINE_STATUS_FORMAT_STRING, &status);
+
+ refine_is_open_ = status;
+ nux::ROPConfig rop;
+ rop.Blend = true;
+ rop.SrcBlend = GL_ONE;
+ rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
+
+ nux::TexCoordXForm texxform;
+
+ if (refine_is_open_)
+ {
+ bg_refine_gradient_.reset(new nux::TextureLayer(bg_refine_tex_->GetDeviceTexture(),
+ texxform,
+ nux::color::White,
+ false,
+ rop));
+ }
+ else
+ {
+ bg_refine_gradient_.reset(new nux::TextureLayer(bg_refine_no_refine_tex_->GetDeviceTexture(),
+ texxform,
+ nux::color::White,
+ false,
+ rop));
+ }
+
+ parent->need_redraw.emit();
+ });
}
void OverlayRendererImpl::OnBackgroundColorChanged(GVariant* args)
@@ -442,9 +502,7 @@
gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
const double line_opacity = 0.1f;
- const int gradient_width = 130;
const int gradient_height = 50;
- const int horizontal_padding = 40;
const int vertical_padding = 20;
// Now that we mask the corners of the dash,
@@ -470,23 +528,6 @@
geometry.y + content_geo.height + INNER_CORNER_RADIUS + corner_overlap,
line_color * 0.7f); // less opacity
- // Horizontal panel/dash separator
- nux::GetPainter().Paint2DQuadColor(gfx_context,
- nux::Geometry(geometry.x + horizontal_padding,
- geometry.y,
- gradient_width,
- style.GetHSeparatorSize()),
- nux::color::Transparent,
- nux::color::Transparent,
- line_color,
- line_color);
- nux::GetPainter().Draw2DLine(gfx_context,
- geometry.x + horizontal_padding + gradient_width,
- geometry.y,
- geometry.x + content_geo.width + INNER_CORNER_RADIUS + corner_overlap,
- style.GetHSeparatorSize(),
- line_color);
-
// Draw the background
bg_darken_layer_->SetGeometry(larger_content_geo);
nux::GetPainter().RenderSinglePaintLayer(gfx_context, larger_content_geo, bg_darken_layer_);
@@ -510,6 +551,33 @@
larger_content_geo.width, larger_content_geo.height,
bg_shine_texture_, texxform_absolute_bg, nux::color::White);
+ gfx_context.GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ nux::TexCoordXForm refine_texxform;
+
+ if (refine_is_open_)
+ {
+ gfx_context.QRP_1Tex(larger_content_geo.x + larger_content_geo.width - bg_refine_tex_->GetWidth(),
+ larger_content_geo.y,
+ bg_refine_tex_->GetWidth(),
+ std::min(bg_refine_tex_->GetHeight(), larger_content_geo.height),
+ bg_refine_tex_->GetDeviceTexture(),
+ refine_texxform,
+ nux::color::White
+ );
+ }
+ else
+ {
+ gfx_context.QRP_1Tex(larger_content_geo.x + larger_content_geo.width - bg_refine_no_refine_tex_->GetWidth(),
+ larger_content_geo.y,
+ bg_refine_no_refine_tex_->GetWidth(),
+ std::min(bg_refine_no_refine_tex_->GetHeight(), larger_content_geo.height),
+ bg_refine_no_refine_tex_->GetDeviceTexture(),
+ refine_texxform,
+ nux::color::White
+ );
+ }
+
+
if (Settings::Instance().GetFormFactor() != FormFactor::NETBOOK || force_edges)
{
// Paint the edges
@@ -850,6 +918,24 @@
false,
rop);
bgs++;
+
+ nux::Geometry refine_geo = larger_content_geo;
+
+ if (refine_is_open_)
+ {
+ refine_geo.x += larger_content_geo.width - bg_refine_tex_->GetWidth();
+ refine_geo.width = bg_refine_tex_->GetWidth();
+ refine_geo.height = bg_refine_tex_->GetHeight();
+ }
+ else
+ {
+ refine_geo.x += larger_content_geo.width - bg_refine_no_refine_tex_->GetWidth();
+ refine_geo.width = bg_refine_no_refine_tex_->GetWidth();
+ refine_geo.height = bg_refine_no_refine_tex_->GetHeight();
+ }
+
+ nux::GetPainter().PushLayer(gfx_context, refine_geo, bg_refine_gradient_.get());
+ bgs++;
}
void OverlayRendererImpl::DrawContentCleanup(nux::GraphicsEngine& gfx_context, nux::Geometry content_geo, nux::Geometry absolute_geo, nux::Geometry geometry)
=== 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 @@
#define UBUS_OVERLAY_HIDDEN "OVERLAY_HIDDEN"
#define UBUS_OVERLAY_SHOWN "OVERLAY_SHOWN"
+#define UBUS_REFINE_STATUS_FORMAT_STRING "(b)"
+#define UBUS_REFINE_STATUS "REFINE_STATUS"
+
#define UBUS_PLACE_VIEW_QUEUE_DRAW "PLACE_VIEW_QUEUE_DRAW"
// Signal send by Launcher/Quicklist when it wants to exit key-nav and wants to
=== 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 @@
namespace
{
- static int display_width = 1280;
+ static int display_width = 1200;
static int display_height = 720;
static gboolean no_window_decorations = FALSE;
static gboolean force_tv = FALSE;
@@ -89,7 +89,9 @@
launcher_controller.reset(new launcher::Controller(0));
panel_controller.reset(new panel::Controller());
dash_controller.reset(new dash::Controller());
+
dash_controller->launcher_width = launcher_controller->launcher().GetAbsoluteWidth() - 1;
+ panel_controller->launcher_width = launcher_controller->launcher().GetAbsoluteWidth() - 1;
}
void UnityStandalone::InitWindowThread(nux::NThread* thread, void* InitData)