add hover and focus colors for view elements to Plasma::Theme::color()
svn path=/trunk/KDE/kdelibs/; revision=1184285
This commit is contained in:
parent
86a15c25a0
commit
8bab6af5ff
12
theme.cpp
12
theme.cpp
@ -330,6 +330,8 @@ const QString ThemePrivate::processStyleSheet(const QString &css)
|
||||
|
||||
stylesheet += skel.arg("ViewText","%viewtextcolor");
|
||||
stylesheet += skel.arg("ViewBackground","%viewbackgroundcolor");
|
||||
stylesheet += skel.arg("ViewHover","%viewhovercolor");
|
||||
stylesheet += skel.arg("ViewFocus","%viewfocuscolor");
|
||||
|
||||
stylesheet = processStyleSheet(stylesheet);
|
||||
}
|
||||
@ -364,6 +366,10 @@ const QString ThemePrivate::processStyleSheet(const QString &css)
|
||||
Plasma::Theme::defaultTheme()->color(Plasma::Theme::ViewTextColor).name();
|
||||
elements["%viewbackgroundcolor"] =
|
||||
Plasma::Theme::defaultTheme()->color(Plasma::Theme::ViewBackgroundColor).name();
|
||||
elements["%viewhovercolor"] =
|
||||
Plasma::Theme::defaultTheme()->color(Plasma::Theme::ViewHoverColor).name();
|
||||
elements["%viewfocuscolor"] =
|
||||
Plasma::Theme::defaultTheme()->color(Plasma::Theme::ViewFocusColor).name();
|
||||
elements["%smallfontsize"] =
|
||||
QString("%1pt").arg(KGlobalSettings::smallestReadableFont().pointSize());
|
||||
|
||||
@ -796,6 +802,12 @@ QColor Theme::color(ColorRole role) const
|
||||
case ViewBackgroundColor:
|
||||
return d->viewColorScheme.background(KColorScheme::NormalBackground).color();
|
||||
|
||||
case ViewHoverColor:
|
||||
return d->viewColorScheme.decoration(KColorScheme::HoverColor).color();
|
||||
|
||||
case ViewFocusColor:
|
||||
return d->viewColorScheme.decoration(KColorScheme::FocusColor).color();
|
||||
|
||||
case LinkColor:
|
||||
return d->viewColorScheme.foreground(KColorScheme::LinkText).color();
|
||||
|
||||
|
4
theme.h
4
theme.h
@ -71,7 +71,9 @@ class PLASMA_EXPORT Theme : public QObject
|
||||
ButtonHoverColor = 64, /** color for hover effect on buttons */
|
||||
ButtonFocusColor = 128, /** color for focus effect on buttons */
|
||||
ViewTextColor = 256, /** text color for views */
|
||||
ViewBackgroundColor = 512 /** background color for views */
|
||||
ViewBackgroundColor = 512, /** background color for views */
|
||||
ViewHoverColor = 1024, /** color for hover effect on view */
|
||||
ViewFocusColor = 2048 /** color for focus effect on view */
|
||||
};
|
||||
|
||||
enum FontRole {
|
||||
|
Loading…
Reference in New Issue
Block a user