From 9ef582bd6f05fd03b0b3cafc7ecbd040e108bd09 Mon Sep 17 00:00:00 2001 From: Daisouji <82060898+Daisouji@users.noreply.github.com> Date: Tue, 19 Jul 2022 21:12:00 -0400 Subject: [PATCH] QT: Implements 2 Theming options Added 2 New Theme options. --- pcsx2-qt/MainWindow.cpp | 58 ++++++++++++++++++- pcsx2-qt/Settings/InterfaceSettingsWidget.cpp | 4 ++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/pcsx2-qt/MainWindow.cpp b/pcsx2-qt/MainWindow.cpp index ccb485e87f..dfa0dff5de 100644 --- a/pcsx2-qt/MainWindow.cpp +++ b/pcsx2-qt/MainWindow.cpp @@ -622,7 +622,63 @@ void MainWindow::setStyleFromSettings() qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }"); } - else + else if (theme == "Ruby") + { + // Custom pallete by Daisouji, Black as main color andd Red as complimentary. + // Alternative dark theme. + qApp->setStyle(QStyleFactory::create("Fusion")); + + const QColor lighterGray(75, 75, 75); + const QColor gray(128, 128, 128); + const QColor black(25, 25, 25); + const QColor slate(18, 18, 18); + const QColor rubyish(172,21,31); + + + QPalette darkPalette; + darkPalette.setColor(QPalette::Window, slate); + darkPalette.setColor(QPalette::WindowText, Qt::white); + darkPalette.setColor(QPalette::Base, slate.lighter()); + darkPalette.setColor(QPalette::AlternateBase, slate.lighter()); + darkPalette.setColor(QPalette::ToolTipBase, slate); + darkPalette.setColor(QPalette::ToolTipText, Qt::white); + darkPalette.setColor(QPalette::Text, Qt::white); + darkPalette.setColor(QPalette::Button, slate); + darkPalette.setColor(QPalette::ButtonText, Qt::white); + darkPalette.setColor(QPalette::Link, Qt::white); + darkPalette.setColor(QPalette::Highlight, rubyish); + darkPalette.setColor(QPalette::HighlightedText, Qt::white); + + darkPalette.setColor(QPalette::Active, QPalette::Button, slate.lighter()); + darkPalette.setColor(QPalette::Disabled, QPalette::ButtonText, gray); + darkPalette.setColor(QPalette::Disabled, QPalette::WindowText, gray); + darkPalette.setColor(QPalette::Disabled, QPalette::Text, gray); + darkPalette.setColor(QPalette::Disabled, QPalette::Light, slate.lighter()); + + qApp->setPalette(darkPalette); + + qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }"); + } + else if (theme == "Custom") + { + + //Additional Theme option than loads .qss from main PCSX2 Directory + qApp->setStyle(QStyleFactory::create("Fusion")); + + QString sheet_content; + QFile sheets("./custom.qss"); + + if(sheets.open(QFile::ReadOnly)){ + QString sheet_content = QString::fromUtf8(sheets.readAll().data()); + qApp->setStyleSheet(sheet_content); + } + else + { + qApp->setStyle(QStyleFactory::create("Fusion")); + } + + } + else { qApp->setPalette(QApplication::style()->standardPalette()); qApp->setStyleSheet(QString()); diff --git a/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp b/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp index 478b66c562..9a500d7347 100644 --- a/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp +++ b/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp @@ -30,6 +30,8 @@ static const char* THEME_NAMES[] = { QT_TRANSLATE_NOOP("InterfaceSettingsWidget", "Baby Pastel (Pink) [Light]"), QT_TRANSLATE_NOOP("InterfaceSettingsWidget", "PCSX2 (White/Blue) [Light]"), QT_TRANSLATE_NOOP("InterfaceSettingsWidget", "Scarlet Devil (Red/Purple) [Dark]"), + QT_TRANSLATE_NOOP("InterfaceSettingsWidget", "Ruby (Black/Red) [Dark]"), + QT_TRANSLATE_NOOP("InterfaceSettingsWidget", "Custom.qss [Drop in PCSX2 Folder]"), nullptr}; static const char* THEME_VALUES[] = { @@ -41,6 +43,8 @@ static const char* THEME_VALUES[] = { "BabyPastel", "PCSX2Blue", "ScarletDevilRed", + "Ruby", + "Custom", nullptr}; InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsDialog* dialog, QWidget* parent)