Add Theme - Ruby

This PR adds the Ruby Dark theme from PCSX2 to Duckstation

Thanks @KamFretoZ for the heads up,
Credits custom palette @Daisouji
This commit is contained in:
Anderson Cardoso 2024-03-14 16:01:50 -03:00 committed by Stenzek
parent 9211d9f2e3
commit 5054d46075
No known key found for this signature in database
2 changed files with 34 additions and 1 deletions

View file

@ -15,12 +15,13 @@ const char* InterfaceSettingsWidget::THEME_NAMES[] = {
QT_TRANSLATE_NOOP("MainWindow", "Dark Fusion (Gray)"), QT_TRANSLATE_NOOP("MainWindow", "Dark Fusion (Gray)"),
QT_TRANSLATE_NOOP("MainWindow", "Dark Fusion (Blue)"), QT_TRANSLATE_NOOP("MainWindow", "Dark Fusion (Blue)"),
QT_TRANSLATE_NOOP("MainWindow", "Grey Matter"), QT_TRANSLATE_NOOP("MainWindow", "Grey Matter"),
QT_TRANSLATE_NOOP("MainWindow", "Dark Ruby"),
QT_TRANSLATE_NOOP("MainWindow", "QDarkStyle"), QT_TRANSLATE_NOOP("MainWindow", "QDarkStyle"),
nullptr, nullptr,
}; };
const char* InterfaceSettingsWidget::THEME_VALUES[] = { const char* InterfaceSettingsWidget::THEME_VALUES[] = {
"", "fusion", "darkfusion", "darkfusionblue", "greymatter", "qdarkstyle", nullptr, "", "fusion", "darkfusion", "darkfusionblue", "greymatter", "darkruby", "qdarkstyle", nullptr,
}; };
const char* InterfaceSettingsWidget::DEFAULT_THEME_NAME = "darkfusion"; const char* InterfaceSettingsWidget::DEFAULT_THEME_NAME = "darkfusion";

View file

@ -2343,6 +2343,38 @@ void MainWindow::setStyleFromSettings()
qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #505a70; border: 1px solid white; }"); qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #505a70; border: 1px solid white; }");
} }
else if (theme == "darkruby")
{
qApp->setStyle(QStyleFactory::create("Fusion"));
const QColor gray(128, 128, 128);
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);
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 else
{ {
qApp->setStyle(s_unthemed_style_name); qApp->setStyle(s_unthemed_style_name);