add dawn theme

This commit is contained in:
Michele Guerini Rocco 2022-09-30 17:13:35 +02:00
parent 549798570e
commit f3cea2f288
Signed by: rnhmjoj
GPG Key ID: BFBAF4C975F76450
4 changed files with 41 additions and 0 deletions

View File

@ -1155,6 +1155,7 @@ UserSettingsModel::data(const QModelIndex &index, int role) const
return QStringList{
QStringLiteral("light"),
QStringLiteral("dark"),
QStringLiteral("dawn"),
QStringLiteral("system"),
}
.indexOf(i->theme());
@ -1628,6 +1629,7 @@ UserSettingsModel::data(const QModelIndex &index, int role) const
return QStringList{
QStringLiteral("Light"),
QStringLiteral("Dark"),
QStringLiteral("Dawn"),
QStringLiteral("System"),
};
case Microphone:
@ -1704,6 +1706,9 @@ UserSettingsModel::setData(const QModelIndex &index, const QVariant &value, int
i->setTheme("dark");
return true;
} else if (value == 2) {
i->setTheme("dawn");
return true;
} else if (value == 3) {
i->setTheme("system");
return true;
} else

View File

@ -1217,6 +1217,8 @@ utils::linkColor()
return QStringLiteral("#0077b5");
} else if (theme == QLatin1String("dark")) {
return QStringLiteral("#38A3D8");
} else if (theme == "dawn") {
return QStringLiteral("#B3B3B3");
} else {
return QPalette().color(QPalette::Link).name();
}

View File

@ -67,6 +67,13 @@ Nheko::inactiveColors() const
return darkInactive;
}();
return darkInactive;
} else if (theme == QLatin1String("dawn")) {
static QPalette dawnInactive = [] {
auto dawnInactive = Theme::paletteFromTheme(u"dawn");
dawnInactive.setCurrentColorGroup(QPalette::ColorGroup::Inactive);
return dawnInactive;
}();
return dawnInactive;
} else {
static QPalette originalInactive = [] {
auto originalInactive = Theme::paletteFromTheme(u"system");

View File

@ -52,6 +52,25 @@ Theme::paletteFromTheme(QStringView theme)
return darkActive;
}();
return darkActive;
} else if (theme == u"dawn") {
QPalette dawnActive(
/*windowText*/ QColor("#9b9081"),
/*button*/ QColor("#525F66"),
/*light*/ QColor("#cdcdcd"),
/*dark*/ QColor("#353535"),
/*mid*/ QColor("#696057"),
/*text*/ QColor("#9b9081"),
/*bright_text*/ QColor("#b3b3b3"),
/*base*/ QColor("#525F66"),
/*window*/ QColor("#181b20"));
dawnActive.setColor(QPalette::AlternateBase, dawnActive.dark().color());
dawnActive.setColor(QPalette::Highlight, QColor("#6d6137"));
dawnActive.setColor(QPalette::BrightText, dawnActive.brightText().color());
dawnActive.setColor(QPalette::ToolTipBase, dawnActive.base().color());
dawnActive.setColor(QPalette::ToolTipText, dawnActive.text().color());
dawnActive.setColor(QPalette::Link, QColor("#435861"));
dawnActive.setColor(QPalette::ButtonText, dawnActive.brightText().color());
return dawnActive;
} else {
return original;
}
@ -75,6 +94,14 @@ Theme::Theme(QStringView theme)
green_ = QColor(QColorConstants::Svg::green);
orange_ = QColor(0xfc, 0xc5, 0x3a);
error_ = QColor(0xdd, 0x3d, 0x3d);
} else if (theme == u"dawn") {
separator_ = p.dark().color();
sidebarBackground_ = p.window().color();
alternateButton_ = p.dark().color();
red_ = QColor("#744b40");
green_ = QColor("#6d6137");
orange_ = QColor("#765636");
error_ = red_;
} else {
sidebarBackground_ = p.window().color();
alternateButton_ = p.dark().color();