Move PlaylistProxyStyle to it's own file
This commit is contained in:
@@ -40,12 +40,9 @@
|
||||
#include <QRect>
|
||||
#include <QRegion>
|
||||
#include <QStyleOption>
|
||||
#include <QProxyStyle>
|
||||
#include <QPoint>
|
||||
#include <QBasicTimer>
|
||||
#include <QCommonStyle>
|
||||
|
||||
#include "core/scoped_ptr.h"
|
||||
#include "core/song.h"
|
||||
#include "covermanager/albumcoverloaderresult.h"
|
||||
#include "settings/appearancesettingspage.h"
|
||||
@@ -72,27 +69,10 @@ class QTimerEvent;
|
||||
class Application;
|
||||
class CollectionBackend;
|
||||
class PlaylistHeader;
|
||||
class PlaylistProxyStyle;
|
||||
class DynamicPlaylistControls;
|
||||
class RatingItemDelegate;
|
||||
|
||||
// This proxy style works around a bug/feature introduced in Qt 4.7's QGtkStyle
|
||||
// that uses Gtk to paint row backgrounds, ignoring any custom brush or palette 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 QCommonStyle to paint the affected elements.
|
||||
// This class is used by internet search view as well.
|
||||
class PlaylistProxyStyle : public QProxyStyle {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PlaylistProxyStyle(const QString &style);
|
||||
|
||||
void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const override;
|
||||
void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const override;
|
||||
|
||||
private:
|
||||
ScopedPtr<QCommonStyle> common_style_;
|
||||
};
|
||||
|
||||
class PlaylistView : public QTreeView {
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user