From 6d5ee052d5bf5445610092f08a0a68f0ea5d59d6 Mon Sep 17 00:00:00 2001 From: Craig Drummond Date: Wed, 6 Sep 2017 00:05:52 +0100 Subject: [PATCH] Use toolbutton palette to set text colour --- widgets/nowplayingwidget.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/widgets/nowplayingwidget.cpp b/widgets/nowplayingwidget.cpp index 57ef4e596..cdb781feb 100644 --- a/widgets/nowplayingwidget.cpp +++ b/widgets/nowplayingwidget.cpp @@ -41,6 +41,7 @@ #include #include #include +#include static const int constPollMpd = 2; // Poll every 2 seconds when playing @@ -447,8 +448,13 @@ void NowPlayingWidget::showEvent(QShowEvent *e) { QWidget::showEvent(e); if (!shown) { + QToolButton btn(this); + btn.ensurePolished(); + track->setPalette(btn.palette()); + artist->setPalette(btn.palette()); + time->setPalette(btn.palette()); slider->updateStyleSheet(); shown=true; - ratingWidget->setColor(VolumeSlider::clampColor(track->palette().text().color())); + ratingWidget->setColor(VolumeSlider::clampColor(btn.palette().text().color())); } }