diff --git a/shell/panelconfigview.h b/shell/panelconfigview.h --- a/shell/panelconfigview.h +++ b/shell/panelconfigview.h @@ -49,6 +49,7 @@ { Q_OBJECT Q_PROPERTY(PanelView::VisibilityMode visibilityMode READ visibilityMode WRITE setVisibilityMode NOTIFY visibilityModeChanged) + Q_PROPERTY(Plasma::FrameSvg::EnabledBorders enabledBorders READ enabledBorders NOTIFY enabledBordersChanged) public: PanelConfigView(Plasma::Containment *interface, PanelView *panelView, QWindow *parent = 0); @@ -59,6 +60,8 @@ PanelView::VisibilityMode visibilityMode() const; void setVisibilityMode(PanelView::VisibilityMode mode); + Plasma::FrameSvg::EnabledBorders enabledBorders() const; + protected: void showEvent(QShowEvent *ev) override; void hideEvent(QHideEvent *ev) override; @@ -72,18 +75,20 @@ protected Q_SLOTS: void syncGeometry(); - void syncSlideLocation(); + void syncLocation(); private Q_SLOTS: void updateContrast(); Q_SIGNALS: void visibilityModeChanged(); + void enabledBordersChanged(); private: Plasma::Containment *m_containment; QPointer m_panelView; PanelView::VisibilityMode m_visibilityMode; + Plasma::FrameSvg::EnabledBorders m_enabledBorders = Plasma::FrameSvg::AllBorders; Plasma::Theme m_theme; QTimer m_deleteTimer; QTimer m_screenSyncTimer; diff --git a/shell/panelconfigview.cpp b/shell/panelconfigview.cpp --- a/shell/panelconfigview.cpp +++ b/shell/panelconfigview.cpp @@ -67,7 +67,7 @@ setFlags(Qt::WindowFlags((flags() | Qt::FramelessWindowHint) & (~Qt::WindowDoesNotAcceptFocus))); KWindowSystem::setState(winId(), NET::KeepAbove); syncGeometry(); - syncSlideLocation(); + syncLocation(); }); KWindowSystem::setType(winId(), NET::Dock); @@ -82,9 +82,7 @@ rootContext()->setContextProperty(QStringLiteral("panel"), panelView); rootContext()->setContextProperty(QStringLiteral("configDialog"), this); connect(containment, &Plasma::Containment::formFactorChanged, this, &PanelConfigView::syncGeometry); - connect(containment, &Plasma::Containment::locationChanged, this, &PanelConfigView::syncSlideLocation); - - PanelShadows::self()->addWindow(this); + connect(containment, &Plasma::Containment::locationChanged, this, &PanelConfigView::syncLocation); } PanelConfigView::~PanelConfigView() @@ -98,7 +96,7 @@ { setSource(QUrl::fromLocalFile(m_containment->corona()->kPackage().filePath("panelconfigurationui"))); syncGeometry(); - syncSlideLocation(); + syncLocation(); } void PanelConfigView::updateContrast() @@ -154,32 +152,45 @@ } } -void PanelConfigView::syncSlideLocation() +void PanelConfigView::syncLocation() { if (!m_containment) { return; } KWindowEffects::SlideFromLocation slideLocation = KWindowEffects::NoEdge; + Plasma::FrameSvg::EnabledBorders enabledBorders = Plasma::FrameSvg::AllBorders; switch (m_containment->location()) { case Plasma::Types::TopEdge: slideLocation = KWindowEffects::TopEdge; + enabledBorders = Plasma::FrameSvg::BottomBorder; break; case Plasma::Types::RightEdge: slideLocation = KWindowEffects::RightEdge; + enabledBorders = Plasma::FrameSvg::LeftBorder; break; case Plasma::Types::BottomEdge: slideLocation = KWindowEffects::BottomEdge; + enabledBorders = Plasma::FrameSvg::TopBorder; break; case Plasma::Types::LeftEdge: slideLocation = KWindowEffects::LeftEdge; + enabledBorders = Plasma::FrameSvg::RightBorder; break; default: break; } KWindowEffects::slideWindow(winId(), slideLocation, -1); + + if (m_enabledBorders != enabledBorders) { + m_enabledBorders = enabledBorders; + + PanelShadows::self()->setEnabledBorders(this, enabledBorders); + + emit enabledBordersChanged(); + } } void PanelConfigView::showEvent(QShowEvent *ev) @@ -193,7 +204,7 @@ KWindowEffects::enableBlurBehind(winId(), true); updateContrast(); syncGeometry(); - syncSlideLocation(); + syncLocation(); //this because due to Qt xcb implementation the actual flags gets set only after a while after the window is actually visible m_screenSyncTimer.start(); @@ -207,7 +218,7 @@ if (m_visibilityMode != PanelView::NormalPanel) { m_panelView->setVisibilityMode(PanelView::WindowsGoBelow); } - PanelShadows::self()->addWindow(this); + PanelShadows::self()->addWindow(this, m_enabledBorders); } void PanelConfigView::hideEvent(QHideEvent *ev) @@ -288,4 +299,9 @@ return m_visibilityMode; } +Plasma::FrameSvg::EnabledBorders PanelConfigView::enabledBorders() const +{ + return m_enabledBorders; +} + #include "moc_panelconfigview.cpp"