Commit 328817b5 authored by Michail Vourlakos's avatar Michail Vourlakos
Browse files

update panel shadows when background hints are changed

Summary:
--when the containment background hints are updated then the
panel shadows should be also. In case the background hints
point to NoBackground the panel shadows should be removed
and in case they point to DefaultBackground they should be
drawn again
--PanelShadows::removeWindow has no place in updateEnabledBorders
because the window still lives. When removeWindow was executed
before it was faulty unregistered from PanelShadows and in order for
setEnabledBorders to work again we should need
to execute from start the PanelShadows::addWindow function

Test Plan:
--I have created an applet which a PlasmaComponents.Switch button
and toggles panel transparency on user demand easily

Reviewers: #plasma, davidedmundson, mart

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D25121
parent b84075fa
...@@ -80,6 +80,7 @@ PanelView::PanelView(ShellCorona *corona, QScreen *targetScreen, QWindow *parent ...@@ -80,6 +80,7 @@ PanelView::PanelView(ShellCorona *corona, QScreen *targetScreen, QWindow *parent
connect(&m_theme, &Plasma::Theme::themeChanged, this, &PanelView::updateMask); connect(&m_theme, &Plasma::Theme::themeChanged, this, &PanelView::updateMask);
connect(this, &PanelView::backgroundHintsChanged, this, &PanelView::updateMask); connect(this, &PanelView::backgroundHintsChanged, this, &PanelView::updateMask);
connect(this, &PanelView::backgroundHintsChanged, this, &PanelView::updateEnabledBorders);
// TODO: add finished/componentComplete signal to QuickViewSharedEngine, // TODO: add finished/componentComplete signal to QuickViewSharedEngine,
// so we exactly know when rootobject is available // so we exactly know when rootobject is available
connect(this, &QuickViewSharedEngine::statusChanged, connect(this, &QuickViewSharedEngine::statusChanged,
...@@ -1321,12 +1322,7 @@ void PanelView::updateEnabledBorders() ...@@ -1321,12 +1322,7 @@ void PanelView::updateEnabledBorders()
} }
if (m_enabledBorders != borders) { if (m_enabledBorders != borders) {
if (m_backgroundHints == Plasma::Types::NoBackground) {
PanelShadows::self()->removeWindow(this);
} else {
PanelShadows::self()->setEnabledBorders(this, borders); PanelShadows::self()->setEnabledBorders(this, borders);
}
m_enabledBorders = borders; m_enabledBorders = borders;
emit enabledBordersChanged(); emit enabledBordersChanged();
} }
......
...@@ -205,6 +205,7 @@ private Q_SLOTS: ...@@ -205,6 +205,7 @@ private Q_SLOTS:
void adaptToScreen(); void adaptToScreen();
void handleQmlStatusChange(QQmlComponent::Status status); void handleQmlStatusChange(QQmlComponent::Status status);
void updateMask(); void updateMask();
void updateEnabledBorders();
private: private:
int readConfigValueWithFallBack(const QString &key, int defaultValue); int readConfigValueWithFallBack(const QString &key, int defaultValue);
...@@ -215,7 +216,6 @@ private: ...@@ -215,7 +216,6 @@ private:
void setupWaylandIntegration(); void setupWaylandIntegration();
void visibilityModeToWayland(); void visibilityModeToWayland();
bool edgeActivated() const; bool edgeActivated() const;
void updateEnabledBorders();
bool canSetStrut() const; bool canSetStrut() const;
int m_offset; int m_offset;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment