From 8dac10ae3685e6aa59132589a79c8edb52f9473b Mon Sep 17 00:00:00 2001 From: kamfretoz Date: Fri, 24 Feb 2023 10:35:33 +0700 Subject: [PATCH] Qt: Add a new theme, Cobalt Sky. --- pcsx2-qt/MainWindow.cpp | 35 +++++++++++++++++++ pcsx2-qt/Settings/InterfaceSettingsWidget.cpp | 2 ++ 2 files changed, 37 insertions(+) diff --git a/pcsx2-qt/MainWindow.cpp b/pcsx2-qt/MainWindow.cpp index e847e9fb97..8c234a8481 100644 --- a/pcsx2-qt/MainWindow.cpp +++ b/pcsx2-qt/MainWindow.cpp @@ -737,6 +737,41 @@ void MainWindow::setStyleFromSettings() qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }"); } + else if (theme == "CobaltSky") + { + // Custom palette by KamFretoZ, A soothing deep royal blue + // that are meant to be easy on the eyes as the main color. + // Alternative dark theme. + qApp->setStyle(QStyleFactory::create("Fusion")); + + const QColor gray(192, 192, 192); + const QColor royalBlue(29, 41, 81); + const QColor darkishBlue(17, 30, 108); + + QPalette darkPalette; + darkPalette.setColor(QPalette::Window, royalBlue); + darkPalette.setColor(QPalette::WindowText, Qt::white); + darkPalette.setColor(QPalette::Base, royalBlue.lighter()); + darkPalette.setColor(QPalette::AlternateBase, royalBlue); + darkPalette.setColor(QPalette::ToolTipBase, darkishBlue); + darkPalette.setColor(QPalette::ToolTipText, Qt::white); + darkPalette.setColor(QPalette::Text, Qt::white); + darkPalette.setColor(QPalette::Button, royalBlue.darker()); + darkPalette.setColor(QPalette::ButtonText, Qt::white); + darkPalette.setColor(QPalette::Link, Qt::white); + darkPalette.setColor(QPalette::Highlight, darkishBlue.lighter()); + darkPalette.setColor(QPalette::HighlightedText, Qt::white); + + darkPalette.setColor(QPalette::Active, QPalette::Button, darkishBlue); + 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, gray.darker()); + + qApp->setPalette(darkPalette); + + qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }"); + } else if (theme == "VioletAngelPurple") { // Custom palette by RedDevilus, Blue as main color and Purple as complimentary. diff --git a/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp b/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp index 269ec31f46..06b1bf54b4 100644 --- a/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp +++ b/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp @@ -31,6 +31,7 @@ static const char* THEME_NAMES[] = { QT_TRANSLATE_NOOP("InterfaceSettingsWidget", "PCSX2 (White/Blue) [Light]"), QT_TRANSLATE_NOOP("InterfaceSettingsWidget", "Scarlet Devil (Red/Purple) [Dark]"), QT_TRANSLATE_NOOP("InterfaceSettingsWidget", "Violet Angel (Blue/Purple) [Dark]"), + QT_TRANSLATE_NOOP("InterfaceSettingsWidget", "Cobalt Sky (Royal Blue) [Dark]"), QT_TRANSLATE_NOOP("InterfaceSettingsWidget", "Ruby (Black/Red) [Dark]"), QT_TRANSLATE_NOOP("InterfaceSettingsWidget", "Sapphire (Black/Blue) [Dark]"), QT_TRANSLATE_NOOP("InterfaceSettingsWidget", "Custom.qss [Drop in PCSX2 Folder]"), @@ -46,6 +47,7 @@ static const char* THEME_VALUES[] = { "PCSX2Blue", "ScarletDevilRed", "VioletAngelPurple", + "CobaltSky", "Ruby", "Sapphire", "Custom",