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
This commit is contained in:
Martin Gräßlin 2014-03-11 09:02:23 +01:00
parent 5c9ddcfff2
commit 9e81a26c2a
2 changed files with 14 additions and 4 deletions

View file

@ -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:

View file

@ -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
}
}
}