mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-14 08:12:16 +00:00
OLED Theme (#2530)
* OLED Theme * improve check box & text box visibility * clang format --------- Co-authored-by: smiRaphi <neogt404@gmail.com>
This commit is contained in:
parent
927f398658
commit
63b50ff92c
4 changed files with 46 additions and 1 deletions
|
@ -130,6 +130,7 @@ void MainWindow::CreateActions() {
|
||||||
m_theme_act_group->addAction(ui->setThemeViolet);
|
m_theme_act_group->addAction(ui->setThemeViolet);
|
||||||
m_theme_act_group->addAction(ui->setThemeGruvbox);
|
m_theme_act_group->addAction(ui->setThemeGruvbox);
|
||||||
m_theme_act_group->addAction(ui->setThemeTokyoNight);
|
m_theme_act_group->addAction(ui->setThemeTokyoNight);
|
||||||
|
m_theme_act_group->addAction(ui->setThemeOled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::AddUiWidgets() {
|
void MainWindow::AddUiWidgets() {
|
||||||
|
@ -651,6 +652,14 @@ void MainWindow::CreateConnects() {
|
||||||
isIconBlack = false;
|
isIconBlack = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
connect(ui->setThemeOled, &QAction::triggered, &m_window_themes, [this]() {
|
||||||
|
m_window_themes.SetWindowTheme(Theme::Oled, ui->mw_searchbar);
|
||||||
|
Config::setMainWindowTheme(static_cast<int>(Theme::Oled));
|
||||||
|
if (isIconBlack) {
|
||||||
|
SetUiIcons(false);
|
||||||
|
isIconBlack = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::StartGame() {
|
void MainWindow::StartGame() {
|
||||||
|
@ -1098,6 +1107,11 @@ void MainWindow::SetLastUsedTheme() {
|
||||||
isIconBlack = false;
|
isIconBlack = false;
|
||||||
SetUiIcons(false);
|
SetUiIcons(false);
|
||||||
break;
|
break;
|
||||||
|
case Theme::Oled:
|
||||||
|
ui->setThemeOled->setChecked(true);
|
||||||
|
isIconBlack = false;
|
||||||
|
SetUiIcons(false);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) {
|
void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) {
|
||||||
QPalette themePalette;
|
QPalette themePalette;
|
||||||
|
|
||||||
|
qApp->setStyleSheet("");
|
||||||
switch (theme) {
|
switch (theme) {
|
||||||
case Theme::Dark:
|
case Theme::Dark:
|
||||||
mw_searchbar->setStyleSheet(
|
mw_searchbar->setStyleSheet(
|
||||||
|
@ -165,5 +166,29 @@ 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::Oled:
|
||||||
|
mw_searchbar->setStyleSheet("QLineEdit:focus {"
|
||||||
|
"border: 1px solid #2A82DA; }");
|
||||||
|
themePalette.setColor(QPalette::Window, Qt::black);
|
||||||
|
themePalette.setColor(QPalette::WindowText, Qt::white);
|
||||||
|
themePalette.setColor(QPalette::Base, Qt::black);
|
||||||
|
themePalette.setColor(QPalette::AlternateBase, Qt::black);
|
||||||
|
themePalette.setColor(QPalette::ToolTipBase, Qt::black);
|
||||||
|
themePalette.setColor(QPalette::ToolTipText, Qt::white);
|
||||||
|
themePalette.setColor(QPalette::Text, Qt::white);
|
||||||
|
themePalette.setColor(QPalette::Button, QColor(5, 5, 5));
|
||||||
|
themePalette.setColor(QPalette::ButtonText, Qt::white);
|
||||||
|
themePalette.setColor(QPalette::BrightText, Qt::red);
|
||||||
|
themePalette.setColor(QPalette::Link, QColor(42, 130, 218));
|
||||||
|
themePalette.setColor(QPalette::Highlight, QColor(42, 130, 218));
|
||||||
|
themePalette.setColor(QPalette::HighlightedText, Qt::black);
|
||||||
|
qApp->setPalette(themePalette);
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -7,7 +7,7 @@
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
enum class Theme : int { Dark, Light, Green, Blue, Violet, Gruvbox, TokyoNight };
|
enum class Theme : int { Dark, Light, Green, Blue, Violet, Gruvbox, TokyoNight, Oled };
|
||||||
|
|
||||||
class WindowThemes : public QObject {
|
class WindowThemes : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
|
@ -39,6 +39,7 @@ public:
|
||||||
QAction* setThemeViolet;
|
QAction* setThemeViolet;
|
||||||
QAction* setThemeGruvbox;
|
QAction* setThemeGruvbox;
|
||||||
QAction* setThemeTokyoNight;
|
QAction* setThemeTokyoNight;
|
||||||
|
QAction* setThemeOled;
|
||||||
QWidget* centralWidget;
|
QWidget* centralWidget;
|
||||||
QLineEdit* mw_searchbar;
|
QLineEdit* mw_searchbar;
|
||||||
QPushButton* playButton;
|
QPushButton* playButton;
|
||||||
|
@ -171,6 +172,9 @@ public:
|
||||||
setThemeTokyoNight = new QAction(MainWindow);
|
setThemeTokyoNight = new QAction(MainWindow);
|
||||||
setThemeTokyoNight->setObjectName("setThemeTokyoNight");
|
setThemeTokyoNight->setObjectName("setThemeTokyoNight");
|
||||||
setThemeTokyoNight->setCheckable(true);
|
setThemeTokyoNight->setCheckable(true);
|
||||||
|
setThemeOled = new QAction(MainWindow);
|
||||||
|
setThemeOled->setObjectName("setThemeOled");
|
||||||
|
setThemeOled->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());
|
||||||
|
@ -303,6 +307,7 @@ public:
|
||||||
menuThemes->addAction(setThemeViolet);
|
menuThemes->addAction(setThemeViolet);
|
||||||
menuThemes->addAction(setThemeGruvbox);
|
menuThemes->addAction(setThemeGruvbox);
|
||||||
menuThemes->addAction(setThemeTokyoNight);
|
menuThemes->addAction(setThemeTokyoNight);
|
||||||
|
menuThemes->addAction(setThemeOled);
|
||||||
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);
|
||||||
|
@ -393,6 +398,7 @@ public:
|
||||||
setThemeViolet->setText(QCoreApplication::translate("MainWindow", "Violet", nullptr));
|
setThemeViolet->setText(QCoreApplication::translate("MainWindow", "Violet", nullptr));
|
||||||
setThemeGruvbox->setText("Gruvbox");
|
setThemeGruvbox->setText("Gruvbox");
|
||||||
setThemeTokyoNight->setText("Tokyo Night");
|
setThemeTokyoNight->setText("Tokyo Night");
|
||||||
|
setThemeOled->setText("OLED");
|
||||||
toolBar->setWindowTitle(QCoreApplication::translate("MainWindow", "toolBar", nullptr));
|
toolBar->setWindowTitle(QCoreApplication::translate("MainWindow", "toolBar", nullptr));
|
||||||
} // retranslateUi
|
} // retranslateUi
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue