From 37be2522508366a05471d32d91ea9507d668c730 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 4 Aug 2008 21:23:40 +0000 Subject: [PATCH] add button text and button background colors accessible by the ButtonTextColor and ButtonBackgroundColor color roles svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=842203 --- private/nativetabbar.cpp | 2 +- theme.h | 4 +++- widgets/pushbutton.cpp | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/private/nativetabbar.cpp b/private/nativetabbar.cpp index ca0c29c15..4ca21d84f 100755 --- a/private/nativetabbar.cpp +++ b/private/nativetabbar.cpp @@ -239,7 +239,7 @@ void NativeTabBar::paintEvent(QPaintEvent *event) // draw tab text if (i == currentIndex() && d->animProgress == 1) { //FIXME: theme will need a ButtonColor and ButtonTextColor - painter.setPen(Plasma::Theme::defaultTheme()->color(Theme::BackgroundColor)); + painter.setPen(Plasma::Theme::defaultTheme()->color(Theme::ButtonTextColor)); } else { QColor color(Plasma::Theme::defaultTheme()->color(Theme::TextColor)); if (!isTabEnabled(i)) { diff --git a/theme.h b/theme.h index cd4c76420..36c51632d 100644 --- a/theme.h +++ b/theme.h @@ -60,7 +60,9 @@ class PLASMA_EXPORT Theme : public QObject { TextColor = 0 /**< the text color to be used by items resting on the background */, HighlightColor = 1 /**< the text higlight color to be used by items resting on the background */, - BackgroundColor = 2 /**< the default background color */ + BackgroundColor = 2 /**< the default background color */, + ButtonTextColor = 4 /** text color for buttons */, + ButtonBackgroundColor = 8 /** background color for buttons*/ }; enum FontRole diff --git a/widgets/pushbutton.cpp b/widgets/pushbutton.cpp index 8e5deaffc..3fe1fc238 100644 --- a/widgets/pushbutton.cpp +++ b/widgets/pushbutton.cpp @@ -302,8 +302,8 @@ void PushButton::paint(QPainter *painter, d->background->paintPanel(painter); } - //FIXME: theme will need a ButtonColor and ButtonTextColor - painter->setPen(Plasma::Theme::defaultTheme()->color(Theme::BackgroundColor)); + + painter->setPen(Plasma::Theme::defaultTheme()->color(Theme::ButtonTextColor)); if (nativeWidget()->isDown()) {