diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-03-06 10:26:03 +0100 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-03-06 10:26:03 +0100 |
| commit | 300440e55a4a0c751e197e0a20179283234862c1 (patch) | |
| tree | 13308bc191a291929de26483887dcc3fa6c72870 | |
| parent | 0470b22d9d23976d2cf36c99bab0ab11619cbe20 (diff) | |
PanelIndicatorsView: if an entry is added while an overlay is open, it should be in overlay mode
This doesn't apply to PanelMenuView's added menus, though. (bzr r3695.4.37)
| -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 |
4 files changed, 9 insertions, 2 deletions
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_; |
