10#include <QFileInfoList>
15#include "common/Constants.h"
27 const QPalette defaultPalette;
28 const auto text = defaultPalette.color(QPalette::WindowText);
29 const auto window = defaultPalette.color(QPalette::Window);
30 return text.lightness() > window.lightness();
38 return isDarkMode() ? QStringLiteral(
"dark") : QStringLiteral(
"light");
44 const auto themeName = QStringLiteral(
"%1-%2").arg(kAppId,
iconMode());
45 if (QIcon::themeName().isEmpty() || QIcon::themeName().startsWith(kAppId))
46 QIcon::setThemeName(themeName);
48 QIcon::setFallbackThemeName(themeName);
49 QIcon::setFallbackSearchPaths({QStringLiteral(
":/icons/%1").arg(themeName)});
Definition IServerConfig.h:14
QString iconMode()
get a string for the iconMode
Definition StyleUtils.h:36
void updateIconTheme()
Definition StyleUtils.h:41
bool isDarkMode()
Detects dark mode in a universal manner (all Qt versions). Until better platform support is added,...
Definition StyleUtils.h:25