diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-02-15 19:10:14 +0100 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-02-15 19:10:14 +0100 |
| commit | 478c7f5ee5d2ea85ecd6b5a5eee3c100cd9c114d (patch) | |
| tree | 0ca64d30bb5a54a15fcd612c53b6e0d06914ac9d /panel | |
| parent | e136814828718b7ffba635a73bed01279d2c3192 (diff) | |
PanelMenuView: draw the window buttons when in Spread mode
Fixes LP: #1280632 (bzr r3656.2.11)
Diffstat (limited to 'panel')
| -rw-r--r-- | panel/PanelMenuView.cpp | 38 | ||||
| -rw-r--r-- | panel/PanelMenuView.h | 1 |
2 files changed, 17 insertions, 22 deletions
diff --git a/panel/PanelMenuView.cpp b/panel/PanelMenuView.cpp index 1281e0815..55cc7d602 100644 --- a/panel/PanelMenuView.cpp +++ b/panel/PanelMenuView.cpp @@ -63,6 +63,7 @@ PanelMenuView::PanelMenuView(menu::Manager::Ptr const& menus) , new_application_(nullptr) , overlay_showing_(false) , switcher_showing_(false) + , spread_showing_(false) , launcher_keynav_(false) , show_now_activated_(false) , we_control_active_(false) @@ -229,20 +230,17 @@ nux::Area* PanelMenuView::FindAreaUnderMouse(const nux::Point& mouse_position, n Area* found_area = nullptr; - if (!we_control_active_) + if (!we_control_active_ && !spread_showing_) { /* When the current panel is not active, it all behaves like a grab-area */ if (GetAbsoluteGeometry().IsInside(mouse_position)) return titlebar_grab_area_.GetPointer(); } - if (is_maximized_) + if (is_maximized_ || spread_showing_) { - if (window_buttons_) - { - found_area = window_buttons_->FindAreaUnderMouse(mouse_position, event_type); - NUX_RETURN_VALUE_IF_NOTNULL(found_area, found_area); - } + found_area = window_buttons_->FindAreaUnderMouse(mouse_position, event_type); + NUX_RETURN_VALUE_IF_NOTNULL(found_area, found_area); } if (titlebar_grab_area_) @@ -331,7 +329,7 @@ bool PanelMenuView::ShouldDrawButtons() const { WindowManager& wm = WindowManager::Default(); - if (!wm.IsExpoActive() && !wm.IsScaleActive()) + if (!wm.IsExpoActive()) { if (is_inside_ || show_now_activated_ || new_application_) return true; @@ -341,6 +339,9 @@ bool PanelMenuView::ShouldDrawButtons() const } } + if (spread_showing_) + return true; + return false; } @@ -400,7 +401,7 @@ void PanelMenuView::UpdateLastGeometry(nux::Geometry const& geo) void PanelMenuView::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) { - if (overlay_showing_) + if (overlay_showing_ || spread_showing_) return; nux::Geometry const& geo = GetGeometry(); @@ -559,7 +560,7 @@ void PanelMenuView::UpdateTitleGradientTexture() void PanelMenuView::DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw) { - if (overlay_showing_) + if (overlay_showing_ && !spread_showing_) return; nux::Geometry const& geo = GetGeometry(); @@ -706,14 +707,7 @@ std::string PanelMenuView::GetCurrentTitle() const WindowManager& wm = WindowManager::Default(); std::string new_title; - if (wm.IsScaleActive()) - { - if (wm.IsScaleActiveForGroup()) - new_title = GetActiveViewName(true); - else if (we_control_active_) - new_title = desktop_name_; - } - else if (wm.IsExpoActive()) + if (wm.IsExpoActive()) { new_title = desktop_name_; } @@ -973,14 +967,14 @@ void PanelMenuView::OnActiveWindowChanged(BamfMatcher *matcher, BamfView* old_vi void PanelMenuView::OnSpreadInitiate() { - if (Refresh()) - QueueDraw(); + spread_showing_ = true; + QueueDraw(); } void PanelMenuView::OnSpreadTerminate() { - if (Refresh()) - QueueDraw(); + spread_showing_ = false; + QueueDraw(); } void PanelMenuView::OnExpoInitiate() diff --git a/panel/PanelMenuView.h b/panel/PanelMenuView.h index 6249065e1..50379475d 100644 --- a/panel/PanelMenuView.h +++ b/panel/PanelMenuView.h @@ -171,6 +171,7 @@ private: bool overlay_showing_; bool switcher_showing_; + bool spread_showing_; bool launcher_keynav_; bool show_now_activated_; bool we_control_active_; |
