Skip to content

Commit

Permalink
[Qt] Add pink theme
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfoodat committed Oct 30, 2023
1 parent b026123 commit 7571e58
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/panda_qt/main_window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions src/panda_qt/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(currentTheme));

themeSelect->setGeometry(40, 40, 100, 50);
Expand Down Expand Up @@ -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"));
Expand Down

0 comments on commit 7571e58

Please sign in to comment.