From 7571e58ce5aa7043de0e1a5ee4a2baa30f935301 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Mon, 30 Oct 2023 21:14:03 +0200 Subject: [PATCH] [Qt] Add pink theme --- include/panda_qt/main_window.hpp | 1 + src/panda_qt/main_window.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/include/panda_qt/main_window.hpp b/include/panda_qt/main_window.hpp index f9eb4f630..31fb1e0d3 100644 --- a/include/panda_qt/main_window.hpp +++ b/include/panda_qt/main_window.hpp @@ -23,6 +23,7 @@ class MainWindow : public QMainWindow { System = 0, Light = 1, Dark = 2, + GreetingsCat = 3, }; // Types of messages we might send from the GUI thread to the emulator thread diff --git a/src/panda_qt/main_window.cpp b/src/panda_qt/main_window.cpp index adfd3470e..33e27a0d7 100644 --- a/src/panda_qt/main_window.cpp +++ b/src/panda_qt/main_window.cpp @@ -43,6 +43,7 @@ MainWindow::MainWindow(QApplication* app, QWidget* parent) : QMainWindow(parent) themeSelect->addItem(tr("System")); themeSelect->addItem(tr("Light")); themeSelect->addItem(tr("Dark")); + themeSelect->addItem(tr("Greetings Cat")); themeSelect->setCurrentIndex(static_cast(currentTheme)); themeSelect->setGeometry(40, 40, 100, 50); @@ -192,6 +193,29 @@ void MainWindow::setTheme(Theme theme) { break; } + case Theme::GreetingsCat: { + QApplication::setStyle(QStyleFactory::create("Fusion")); + + QPalette p; + p.setColor(QPalette::Window, QColor(250, 207, 228)); + p.setColor(QPalette::WindowText, QColor(225, 22, 137)); + p.setColor(QPalette::Base, QColor(250, 207, 228)); + p.setColor(QPalette::AlternateBase, QColor(250, 207, 228)); + p.setColor(QPalette::ToolTipBase, QColor(225, 22, 137)); + p.setColor(QPalette::ToolTipText, QColor(225, 22, 137)); + p.setColor(QPalette::Text, QColor(225, 22, 137)); + p.setColor(QPalette::Button, QColor(250, 207, 228)); + p.setColor(QPalette::ButtonText, QColor(225, 22, 137)); + p.setColor(QPalette::BrightText, Qt::black); + 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); + break; + } + + case Theme::System: { qApp->setPalette(this->style()->standardPalette()); qApp->setStyle(QStyleFactory::create("WindowsVista"));