From bc4ba842122846e14dddbdd7a94d89778472b861 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Thu, 29 Jan 2015 12:33:44 +0100 Subject: [PATCH] Fixed page background and selection colors. --- src/libtomahawk/playlist/ContextView.cpp | 4 ++-- src/libtomahawk/playlist/PlaylistItemDelegate.cpp | 7 ++++--- src/libtomahawk/utils/TomahawkStyle.h | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/libtomahawk/playlist/ContextView.cpp b/src/libtomahawk/playlist/ContextView.cpp index 9a5705cca..64f654b4a 100644 --- a/src/libtomahawk/playlist/ContextView.cpp +++ b/src/libtomahawk/playlist/ContextView.cpp @@ -48,12 +48,12 @@ ContextView::ContextView( QWidget* parent, const QString& caption ) TrackItemDelegate* del = new TrackItemDelegate( TrackItemDelegate::LovedTracks, m_trackView, m_trackView->proxyModel() ); m_trackView->setPlaylistItemDelegate( del ); m_trackView->proxyModel()->setStyle( PlayableProxyModel::Fancy ); + m_trackView->setStyleSheet( QString( "QTreeView { background-color: %1; }" ).arg( TomahawkStyle::PAGE_BACKGROUND.name() ) ); TomahawkStyle::styleScrollBar( m_trackView->verticalScrollBar() ); setLayout( new QVBoxLayout() ); TomahawkUtils::unmarginLayout( layout() ); - m_trackView->setStyleSheet( QString( "QTreeView { background-color: %1; }" ).arg( TomahawkStyle::PAGE_BACKGROUND.name() ) ); m_captionLabel = new CaptionLabel( this ); setCaption( caption ); @@ -119,7 +119,7 @@ ContextView::setTrackView( TrackView* view ) } m_trackView = view; - m_trackView->setStyleSheet( QString( "QTreeView { background-color: white; }" ) ); + m_trackView->setStyleSheet( QString( "QTreeView { background-color: %1; }" ).arg( TomahawkStyle::PAGE_BACKGROUND.name() ) ); TomahawkStyle::styleScrollBar( m_trackView->verticalScrollBar() ); m_innerLayout->insertWidget( 0, view, 1 ); diff --git a/src/libtomahawk/playlist/PlaylistItemDelegate.cpp b/src/libtomahawk/playlist/PlaylistItemDelegate.cpp index 68ec64471..f70f2aafc 100644 --- a/src/libtomahawk/playlist/PlaylistItemDelegate.cpp +++ b/src/libtomahawk/playlist/PlaylistItemDelegate.cpp @@ -45,6 +45,7 @@ #include "utils/ImageRegistry.h" #include "utils/PixmapDelegateFader.h" #include "utils/Closure.h" +#include "utils/TomahawkStyle.h" #include "utils/TomahawkUtilsGui.h" #include "utils/Logger.h" @@ -560,11 +561,11 @@ PlaylistItemDelegate::drawTrack( QPainter* painter, const QStyleOptionViewItem& if ( option.state & QStyle::State_Selected ) { - painter->setPen( QColor( "#f8f8f8" ) ); - painter->setBrush( QColor( "#f8f8f8" ) ); + painter->setPen( TomahawkStyle::SELECTION_BACKGROUND ); + painter->setBrush( TomahawkStyle::SELECTION_BACKGROUND ); painter->drawRect( rect.adjusted( 0, 4, -rightMargin, -4 ) ); } - painter->setPen( QColor( "#000000" ) ); + painter->setPen( TomahawkStyle::SELECTION_FOREGROUND ); QRect r = rect.adjusted( 32, 6, -32 -rightMargin, -6 ); const int margin = 8; diff --git a/src/libtomahawk/utils/TomahawkStyle.h b/src/libtomahawk/utils/TomahawkStyle.h index ee1057441..e16b34d49 100644 --- a/src/libtomahawk/utils/TomahawkStyle.h +++ b/src/libtomahawk/utils/TomahawkStyle.h @@ -50,7 +50,7 @@ namespace TomahawkStyle DLLEXPORT void stylePageWidget( QWidget* widget ); DLLEXPORT void styleScrollBar( QScrollBar* scrollBar ); - static const QColor PAGE_BACKGROUND = QColor( "#F9F9F9" ); + static const QColor PAGE_BACKGROUND = QColor( "#ffffff" ); static const QColor HEADER_LABEL = QColor( 255, 255, 255, 240 ); static const QColor HEADER_BACKGROUND = QColor( "#333333" ); @@ -63,8 +63,8 @@ namespace TomahawkStyle static const QColor NOW_PLAYING_ITEM = QColor( "#ff004c" ); static const QColor NOW_PLAYING_ITEM_TEXT = QColor( "#ffffff" ); - static const QColor SELECTION_BACKGROUND = QColor( "#7DC4FF" ); - static const QColor SELECTION_FOREGROUND = QColor( "#ffffff" ); + static const QColor SELECTION_BACKGROUND = QColor( "#f8f8f8" ); + static const QColor SELECTION_FOREGROUND = QColor( "#000000" ); static const QColor HEADER_TEXT = QColor( "#DBDBDB" ); static const QColor HEADER_LINK = QColor( "#7DC4FF" );