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
This commit is contained in:
Marco Martin 2014-03-27 12:30:48 +01:00
parent 8d4b9933e4
commit 5b4e2bff36
4 changed files with 31 additions and 1 deletions

View File

@ -43,6 +43,8 @@ PanelConfigView::PanelConfigView(Plasma::Containment *containment, PanelView *pa
m_containment(containment), m_containment(containment),
m_panelView(panelView) m_panelView(panelView)
{ {
m_visibilityMode = panelView->visibilityMode();
panelView->setVisibilityMode(PanelView::WindowsGoBelow);
setScreen(panelView->screen()); setScreen(panelView->screen());
connect(panelView, &QWindow::screenChanged, [=](QScreen *screen){setScreen(screen); syncGeometry();}); connect(panelView, &QWindow::screenChanged, [=](QScreen *screen){setScreen(screen); syncGeometry();});
@ -62,6 +64,7 @@ PanelConfigView::PanelConfigView(Plasma::Containment *containment, PanelView *pa
PanelConfigView::~PanelConfigView() PanelConfigView::~PanelConfigView()
{ {
m_panelView->setVisibilityMode(m_visibilityMode);
PanelShadows::self()->removeWindow(this); PanelShadows::self()->removeWindow(this);
} }
@ -124,4 +127,19 @@ void PanelConfigView::focusOutEvent(QFocusEvent *ev)
close(); 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" #include "moc_panelconfigview.cpp"

View File

@ -21,6 +21,7 @@
#define PANELCONFIGVIEW_H #define PANELCONFIGVIEW_H
#include "configview.h" #include "configview.h"
#include "panelview.h"
#include <QQuickItem> #include <QQuickItem>
#include <QQuickView> #include <QQuickView>
@ -40,6 +41,7 @@ namespace Plasma {
class PanelConfigView : public PlasmaQuick::ConfigView class PanelConfigView : public PlasmaQuick::ConfigView
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(PanelView::VisibilityMode visibilityMode READ visibilityMode WRITE setVisibilityMode NOTIFY visibilityModeChanged)
public: public:
PanelConfigView(Plasma::Containment *interface, PanelView *panelView, QWindow *parent = 0); PanelConfigView(Plasma::Containment *interface, PanelView *panelView, QWindow *parent = 0);
@ -47,6 +49,9 @@ public:
void init(); void init();
PanelView::VisibilityMode visibilityMode() const;
void setVisibilityMode(PanelView::VisibilityMode mode);
public Q_SLOTS: public Q_SLOTS:
void showAddWidgetDialog(); void showAddWidgetDialog();
void addPanelSpacer(); void addPanelSpacer();
@ -60,9 +65,13 @@ protected Q_SLOTS:
private Q_SLOTS: private Q_SLOTS:
void updateContrast(); void updateContrast();
Q_SIGNALS:
void visibilityModeChanged();
private: private:
Plasma::Containment *m_containment; Plasma::Containment *m_containment;
PanelView *m_panelView; PanelView *m_panelView;
PanelView::VisibilityMode m_visibilityMode;
Plasma::Theme m_theme; Plasma::Theme m_theme;
}; };

View File

@ -21,6 +21,7 @@
#include "panelview.h" #include "panelview.h"
#include "shellcorona.h" #include "shellcorona.h"
#include "panelshadows_p.h" #include "panelshadows_p.h"
#include "panelconfigview.h"
#include <QAction> #include <QAction>
#include <QApplication> #include <QApplication>

View File

@ -20,11 +20,13 @@
#define PANELVIEW_H #define PANELVIEW_H
#include <view.h> #include <view.h>
#include "panelconfigview.h"
#include <QtCore/qpointer.h> #include <QtCore/qpointer.h>
#include <Plasma/Theme> #include <Plasma/Theme>
#include <QTimer> #include <QTimer>
#include <configview.h>
class ShellCorona; class ShellCorona;
class PanelView : public PlasmaQuick::View class PanelView : public PlasmaQuick::View