From 15e4d931025c91e1997721e33ac4020fd41e4ea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Thu, 6 Feb 2014 03:52:56 +0100 Subject: [PATCH] PanelConfigView respects contrast effect settings --- src/shell/panelconfigview.cpp | 15 ++++++++++----- src/shell/panelconfigview.h | 3 +++ 2 files changed, 13 insertions(+), 5 deletions(-) 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;