mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-14 08:12:16 +00:00
style: add Gruvbox theme (#1796)
This commit is contained in:
parent
0fd1ab674b
commit
d2ac92481b
4 changed files with 40 additions and 9 deletions
|
@ -111,6 +111,7 @@ void MainWindow::CreateActions() {
|
||||||
m_theme_act_group->addAction(ui->setThemeGreen);
|
m_theme_act_group->addAction(ui->setThemeGreen);
|
||||||
m_theme_act_group->addAction(ui->setThemeBlue);
|
m_theme_act_group->addAction(ui->setThemeBlue);
|
||||||
m_theme_act_group->addAction(ui->setThemeViolet);
|
m_theme_act_group->addAction(ui->setThemeViolet);
|
||||||
|
m_theme_act_group->addAction(ui->setThemeGruvbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::AddUiWidgets() {
|
void MainWindow::AddUiWidgets() {
|
||||||
|
@ -540,6 +541,14 @@ void MainWindow::CreateConnects() {
|
||||||
isIconBlack = false;
|
isIconBlack = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
connect(ui->setThemeGruvbox, &QAction::triggered, &m_window_themes, [this]() {
|
||||||
|
m_window_themes.SetWindowTheme(Theme::Gruvbox, ui->mw_searchbar);
|
||||||
|
Config::setMainWindowTheme(static_cast<int>(Theme::Gruvbox));
|
||||||
|
if (isIconBlack) {
|
||||||
|
SetUiIcons(false);
|
||||||
|
isIconBlack = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::StartGame() {
|
void MainWindow::StartGame() {
|
||||||
|
@ -912,6 +921,10 @@ void MainWindow::SetLastUsedTheme() {
|
||||||
ui->setThemeViolet->setChecked(true);
|
ui->setThemeViolet->setChecked(true);
|
||||||
isIconBlack = false;
|
isIconBlack = false;
|
||||||
SetUiIcons(false);
|
SetUiIcons(false);
|
||||||
|
case Theme::Gruvbox:
|
||||||
|
ui->setThemeGruvbox->setChecked(true);
|
||||||
|
isIconBlack = false;
|
||||||
|
SetUiIcons(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) {
|
||||||
themePalette.setColor(QPalette::Window, QColor(50, 50, 50));
|
themePalette.setColor(QPalette::Window, QColor(50, 50, 50));
|
||||||
themePalette.setColor(QPalette::WindowText, Qt::white);
|
themePalette.setColor(QPalette::WindowText, Qt::white);
|
||||||
themePalette.setColor(QPalette::Base, QColor(20, 20, 20));
|
themePalette.setColor(QPalette::Base, QColor(20, 20, 20));
|
||||||
themePalette.setColor(QPalette::AlternateBase, QColor(25, 25, 25));
|
|
||||||
themePalette.setColor(QPalette::AlternateBase, QColor(53, 53, 53));
|
themePalette.setColor(QPalette::AlternateBase, QColor(53, 53, 53));
|
||||||
themePalette.setColor(QPalette::ToolTipBase, Qt::white);
|
themePalette.setColor(QPalette::ToolTipBase, Qt::white);
|
||||||
themePalette.setColor(QPalette::ToolTipText, Qt::white);
|
themePalette.setColor(QPalette::ToolTipText, Qt::white);
|
||||||
|
@ -28,7 +27,6 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) {
|
||||||
themePalette.setColor(QPalette::HighlightedText, Qt::black);
|
themePalette.setColor(QPalette::HighlightedText, Qt::black);
|
||||||
qApp->setPalette(themePalette);
|
qApp->setPalette(themePalette);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Theme::Light:
|
case Theme::Light:
|
||||||
mw_searchbar->setStyleSheet("background-color: #ffffff;" // Light gray background
|
mw_searchbar->setStyleSheet("background-color: #ffffff;" // Light gray background
|
||||||
"color: #000000;" // Black text
|
"color: #000000;" // Black text
|
||||||
|
@ -115,6 +113,26 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) {
|
||||||
themePalette.setColor(QPalette::Highlight, QColor(42, 130, 218)); // Light blue highlight
|
themePalette.setColor(QPalette::Highlight, QColor(42, 130, 218)); // Light blue highlight
|
||||||
themePalette.setColor(QPalette::HighlightedText, Qt::black); // Black highlighted text
|
themePalette.setColor(QPalette::HighlightedText, Qt::black); // Black highlighted text
|
||||||
|
|
||||||
|
qApp->setPalette(themePalette);
|
||||||
|
break;
|
||||||
|
case Theme::Gruvbox:
|
||||||
|
mw_searchbar->setStyleSheet("background-color: #1d2021;"
|
||||||
|
"color: #f9f5d7;"
|
||||||
|
"border: 2px solid #f9f5d7;"
|
||||||
|
"padding: 5px;");
|
||||||
|
themePalette.setColor(QPalette::Window, QColor(29, 32, 33));
|
||||||
|
themePalette.setColor(QPalette::WindowText, QColor(249, 245, 215));
|
||||||
|
themePalette.setColor(QPalette::Base, QColor(29, 32, 33));
|
||||||
|
themePalette.setColor(QPalette::AlternateBase, QColor(50, 48, 47));
|
||||||
|
themePalette.setColor(QPalette::ToolTipBase, QColor(249, 245, 215));
|
||||||
|
themePalette.setColor(QPalette::ToolTipText, QColor(249, 245, 215));
|
||||||
|
themePalette.setColor(QPalette::Text, QColor(249, 245, 215));
|
||||||
|
themePalette.setColor(QPalette::Button, QColor(40, 40, 40));
|
||||||
|
themePalette.setColor(QPalette::ButtonText, QColor(249, 245, 215));
|
||||||
|
themePalette.setColor(QPalette::BrightText, QColor(251, 73, 52));
|
||||||
|
themePalette.setColor(QPalette::Link, QColor(131, 165, 152));
|
||||||
|
themePalette.setColor(QPalette::Highlight, QColor(131, 165, 152));
|
||||||
|
themePalette.setColor(QPalette::HighlightedText, Qt::black);
|
||||||
qApp->setPalette(themePalette);
|
qApp->setPalette(themePalette);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,7 @@
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
enum class Theme : int {
|
enum class Theme : int { Dark, Light, Green, Blue, Violet, Gruvbox };
|
||||||
Dark,
|
|
||||||
Light,
|
|
||||||
Green,
|
|
||||||
Blue,
|
|
||||||
Violet,
|
|
||||||
};
|
|
||||||
|
|
||||||
class WindowThemes : public QObject {
|
class WindowThemes : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
|
@ -36,6 +36,7 @@ public:
|
||||||
QAction* setThemeGreen;
|
QAction* setThemeGreen;
|
||||||
QAction* setThemeBlue;
|
QAction* setThemeBlue;
|
||||||
QAction* setThemeViolet;
|
QAction* setThemeViolet;
|
||||||
|
QAction* setThemeGruvbox;
|
||||||
QWidget* centralWidget;
|
QWidget* centralWidget;
|
||||||
QLineEdit* mw_searchbar;
|
QLineEdit* mw_searchbar;
|
||||||
QPushButton* playButton;
|
QPushButton* playButton;
|
||||||
|
@ -158,6 +159,9 @@ public:
|
||||||
setThemeViolet = new QAction(MainWindow);
|
setThemeViolet = new QAction(MainWindow);
|
||||||
setThemeViolet->setObjectName("setThemeViolet");
|
setThemeViolet->setObjectName("setThemeViolet");
|
||||||
setThemeViolet->setCheckable(true);
|
setThemeViolet->setCheckable(true);
|
||||||
|
setThemeGruvbox = new QAction(MainWindow);
|
||||||
|
setThemeGruvbox->setObjectName("setThemeGruvbox");
|
||||||
|
setThemeGruvbox->setCheckable(true);
|
||||||
centralWidget = new QWidget(MainWindow);
|
centralWidget = new QWidget(MainWindow);
|
||||||
centralWidget->setObjectName("centralWidget");
|
centralWidget->setObjectName("centralWidget");
|
||||||
sizePolicy.setHeightForWidth(centralWidget->sizePolicy().hasHeightForWidth());
|
sizePolicy.setHeightForWidth(centralWidget->sizePolicy().hasHeightForWidth());
|
||||||
|
@ -282,6 +286,7 @@ public:
|
||||||
menuThemes->addAction(setThemeGreen);
|
menuThemes->addAction(setThemeGreen);
|
||||||
menuThemes->addAction(setThemeBlue);
|
menuThemes->addAction(setThemeBlue);
|
||||||
menuThemes->addAction(setThemeViolet);
|
menuThemes->addAction(setThemeViolet);
|
||||||
|
menuThemes->addAction(setThemeGruvbox);
|
||||||
menuGame_List_Icons->addAction(setIconSizeTinyAct);
|
menuGame_List_Icons->addAction(setIconSizeTinyAct);
|
||||||
menuGame_List_Icons->addAction(setIconSizeSmallAct);
|
menuGame_List_Icons->addAction(setIconSizeSmallAct);
|
||||||
menuGame_List_Icons->addAction(setIconSizeMediumAct);
|
menuGame_List_Icons->addAction(setIconSizeMediumAct);
|
||||||
|
@ -368,6 +373,7 @@ public:
|
||||||
setThemeGreen->setText(QCoreApplication::translate("MainWindow", "Green", nullptr));
|
setThemeGreen->setText(QCoreApplication::translate("MainWindow", "Green", nullptr));
|
||||||
setThemeBlue->setText(QCoreApplication::translate("MainWindow", "Blue", nullptr));
|
setThemeBlue->setText(QCoreApplication::translate("MainWindow", "Blue", nullptr));
|
||||||
setThemeViolet->setText(QCoreApplication::translate("MainWindow", "Violet", nullptr));
|
setThemeViolet->setText(QCoreApplication::translate("MainWindow", "Violet", nullptr));
|
||||||
|
setThemeGruvbox->setText("Gruvbox");
|
||||||
toolBar->setWindowTitle(QCoreApplication::translate("MainWindow", "toolBar", nullptr));
|
toolBar->setWindowTitle(QCoreApplication::translate("MainWindow", "toolBar", nullptr));
|
||||||
} // retranslateUi
|
} // retranslateUi
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue