PlaylistView: Create proxy style based on application style
Fixes #1275
This commit is contained in:
@@ -88,7 +88,7 @@ const int PlaylistView::kAutoscrollGraceTimeout = 30; // seconds
|
|||||||
const int PlaylistView::kDropIndicatorWidth = 2;
|
const int PlaylistView::kDropIndicatorWidth = 2;
|
||||||
const int PlaylistView::kDropIndicatorGradientWidth = 5;
|
const int PlaylistView::kDropIndicatorGradientWidth = 5;
|
||||||
|
|
||||||
PlaylistProxyStyle::PlaylistProxyStyle(QObject*) : QProxyStyle(nullptr), common_style_(new QCommonStyle) {}
|
PlaylistProxyStyle::PlaylistProxyStyle(const QString &style) : QProxyStyle(style), common_style_(new QCommonStyle) {}
|
||||||
|
|
||||||
void PlaylistProxyStyle::drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const {
|
void PlaylistProxyStyle::drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const {
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ void PlaylistProxyStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
|
|||||||
PlaylistView::PlaylistView(QWidget *parent)
|
PlaylistView::PlaylistView(QWidget *parent)
|
||||||
: QTreeView(parent),
|
: QTreeView(parent),
|
||||||
app_(nullptr),
|
app_(nullptr),
|
||||||
style_(new PlaylistProxyStyle()),
|
style_(new PlaylistProxyStyle(QApplication::style()->name())),
|
||||||
playlist_(nullptr),
|
playlist_(nullptr),
|
||||||
header_(new PlaylistHeader(Qt::Horizontal, this, this)),
|
header_(new PlaylistHeader(Qt::Horizontal, this, this)),
|
||||||
background_image_type_(AppearanceSettingsPage::BackgroundImageType::Default),
|
background_image_type_(AppearanceSettingsPage::BackgroundImageType::Default),
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ class PlaylistProxyStyle : public QProxyStyle {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PlaylistProxyStyle(QObject *parent = nullptr);
|
explicit PlaylistProxyStyle(const QString &style);
|
||||||
|
|
||||||
void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const override;
|
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;
|
void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const override;
|
||||||
|
|||||||
Reference in New Issue
Block a user