Skip to content

Commit

Permalink
Fix applying dark scheme when QT_STYLE_OVERRIDE is set
Browse files Browse the repository at this point in the history
When QT_STYLE_OVERRIDE is set to something like "Adwaita-dark" it breaks the theme since it doesn't apply the corresponding color scheme.
We should rely on QT_STYLE_OVERRIDE when deciding whether to use the dark theme.

Signed-off-by: Pavel Artsishevsky <[email protected]>
  • Loading branch information
polter-rnd authored and urFate committed Nov 1, 2022
1 parent a0a6446 commit 2f8a153
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/common/gnomesettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,11 @@ bool GnomeSettings::canUseFileChooserPortal() const

bool GnomeSettings::useGtkThemeDarkVariant() const
{
const QString theme = m_hintProvider->gtkTheme();

if (m_hintProvider->canRelyOnAppearance()) {
QString theme = m_hintProvider->gtkTheme();
if (qEnvironmentVariableIsSet("QT_STYLE_OVERRIDE")) {
/* If QT_STYLE_OVERRIDE we should rely on it */
theme = QString::fromLocal8Bit(qgetenv("QT_STYLE_OVERRIDE"));
} else if (m_hintProvider->canRelyOnAppearance()) {
return m_hintProvider->appearance() == PreferDark;
}

Expand Down

0 comments on commit 2f8a153

Please sign in to comment.