From 5b4e2bff367d42379c7a41bcdc4ec383210917f5 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 27 Mar 2014 12:30:48 +0100 Subject: [PATCH] when the controller is open, force panel mode force to "Windows can cover" when the controller is open: it's the least dangerous mode. this also disables the struts while the controller is open, this makes panel resize faster Means the behavior of struts disabling is *INTENDED* BUG:332187 BUG:332592 --- src/shell/panelconfigview.cpp | 18 ++++++++++++++++++ src/shell/panelconfigview.h | 9 +++++++++ src/shell/panelview.cpp | 1 + src/shell/panelview.h | 4 +++- 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/shell/panelconfigview.cpp b/src/shell/panelconfigview.cpp index d7a5d8276..ad9d7e723 100644 --- a/src/shell/panelconfigview.cpp +++ b/src/shell/panelconfigview.cpp @@ -43,6 +43,8 @@ PanelConfigView::PanelConfigView(Plasma::Containment *containment, PanelView *pa m_containment(containment), m_panelView(panelView) { + m_visibilityMode = panelView->visibilityMode(); + panelView->setVisibilityMode(PanelView::WindowsGoBelow); setScreen(panelView->screen()); connect(panelView, &QWindow::screenChanged, [=](QScreen *screen){setScreen(screen); syncGeometry();}); @@ -62,6 +64,7 @@ PanelConfigView::PanelConfigView(Plasma::Containment *containment, PanelView *pa PanelConfigView::~PanelConfigView() { + m_panelView->setVisibilityMode(m_visibilityMode); PanelShadows::self()->removeWindow(this); } @@ -124,4 +127,19 @@ void PanelConfigView::focusOutEvent(QFocusEvent *ev) close(); } +void PanelConfigView::setVisibilityMode(PanelView::VisibilityMode mode) +{ + if (m_visibilityMode == mode) { + return; + } + + m_visibilityMode = mode; + emit visibilityModeChanged(); +} + +PanelView::VisibilityMode PanelConfigView::visibilityMode() const +{ + return m_visibilityMode; +} + #include "moc_panelconfigview.cpp" diff --git a/src/shell/panelconfigview.h b/src/shell/panelconfigview.h index 642547642..3a444e9a5 100644 --- a/src/shell/panelconfigview.h +++ b/src/shell/panelconfigview.h @@ -21,6 +21,7 @@ #define PANELCONFIGVIEW_H #include "configview.h" +#include "panelview.h" #include #include @@ -40,6 +41,7 @@ namespace Plasma { class PanelConfigView : public PlasmaQuick::ConfigView { Q_OBJECT + Q_PROPERTY(PanelView::VisibilityMode visibilityMode READ visibilityMode WRITE setVisibilityMode NOTIFY visibilityModeChanged) public: PanelConfigView(Plasma::Containment *interface, PanelView *panelView, QWindow *parent = 0); @@ -47,6 +49,9 @@ public: void init(); + PanelView::VisibilityMode visibilityMode() const; + void setVisibilityMode(PanelView::VisibilityMode mode); + public Q_SLOTS: void showAddWidgetDialog(); void addPanelSpacer(); @@ -60,9 +65,13 @@ protected Q_SLOTS: private Q_SLOTS: void updateContrast(); +Q_SIGNALS: + void visibilityModeChanged(); + private: Plasma::Containment *m_containment; PanelView *m_panelView; + PanelView::VisibilityMode m_visibilityMode; Plasma::Theme m_theme; }; diff --git a/src/shell/panelview.cpp b/src/shell/panelview.cpp index 4911ac942..9df5c45b2 100644 --- a/src/shell/panelview.cpp +++ b/src/shell/panelview.cpp @@ -21,6 +21,7 @@ #include "panelview.h" #include "shellcorona.h" #include "panelshadows_p.h" +#include "panelconfigview.h" #include #include diff --git a/src/shell/panelview.h b/src/shell/panelview.h index dd3e45a6c..69736430a 100644 --- a/src/shell/panelview.h +++ b/src/shell/panelview.h @@ -20,11 +20,13 @@ #define PANELVIEW_H #include -#include "panelconfigview.h" #include #include #include + +#include + class ShellCorona; class PanelView : public PlasmaQuick::View