New Theme Added (#3184)

Added new theme : Purple Rain
This commit is contained in:
Anderson Cardoso 2024-04-20 05:33:12 -03:00 committed by GitHub
parent 1a0f6f62e5
commit b478fd93b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 37 additions and 4 deletions

View file

@ -17,12 +17,12 @@ const char* InterfaceSettingsWidget::THEME_NAMES[] = {
QT_TRANSLATE_NOOP("MainWindow", "Cobalt Sky"),
QT_TRANSLATE_NOOP("MainWindow", "Grey Matter"),
QT_TRANSLATE_NOOP("MainWindow", "Dark Ruby"),
QT_TRANSLATE_NOOP("MainWindow", "QDarkStyle"),
QT_TRANSLATE_NOOP("MainWindow", "Purplerain"),
nullptr,
};
const char* InterfaceSettingsWidget::THEME_VALUES[] = {
"", "fusion", "darkfusion", "darkfusionblue", "cobaltsky","greymatter", "darkruby", "qdarkstyle", nullptr,
"","fusion", "darkfusion", "darkfusionblue", "cobaltsky", "greymatter", "darkruby", "purplerain", nullptr,
};
const char* InterfaceSettingsWidget::DEFAULT_THEME_NAME = "darkfusion";

View file

@ -2391,6 +2391,39 @@ void MainWindow::setStyleFromSettings()
qApp->setPalette(darkPalette);
}
else if (theme == "purplerain")
{
qApp->setStyle(QStyleFactory::create("Fusion"));
const QColor darkPurple(73, 41, 121);
const QColor darkerPurple(53, 29, 87);
const QColor gold(250, 207, 0);
QPalette darkPalette;
darkPalette.setColor(QPalette::Window, darkPurple);
darkPalette.setColor(QPalette::WindowText, Qt::white);
darkPalette.setColor(QPalette::Base, darkerPurple);
darkPalette.setColor(QPalette::AlternateBase, darkPurple);
darkPalette.setColor(QPalette::ToolTipBase, darkPurple);
darkPalette.setColor(QPalette::ToolTipText, Qt::white);
darkPalette.setColor(QPalette::Text, Qt::white);
darkPalette.setColor(QPalette::Button, darkerPurple);
darkPalette.setColor(QPalette::ButtonText, Qt::white);
darkPalette.setColor(QPalette::Link, gold);
darkPalette.setColor(QPalette::Highlight, gold);
darkPalette.setColor(QPalette::HighlightedText, Qt::black);
darkPalette.setColor(QPalette::PlaceholderText, QColor(Qt::white).darker());
darkPalette.setColor(QPalette::Active, QPalette::Button, darkerPurple);
darkPalette.setColor(QPalette::Disabled, QPalette::ButtonText, darkPurple.lighter());
darkPalette.setColor(QPalette::Disabled, QPalette::WindowText, darkPurple.lighter());
darkPalette.setColor(QPalette::Disabled, QPalette::Text, darkPurple.lighter());
darkPalette.setColor(QPalette::Disabled, QPalette::Light, darkPurple);
qApp->setPalette(darkPalette);
qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #505a70; border: 1px solid white; }");
}
else
{
qApp->setStyle(s_unthemed_style_name);