Skip to content

Commit

Permalink
audqt: Fix tab close buttons in dark theme with Qt 6.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
jlindgren90 committed Mar 8, 2024
1 parent a9d6280 commit 56e8705
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/libaudqt/dark-theme.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,22 @@ class DarkStyle : public QProxyStyle
public:
DarkStyle() : QProxyStyle("fusion") {}

void polish(QApplication * app) override { QProxyStyle::polish(app); };
void polish(QApplication * app) override { QProxyStyle::polish(app); }
void polish(QWidget * widget) override { QProxyStyle::polish(widget); }
void polish(QPalette & palette) override;

/* Qt 6.3+ no longer uses the theme icon "window-close" for tabs,
* but instead forces a built-in icon. Override it back. */
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
QIcon standardIcon(StandardPixmap standardIcon,
const QStyleOption * option = nullptr,
const QWidget * widget = nullptr) const override
{
if (standardIcon == QStyle::SP_TabCloseButton)
return QIcon::fromTheme("window-close");
return QProxyStyle::standardIcon(standardIcon, option, widget);
}
#endif
};

void DarkStyle::polish(QPalette & palette)
Expand Down

2 comments on commit 56e8705

@radioactiveman
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jlindgren90: What do you think about making Qt 6 the default for Audacious 4.4?
Qt 5 support has officially ended (https://doc.qt.io/qt-6.6/supported-platforms.html#supported-qt-versions).
The only drawback I see is that we support Qt 6 only with Meson so the default Qt version between autotools and Meson would then differ.

@jlindgren90
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qt 6 as default sounds good to me. With KDE having switched to it now, it's perfect timing 👍

Please sign in to comment.