From b2ef2552f839fc95da8e977b2d5051ba323af77c Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser <muesli@gmail.com> Date: Sat, 5 Jan 2013 02:17:09 +0100 Subject: [PATCH] * Added new color roles for selection foreground / background. --- src/libtomahawk/utils/TomahawkUtilsGui.cpp | 10 +++++++--- src/libtomahawk/utils/TomahawkUtilsGui.h | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/libtomahawk/utils/TomahawkUtilsGui.cpp b/src/libtomahawk/utils/TomahawkUtilsGui.cpp index 7bc172d6f..c0db15894 100644 --- a/src/libtomahawk/utils/TomahawkUtilsGui.cpp +++ b/src/libtomahawk/utils/TomahawkUtilsGui.cpp @@ -200,11 +200,15 @@ drawBackgroundAndNumbers( QPainter* painter, const QString& text, const QRect& f void -drawQueryBackground( QPainter* p, const QPalette& palette, const QRect& r, qreal lightnessFactor ) +drawQueryBackground( QPainter* p, const QRect& r ) { - p->setPen( palette.highlight().color().lighter( lightnessFactor * 100 ) ); - p->setBrush( palette.highlight().color().lighter( lightnessFactor * 100 ) ); + p->save(); + + p->setPen( Colors::SELECTION_BACKGROUND ); + p->setBrush( Colors::SELECTION_BACKGROUND ); p->drawRoundedRect( r, 4.0, 4.0 ); + + p->restore(); } diff --git a/src/libtomahawk/utils/TomahawkUtilsGui.h b/src/libtomahawk/utils/TomahawkUtilsGui.h index 206a016cd..5544a2ee1 100644 --- a/src/libtomahawk/utils/TomahawkUtilsGui.h +++ b/src/libtomahawk/utils/TomahawkUtilsGui.h @@ -41,7 +41,7 @@ class QScrollBar; namespace TomahawkUtils { - DLLEXPORT void drawQueryBackground( QPainter* p, const QPalette& palette, const QRect& r, qreal lightnessFactor = 1 ); + DLLEXPORT void drawQueryBackground( QPainter* p, const QRect& r ); DLLEXPORT QWidget* tomahawkWindow(); /// Platform-specific bringing tomahawk mainwindow to front, b/c qt's activate() and such don't seem to work well enough for us DLLEXPORT void bringToFront(); @@ -82,6 +82,8 @@ namespace TomahawkUtils static const QColor GROUP_HEADER = QColor( "#637180" ); static const QColor NOW_PLAYING_ITEM = QColor( "#962c26" ); static const QColor NOW_PLAYING_ITEM_TEXT = QColor( "#ffffff" ); + static const QColor SELECTION_BACKGROUND = QColor( "#962c26" ); + static const QColor SELECTION_FOREGROUND = QColor( "#ffffff" ); } static const int POPUP_ROUNDING_RADIUS = 6;