Fix the background colour of items in the global search popup in Qt 4.7 with the GTK style.

This commit is contained in:
David Sansome 2011-09-19 11:05:38 +01:00
parent 66f9d3c8b0
commit 8f3ea57a64
2 changed files with 4 additions and 0 deletions

View File

@ -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();

View File

@ -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);