enabled dark fusion theme

This commit is contained in:
fourtf 2018-05-23 19:42:42 +02:00
parent 8173b3d60d
commit aefdb60ada

View file

@ -9,6 +9,7 @@
#include <QFile> #include <QFile>
#include <QLibrary> #include <QLibrary>
#include <QStringList> #include <QStringList>
#include <QStyleFactory>
#ifdef USEWINSDK #ifdef USEWINSDK
#include "util/nativeeventhelper.hpp" #include "util/nativeeventhelper.hpp"
@ -51,6 +52,35 @@ int runGui(int argc, char *argv[])
// QApplication::setAttribute(Qt::AA_UseSoftwareOpenGL, true); // QApplication::setAttribute(Qt::AA_UseSoftwareOpenGL, true);
QApplication a(argc, argv); QApplication a(argc, argv);
QApplication::setStyle(QStyleFactory::create("Fusion"));
// borrowed from
// https://stackoverflow.com/questions/15035767/is-the-qt-5-dark-fusion-theme-available-for-windows
QPalette darkPalette = a.palette();
darkPalette.setColor(QPalette::Window, QColor(33, 33, 33));
darkPalette.setColor(QPalette::WindowText, Qt::white);
darkPalette.setColor(QPalette::Text, Qt::white);
darkPalette.setColor(QPalette::Disabled, QPalette::WindowText, QColor(127, 127, 127));
darkPalette.setColor(QPalette::Base, QColor(90, 90, 90));
darkPalette.setColor(QPalette::AlternateBase, QColor(66, 66, 66));
darkPalette.setColor(QPalette::ToolTipBase, Qt::white);
darkPalette.setColor(QPalette::ToolTipText, Qt::white);
darkPalette.setColor(QPalette::Disabled, QPalette::Text, QColor(127, 127, 127));
darkPalette.setColor(QPalette::Dark, QColor(35, 35, 35));
darkPalette.setColor(QPalette::Shadow, QColor(20, 20, 20));
darkPalette.setColor(QPalette::Button, QColor(70, 70, 70));
darkPalette.setColor(QPalette::ButtonText, Qt::white);
darkPalette.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(127, 127, 127));
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::Disabled, QPalette::Highlight, QColor(80, 80, 80));
darkPalette.setColor(QPalette::HighlightedText, Qt::white);
darkPalette.setColor(QPalette::Disabled, QPalette::HighlightedText, QColor(127, 127, 127));
qApp->setPalette(darkPalette);
// Install native event handler for hidpi on windows // Install native event handler for hidpi on windows
#ifdef USEWINSDK #ifdef USEWINSDK
a.installNativeEventFilter(new chatterino::util::DpiNativeEventFilter); a.installNativeEventFilter(new chatterino::util::DpiNativeEventFilter);