From 9e81a26c2a798c89f82f8438ff584f98b0092c30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 11 Mar 2014 09:02:23 +0100 Subject: [PATCH] Improve section heading Using spacing around the header and no hardcoded color by using KColorscheme to get the base color and use the same alpha modulation as KCategoryDrawer. REVIEW: 116703 --- kcmkwin/kwincompositing/model.h | 7 +++++++ kcmkwin/kwincompositing/qml/EffectView.qml | 11 +++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/kcmkwin/kwincompositing/model.h b/kcmkwin/kwincompositing/model.h index 54b28c0ac6..7807a97e2d 100644 --- a/kcmkwin/kwincompositing/model.h +++ b/kcmkwin/kwincompositing/model.h @@ -128,6 +128,7 @@ class EffectFilterModel : public QSortFilterProxyModel Q_PROPERTY(QColor backgroundActiveColor READ backgroundActiveColor CONSTANT); Q_PROPERTY(QColor backgroundNormalColor READ backgroundNormalColor CONSTANT); Q_PROPERTY(QColor backgroundAlternateColor READ backgroundAlternateColor CONSTANT); + Q_PROPERTY(QColor sectionColor READ sectionColor CONSTANT) public: EffectFilterModel(QObject *parent = 0); const QString &filter() const; @@ -141,6 +142,12 @@ public: QColor backgroundNormalColor() { return KColorScheme(QPalette::Active, KColorScheme::View, KSharedConfigPtr(0)).background(KColorScheme::NormalBackground).color(); }; QColor backgroundAlternateColor() { return KColorScheme(QPalette::Active, KColorScheme::View, KSharedConfigPtr(0)).background(KColorScheme::AlternateBackground).color(); }; + QColor sectionColor() const { + QColor color = KColorScheme(QPalette::Active).foreground().color(); + color.setAlphaF(0.6); + return color; + } + void defaults(); public Q_SLOTS: diff --git a/kcmkwin/kwincompositing/qml/EffectView.qml b/kcmkwin/kwincompositing/qml/EffectView.qml index e935089de8..f58b41e841 100644 --- a/kcmkwin/kwincompositing/qml/EffectView.qml +++ b/kcmkwin/kwincompositing/qml/EffectView.qml @@ -31,14 +31,17 @@ Item { id: sectionHeading Rectangle { width: parent.width - height:25 - color: "white" + implicitHeight: sectionText.implicitHeight + 2 * col.spacing + color: searchModel.backgroundNormalColor Text { + id: sectionText + x: col.spacing + y: col.spacing text: section font.bold: true - font.pointSize: 16 - color: "gray" + color: searchModel.sectionColor + anchors.horizontalCenter: parent.horizontalCenter } } }