From 8f3ea57a64b5ee9d2480e802518e7cfd79a76add Mon Sep 17 00:00:00 2001 From: David Sansome Date: Mon, 19 Sep 2011 11:05:38 +0100 Subject: [PATCH] Fix the background colour of items in the global search popup in Qt 4.7 with the GTK style. --- src/globalsearch/globalsearchwidget.cpp | 3 +++ src/playlist/playlistview.h | 1 + 2 files changed, 4 insertions(+) diff --git a/src/globalsearch/globalsearchwidget.cpp b/src/globalsearch/globalsearchwidget.cpp index ef2024d5f..0119b96e2 100644 --- a/src/globalsearch/globalsearchwidget.cpp +++ b/src/globalsearch/globalsearchwidget.cpp @@ -26,6 +26,7 @@ #include "core/logging.h" #include "core/stylesheetloader.h" #include "core/utilities.h" +#include "playlist/playlistview.h" #include "playlist/songmimedata.h" #include "widgets/stylehelper.h" @@ -132,6 +133,8 @@ void GlobalSearchWidget::Init(LibraryBackendInterface* library) { engine_->AddProvider(new SpotifySearchProvider(engine_)); #endif + view_->setStyle(new PlaylistProxyStyle(style())); + // The style helper's base color doesn't get initialised until after the // constructor. QPalette view_palette = view_->palette(); diff --git a/src/playlist/playlistview.h b/src/playlist/playlistview.h index cfa4b6e86..31dbf3f5f 100644 --- a/src/playlist/playlistview.h +++ b/src/playlist/playlistview.h @@ -40,6 +40,7 @@ class RatingItemDelegate; // the caller set in the QStyleOption. That breaks our currently playing track // animation, which relies on the background painted by Qt to be transparent. // This proxy style uses QCleanlooksStyle to paint the affected elements. +// This class is used by the global search view as well. class PlaylistProxyStyle : public QProxyStyle { public: PlaylistProxyStyle(QStyle* base);