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:
parent
5c9ddcfff2
commit
9e81a26c2a
2 changed files with 14 additions and 4 deletions
|
@ -128,6 +128,7 @@ class EffectFilterModel : public QSortFilterProxyModel
|
||||||
Q_PROPERTY(QColor backgroundActiveColor READ backgroundActiveColor CONSTANT);
|
Q_PROPERTY(QColor backgroundActiveColor READ backgroundActiveColor CONSTANT);
|
||||||
Q_PROPERTY(QColor backgroundNormalColor READ backgroundNormalColor CONSTANT);
|
Q_PROPERTY(QColor backgroundNormalColor READ backgroundNormalColor CONSTANT);
|
||||||
Q_PROPERTY(QColor backgroundAlternateColor READ backgroundAlternateColor CONSTANT);
|
Q_PROPERTY(QColor backgroundAlternateColor READ backgroundAlternateColor CONSTANT);
|
||||||
|
Q_PROPERTY(QColor sectionColor READ sectionColor CONSTANT)
|
||||||
public:
|
public:
|
||||||
EffectFilterModel(QObject *parent = 0);
|
EffectFilterModel(QObject *parent = 0);
|
||||||
const QString &filter() const;
|
const QString &filter() const;
|
||||||
|
@ -141,6 +142,12 @@ public:
|
||||||
QColor backgroundNormalColor() { return KColorScheme(QPalette::Active, KColorScheme::View, KSharedConfigPtr(0)).background(KColorScheme::NormalBackground).color(); };
|
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 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();
|
void defaults();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
|
|
@ -31,14 +31,17 @@ Item {
|
||||||
id: sectionHeading
|
id: sectionHeading
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height:25
|
implicitHeight: sectionText.implicitHeight + 2 * col.spacing
|
||||||
color: "white"
|
color: searchModel.backgroundNormalColor
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
|
id: sectionText
|
||||||
|
x: col.spacing
|
||||||
|
y: col.spacing
|
||||||
text: section
|
text: section
|
||||||
font.bold: true
|
font.bold: true
|
||||||
font.pointSize: 16
|
color: searchModel.sectionColor
|
||||||
color: "gray"
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue