diff --git a/src/shell/panelconfigview.cpp b/src/shell/panelconfigview.cpp index 45026180f..54551c683 100644 --- a/src/shell/panelconfigview.cpp +++ b/src/shell/panelconfigview.cpp @@ -48,11 +48,8 @@ PanelConfigView::PanelConfigView(Plasma::Containment *containment, PanelView *pa setFlags(Qt::FramelessWindowHint); KWindowEffects::enableBlurBehind(winId(), true); - if (qGray(m_theme.color(Plasma::Theme::BackgroundColor).rgb()) > 127) { - KWindowEffects::enableBackgroundContrast(winId(), true, 0.30, 1.9, 1.7); - } else { - KWindowEffects::enableBackgroundContrast(winId(), true, 0.45, 0.45, 1.7); - } + updateContrast(); + connect(&m_theme, &Plasma::Theme::themeChanged, this, &PanelConfigView::updateContrast); engine()->rootContext()->setContextProperty("panel", panelView); engine()->rootContext()->setContextProperty("configDialog", this); @@ -70,6 +67,14 @@ void PanelConfigView::init() syncGeometry(); } +void PanelConfigView::updateContrast() +{ + KWindowEffects::enableBackgroundContrast(winId(), m_theme.backgroundContrastEnabled(), + m_theme.backgroundContrast(), + m_theme.backgroundIntensity(), + m_theme.backgroundSaturation()); +} + void PanelConfigView::showAddWidgetDialog() { QAction *addWidgetAction = m_containment->actions()->action("add widgets"); diff --git a/src/shell/panelconfigview.h b/src/shell/panelconfigview.h index 78023755c..44fd1bfba 100644 --- a/src/shell/panelconfigview.h +++ b/src/shell/panelconfigview.h @@ -56,6 +56,9 @@ protected: protected Q_SLOTS: void syncGeometry(); +private Q_SLOTS: + void updateContrast(); + private: Plasma::Containment *m_containment; PanelView *m_panelView;