Skip to content

Commit

Permalink
Qt: Add AMOLED theme (#3374)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamfretoz authored Feb 20, 2025
1 parent 78bd0fd commit 6a0c73b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/duckstation-qt/interfacesettingswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const char* InterfaceSettingsWidget::THEME_NAMES[] = {
QT_TRANSLATE_NOOP("MainWindow", "Dark Fusion (Blue)"),
QT_TRANSLATE_NOOP("MainWindow", "Cobalt Sky"),
QT_TRANSLATE_NOOP("MainWindow", "Grey Matter"),
QT_TRANSLATE_NOOP("MainWindow", "AMOLED"),
QT_TRANSLATE_NOOP("MainWindow", "Dark Ruby"),
QT_TRANSLATE_NOOP("MainWindow", "Purple Rain"),
QT_TRANSLATE_NOOP("MainWindow", "QDarkStyle"),
Expand All @@ -35,6 +36,7 @@ const char* InterfaceSettingsWidget::THEME_VALUES[] = {
"darkfusionblue",
"cobaltsky",
"greymatter",
"AMOLED",
"darkruby",
"purplerain",
"qdarkstyle",
Expand Down
36 changes: 36 additions & 0 deletions src/duckstation-qt/qtthemes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,42 @@ void QtHost::SetStyleFromSettings()
qApp->setPalette(darkPalette);
qApp->setStyleSheet(QString());
}
else if (theme == "AMOLED")
{
// Custom palette by KamFretoZ, A pure concentrated darkness
// of a theme designed for maximum eye comfort and benefits
// OLED screens.
qApp->setStyle(QStyleFactory::create("Fusion"));

const QColor black(0, 0, 0);
const QColor gray(25, 25, 25);
const QColor lighterGray(75, 75, 75);
const QColor blue(198, 238, 255);

QPalette AMOLEDPalette;
AMOLEDPalette.setColor(QPalette::Window, black);
AMOLEDPalette.setColor(QPalette::WindowText, Qt::white);
AMOLEDPalette.setColor(QPalette::Base, gray);
AMOLEDPalette.setColor(QPalette::AlternateBase, black);
AMOLEDPalette.setColor(QPalette::ToolTipBase, gray);
AMOLEDPalette.setColor(QPalette::ToolTipText, Qt::white);
AMOLEDPalette.setColor(QPalette::Text, Qt::white);
AMOLEDPalette.setColor(QPalette::Button, gray);
AMOLEDPalette.setColor(QPalette::ButtonText, Qt::white);
AMOLEDPalette.setColor(QPalette::Link, blue);
AMOLEDPalette.setColor(QPalette::Highlight, lighterGray);
AMOLEDPalette.setColor(QPalette::HighlightedText, Qt::white);
AMOLEDPalette.setColor(QPalette::PlaceholderText, QColor(Qt::white).darker());

AMOLEDPalette.setColor(QPalette::Active, QPalette::Button, gray);
AMOLEDPalette.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(Qt::white).darker());
AMOLEDPalette.setColor(QPalette::Disabled, QPalette::WindowText, QColor(Qt::white).darker());
AMOLEDPalette.setColor(QPalette::Disabled, QPalette::Text, QColor(Qt::white).darker());
AMOLEDPalette.setColor(QPalette::Disabled, QPalette::Light, QColor(Qt::white).darker());

qApp->setPalette(AMOLEDPalette);
qApp->setStyleSheet(QString());
}
else if (theme == "darkruby")
{
qApp->setStyle(QStyleFactory::create("Fusion"));
Expand Down

0 comments on commit 6a0c73b

Please sign in to comment.