diff --git a/theme.cpp b/theme.cpp index 645b13c13..fc1849030 100644 --- a/theme.cpp +++ b/theme.cpp @@ -57,6 +57,7 @@ public: : q(theme), colorScheme(QPalette::Active, KColorScheme::Window, KSharedConfigPtr(0)), buttonColorScheme(QPalette::Active, KColorScheme::Button, KSharedConfigPtr(0)), + viewColorScheme(KColorScheme(QPalette::Active, KColorScheme::View, KSharedConfigPtr(0))), defaultWallpaperTheme(DEFAULT_WALLPAPER_THEME), defaultWallpaperSuffix(DEFAULT_WALLPAPER_SUFFIX), defaultWallpaperWidth(DEFAULT_WALLPAPER_WIDTH), @@ -140,6 +141,7 @@ public: KSharedConfigPtr colors; KColorScheme colorScheme; KColorScheme buttonColorScheme; + KColorScheme viewColorScheme; KConfigGroup cfg; QFont generalFont; QString defaultWallpaperTheme; @@ -253,6 +255,7 @@ void ThemePrivate::colorsChanged() discardCache(true); colorScheme = KColorScheme(QPalette::Active, KColorScheme::Window, colors); buttonColorScheme = KColorScheme(QPalette::Active, KColorScheme::Button, colors); + viewColorScheme = KColorScheme(QPalette::Active, KColorScheme::View, colors); emit q->themeChanged(); } @@ -439,6 +442,7 @@ void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings colorScheme = KColorScheme(QPalette::Active, KColorScheme::Window, colors); buttonColorScheme = KColorScheme(QPalette::Active, KColorScheme::Button, colors); + viewColorScheme = KColorScheme(QPalette::Active, KColorScheme::View, colors); hasWallpapers = KStandardDirs::exists(KStandardDirs::locateLocal("data", "desktoptheme/" + theme + "/wallpapers/")); if (isDefault && writeSettings) { @@ -598,6 +602,12 @@ QColor Theme::color(ColorRole role) const case ButtonBackgroundColor: return d->buttonColorScheme.background(KColorScheme::ActiveBackground).color(); break; + + case LinkColor: + return d->viewColorScheme.foreground(KColorScheme::LinkText).color(); + + case VisitedLinkColor: + return d->viewColorScheme.foreground(KColorScheme::VisitedText).color(); } return QColor(); diff --git a/theme.h b/theme.h index 6d918c006..4bd6fed22 100644 --- a/theme.h +++ b/theme.h @@ -65,7 +65,9 @@ class PLASMA_EXPORT Theme : public QObject on the background */ BackgroundColor = 2, /**< the default background color */ ButtonTextColor = 4, /** text color for buttons */ - ButtonBackgroundColor = 8 /** background color for buttons*/ + ButtonBackgroundColor = 8, /** background color for buttons*/ + LinkColor = 16, /** color for clickable links */ + VisitedLinkColor = 32 /** color visited clickable links */ }; enum FontRole { diff --git a/widgets/label.cpp b/widgets/label.cpp index add811cac..5dd6eb297 100644 --- a/widgets/label.cpp +++ b/widgets/label.cpp @@ -76,9 +76,8 @@ public: p.setColor(QPalette::Normal, QPalette::WindowText, color); p.setColor(QPalette::Inactive, QPalette::WindowText, color); - KColorScheme colorScheme(QPalette::Active, KColorScheme::View, Plasma::Theme::defaultTheme()->colorScheme()); - p.setColor(QPalette::Normal, QPalette::Link, colorScheme.foreground(KColorScheme::LinkText).color()); - p.setColor(QPalette::Normal, QPalette::LinkVisited, colorScheme.foreground(KColorScheme::VisitedText).color()); + p.setColor(QPalette::Normal, QPalette::Link, Theme::defaultTheme()->color(Theme::LinkColor)); + p.setColor(QPalette::Normal, QPalette::LinkVisited, Theme::defaultTheme()->color(Theme::VisitedLinkColor)); native->setPalette(p); native->setFont(Plasma::Theme::defaultTheme()->font(Plasma::Theme::DefaultFont)); }