diff --git a/include/frontend_settings.hpp b/include/frontend_settings.hpp index ae967879..c5c513de 100644 --- a/include/frontend_settings.hpp +++ b/include/frontend_settings.hpp @@ -11,6 +11,7 @@ struct FrontendSettings { Dark = 2, GreetingsCat = 3, Cream = 4, + Oled = 5, }; // Different panda-themed window icons diff --git a/src/panda_qt/config_window.cpp b/src/panda_qt/config_window.cpp index a4e43f52..f90d7539 100644 --- a/src/panda_qt/config_window.cpp +++ b/src/panda_qt/config_window.cpp @@ -71,6 +71,7 @@ ConfigWindow::ConfigWindow(ConfigCallback configCallback, MainWindowCallback win themeSelect->addItem(tr("Dark")); themeSelect->addItem(tr("Greetings Cat")); themeSelect->addItem(tr("Cream")); + themeSelect->addItem(tr("OLED")); themeSelect->setCurrentIndex(static_cast(config.frontendSettings.theme)); connect(themeSelect, &QComboBox::currentIndexChanged, this, [&](int index) { config.frontendSettings.theme = static_cast(index); @@ -437,6 +438,34 @@ void ConfigWindow::setTheme(Theme theme) { break; } + case Theme::Oled: { + QApplication::setStyle(QStyleFactory::create("Fusion")); + + QPalette p; + p.setColor(QPalette::Window, Qt::black); + p.setColor(QPalette::WindowText, Qt::white); + p.setColor(QPalette::Base, Qt::black); + p.setColor(QPalette::AlternateBase, Qt::black); + p.setColor(QPalette::ToolTipBase, Qt::black); + p.setColor(QPalette::ToolTipText, Qt::white); + p.setColor(QPalette::Text, Qt::white); + p.setColor(QPalette::Button, QColor(5, 5, 5)); + p.setColor(QPalette::ButtonText, Qt::white); + p.setColor(QPalette::BrightText, Qt::red); + p.setColor(QPalette::Link, QColor(42, 130, 218)); + + p.setColor(QPalette::Highlight, QColor(42, 130, 218)); + p.setColor(QPalette::HighlightedText, Qt::black); + qApp->setPalette(p); + qApp->setStyleSheet("QLineEdit {" + "background-color: #000000; color: #ffffff; border: 1px solid #a0a0a0; " + "border-radius: 4px; padding: 5px; }" + + "QCheckBox::indicator:unchecked {" + "border: 1px solid #808080; border-radius: 4px; }"); + break; + } + case Theme::System: { qApp->setPalette(this->style()->standardPalette()); qApp->setStyle(QStyleFactory::create("WindowsVista"));