Skip to content

Commit 49f62a3

Browse files
authored
enable dark theme (#263)
1 parent 2725dd1 commit 49f62a3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/controller/application.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ bool Application::isDarkTheme()
8282
"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize",
8383
QSettings::NativeFormat);
8484
return settings.value("AppsUseLightTheme", 1).toInt() == 0;
85-
#elif 0 // Disabled as there is currently no straightforward way to detect dark mode in Linux.
85+
#else
86+
// There is currently no straightforward way to detect dark mode in Linux, but this works for supported OS-s.
8687
static const bool isDarkTheme = [] {
8788
QProcess p;
88-
p.start(QStringLiteral("gsettings"), {"get", "org.gnome.desktop.interface", "gtk-theme"});
89+
p.start(QStringLiteral("gsettings"), {"get", "org.gnome.desktop.interface", "color-scheme"});
8990
if (p.waitForFinished()) {
9091
return p.readAllStandardOutput().contains("dark");
9192
}
@@ -94,8 +95,6 @@ bool Application::isDarkTheme()
9495
return text_hsv_value > bg_hsv_value;
9596
}();
9697
return isDarkTheme;
97-
#else
98-
return false;
9998
#endif
10099
}
101100
#endif

0 commit comments

Comments
 (0)