diff options
Diffstat (limited to 'panel')
| -rw-r--r-- | panel/PanelIndicatorEntryView.cpp | 2 | ||||
| -rw-r--r-- | panel/PanelIndicatorsView.cpp | 8 | ||||
| -rw-r--r-- | panel/PanelIndicatorsView.h | 1 | ||||
| -rw-r--r-- | panel/PanelMenuView.cpp | 1 | ||||
| -rw-r--r-- | panel/PanelMenuView.h | 1 | ||||
| -rw-r--r-- | panel/PanelView.cpp | 15 |
6 files changed, 15 insertions, 13 deletions
diff --git a/panel/PanelIndicatorEntryView.cpp b/panel/PanelIndicatorEntryView.cpp index 5dba6ec2a..42aff3fbf 100644 --- a/panel/PanelIndicatorEntryView.cpp +++ b/panel/PanelIndicatorEntryView.cpp @@ -387,7 +387,7 @@ void PanelIndicatorEntryView::DrawEntryContent(cairo_t *cr, unsigned int width, pango_layout_get_pixel_size(layout, &extents.width, &extents.height); int y = (height - extents.height) / 2; - if (overlay_showing_) + if (overlay_showing_ && !IsActive()) { cairo_move_to(cr, x, y); cairo_set_source_rgb(cr, 1.0f, 1.0f, 1.0f); diff --git a/panel/PanelIndicatorsView.cpp b/panel/PanelIndicatorsView.cpp index b65530b84..90fb67176 100644 --- a/panel/PanelIndicatorsView.cpp +++ b/panel/PanelIndicatorsView.cpp @@ -42,6 +42,7 @@ PanelIndicatorsView::PanelIndicatorsView() , opacity(1.0f, sigc::mem_fun(this, &PanelIndicatorsView::SetOpacity)) , layout_(new nux::HLayout("", NUX_TRACKER_LOCATION)) , monitor_(0) +, overlay_showing_(false) { opacity.DisableNotifications(); layout_->SetContentDistribution(nux::MAJOR_POSITION_END); @@ -327,6 +328,9 @@ PanelIndicatorEntryView *PanelIndicatorsView::AddEntry(Entry::Ptr const& entry, auto view = new PanelIndicatorEntryView(entry, padding, type); AddEntryView(view, pos); + if (overlay_showing_) + view->OverlayShown(); + return view; } @@ -368,12 +372,16 @@ void PanelIndicatorsView::RemoveEntry(std::string const& entry_id) void PanelIndicatorsView::OverlayShown() { + overlay_showing_ = true; + for (auto const& entry: entries_) entry.second->OverlayShown(); } void PanelIndicatorsView::OverlayHidden() { + overlay_showing_ = false; + for (auto const& entry: entries_) entry.second->OverlayHidden(); } diff --git a/panel/PanelIndicatorsView.h b/panel/PanelIndicatorsView.h index 0f6f7c44e..0219a407c 100644 --- a/panel/PanelIndicatorsView.h +++ b/panel/PanelIndicatorsView.h @@ -98,6 +98,7 @@ protected: Entries entries_; int monitor_; + bool overlay_showing_; private: bool SetOpacity(double& target, double const& new_value); diff --git a/panel/PanelMenuView.cpp b/panel/PanelMenuView.cpp index 185192558..a30b2af68 100644 --- a/panel/PanelMenuView.cpp +++ b/panel/PanelMenuView.cpp @@ -64,7 +64,6 @@ PanelMenuView::PanelMenuView(menu::Manager::Ptr const& menus) , is_desktop_focused_(false) , last_active_view_(nullptr) , new_application_(nullptr) - , overlay_showing_(false) , switcher_showing_(false) , spread_showing_(false) , launcher_keynav_(false) diff --git a/panel/PanelMenuView.h b/panel/PanelMenuView.h index cf62915b9..9ee842450 100644 --- a/panel/PanelMenuView.h +++ b/panel/PanelMenuView.h @@ -176,7 +176,6 @@ private: nux::Geometry last_geo_; nux::Geometry title_geo_; - bool overlay_showing_; bool switcher_showing_; bool spread_showing_; bool launcher_keynav_; diff --git a/panel/PanelView.cpp b/panel/PanelView.cpp index a6ce660a1..4debdd8d3 100644 --- a/panel/PanelView.cpp +++ b/panel/PanelView.cpp @@ -19,20 +19,11 @@ */ #include <Nux/Nux.h> -#include <Nux/BaseWindow.h> #include <Nux/HLayout.h> -#include <Nux/Layout.h> -#include <Nux/WindowCompositor.h> -#include <NuxGraphics/CairoGraphics.h> #include <NuxCore/Logger.h> #include <UnityCore/GLibWrapper.h> -#include <NuxGraphics/GLThread.h> -#include <NuxGraphics/RenderingPipe.h> - -#include <glib.h> - #include "unity-shared/PanelStyle.h" #include "unity-shared/TextureCache.h" #include "unity-shared/WindowManager.h" @@ -556,7 +547,11 @@ void PanelView::PreLayoutManagement() { View::PreLayoutManagement(); - int menu_width = GetMaximumWidth() - indicators_->GetBaseWidth() - tray_->GetBaseWidth(); + int tray_width = 0; + if (tray_) + tray_width = tray_->GetBaseWidth(); + + int menu_width = GetMaximumWidth() - indicators_->GetBaseWidth() - tray_width; menu_view_->SetMinimumWidth(menu_width); menu_view_->SetMaximumWidth(menu_width); |
