#include <windows.h>
#include <stdio.h>
#include <shellapi.h>
+#include <QSettings>
+#include <QStyleFactory>
#endif
#include <time.h>
#include <memory>
SetArgcArgv(argc,argv);
Application app(argc, argv);
+#ifdef WIN32
+ QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize",
+ QSettings::NativeFormat);
+ if(settings.value("AppsUseLightTheme")==0){
+ app.setStyle(QStyleFactory::create("Fusion"));
+ QPalette darkPalette;
+ QColor darkColor = QColor(45,45,45);
+ QColor disabledColor = QColor(127,127,127);
+ darkPalette.setColor(QPalette::Window, darkColor);
+ darkPalette.setColor(QPalette::WindowText, Qt::white);
+ darkPalette.setColor(QPalette::Base, QColor(18,18,18));
+ darkPalette.setColor(QPalette::AlternateBase, darkColor);
+ darkPalette.setColor(QPalette::ToolTipBase, Qt::white);
+ darkPalette.setColor(QPalette::ToolTipText, Qt::white);
+ darkPalette.setColor(QPalette::Text, Qt::white);
+ darkPalette.setColor(QPalette::Disabled, QPalette::Text, disabledColor);
+ darkPalette.setColor(QPalette::Button, darkColor);
+ darkPalette.setColor(QPalette::ButtonText, Qt::white);
+ darkPalette.setColor(QPalette::Disabled, QPalette::ButtonText, disabledColor);
+ darkPalette.setColor(QPalette::BrightText, Qt::red);
+ darkPalette.setColor(QPalette::Link, QColor(42, 130, 218));
+ darkPalette.setColor(QPalette::Highlight, QColor(42, 130, 218));
+ darkPalette.setColor(QPalette::HighlightedText, Qt::black);
+ darkPalette.setColor(QPalette::Disabled, QPalette::HighlightedText, disabledColor);
+ darkPalette.setColor(QPalette::PlaceholderText, Qt::white);
+ darkPalette.setColor(QPalette::NoRole, Qt::white);
+
+ app.setPalette(darkPalette);
+ app.setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }");
+ }
+#endif
// Initialize Python (only once)
// Note: Python forces setting locale LC_CTYPE to system one: setlocale(LC_CTYPE, "").
char *py_argv[] = {(char *)""};