PlaylistView: Create proxy style based on application style

Fixes #1275
This commit is contained in:
Jonas Kvinge 2023-10-07 14:48:40 +02:00
parent 2a9b32690d
commit e172c4871c
2 changed files with 3 additions and 3 deletions

View File

@ -88,7 +88,7 @@ const int PlaylistView::kAutoscrollGraceTimeout = 30; // seconds
const int PlaylistView::kDropIndicatorWidth = 2;
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 {
@ -131,7 +131,7 @@ void PlaylistProxyStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
PlaylistView::PlaylistView(QWidget *parent)
: QTreeView(parent),
app_(nullptr),
style_(new PlaylistProxyStyle()),
style_(new PlaylistProxyStyle(QApplication::style()->name())),
playlist_(nullptr),
header_(new PlaylistHeader(Qt::Horizontal, this, this)),
background_image_type_(AppearanceSettingsPage::BackgroundImageType::Default),

View File

@ -84,7 +84,7 @@ class PlaylistProxyStyle : public QProxyStyle {
Q_OBJECT
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 drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const override;