mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
enabled dark fusion theme
This commit is contained in:
parent
8173b3d60d
commit
aefdb60ada
30
src/main.cpp
30
src/main.cpp
|
@ -9,6 +9,7 @@
|
|||
#include <QFile>
|
||||
#include <QLibrary>
|
||||
#include <QStringList>
|
||||
#include <QStyleFactory>
|
||||
|
||||
#ifdef USEWINSDK
|
||||
#include "util/nativeeventhelper.hpp"
|
||||
|
@ -51,6 +52,35 @@ int runGui(int argc, char *argv[])
|
|||
// QApplication::setAttribute(Qt::AA_UseSoftwareOpenGL, true);
|
||||
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
|
||||
#ifdef USEWINSDK
|
||||
a.installNativeEventFilter(new chatterino::util::DpiNativeEventFilter);
|
||||
|
|
Loading…
Reference in a new issue