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_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"

View File

@ -21,6 +21,7 @@
#define PANELCONFIGVIEW_H
#include "configview.h"
#include "panelview.h"
#include <QQuickItem>
#include <QQuickView>
@ -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;
};

View File

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

View File

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