diff --git a/ScStwStyling/headers/scstwappthememanager.h b/ScStwStyling/headers/scstwappthememanager.h index d34b263..fd74d9a 100644 --- a/ScStwStyling/headers/scstwappthememanager.h +++ b/ScStwStyling/headers/scstwappthememanager.h @@ -2,6 +2,7 @@ #define SCSTWAPPTHEMEMANAGER_H #include +#include #include "scstwapptheme.h" class ScStwAppThemeManager : public QObject @@ -18,6 +19,8 @@ private: ScStwAppTheme* findThemeByName(QString themeName); + QString lighter(QString color, double factor); + signals: void themeChanged(); diff --git a/ScStwStyling/resources/ScStwStylingShared.qrc b/ScStwStyling/resources/ScStwStylingShared.qrc index eedb90a..814e256 100644 --- a/ScStwStyling/resources/ScStwStylingShared.qrc +++ b/ScStwStyling/resources/ScStwStylingShared.qrc @@ -1,5 +1,7 @@ fonts/fa5solid.woff + images/BaseStationBlack.png + images/BaseStationWhite.png diff --git a/ScStwStyling/resources/images/BaseStationBlack.png b/ScStwStyling/resources/images/BaseStationBlack.png new file mode 100644 index 0000000..333340f Binary files /dev/null and b/ScStwStyling/resources/images/BaseStationBlack.png differ diff --git a/ScStwStyling/resources/images/BaseStationWhite.png b/ScStwStyling/resources/images/BaseStationWhite.png new file mode 100644 index 0000000..aea2a4d Binary files /dev/null and b/ScStwStyling/resources/images/BaseStationWhite.png differ diff --git a/ScStwStyling/sources/scstwappthememanager.cpp b/ScStwStyling/sources/scstwappthememanager.cpp index df09c1b..515ff80 100644 --- a/ScStwStyling/sources/scstwappthememanager.cpp +++ b/ScStwStyling/sources/scstwappthememanager.cpp @@ -5,23 +5,27 @@ ScStwAppThemeManager::ScStwAppThemeManager(QObject *parent) : QObject(parent) QFontDatabase::addApplicationFont(":/fonts/fa5solid.woff"); QVariantMap icons = { - {"backIcon", "\uf053"}, - {"settIcon", "\uf013"}, - {"toppadIcon", "\uf10a"}, - {"startpadIcon", "\uf3fa"}, - {"profilesIcon", "\uf007"}, - {"confirmIcon", "\uf00c"} + {"back", "\uf053"}, + {"settings", "\uf013"}, + {"toppad", "\uf10a"}, + {"startpad", "\uf3fa"}, + {"profiles", "\uf007"}, + {"confirm", "\uf00c"} }; ScStwAppTheme * lightTheme = new ScStwAppTheme ( "Light", { + {"accent", "#0094ff"}, {"background", "white"}, {"button", "white"}, {"buttonPressed", "lightgrey"}, {"buttonBorder", "grey"}, {"disabledButton", "#d5d5d5"}, + {"buttonText", "grey"}, + {"buttonPressedText",this->lighter("lightgrey", 0.5)}, + {"buttonDisabledText", this->lighter("lightgrey", 0.9)}, {"view", "white"}, {"menu", "#f8f8f8"}, @@ -52,7 +56,7 @@ ScStwAppThemeManager::ScStwAppThemeManager(QObject *parent) : QObject(parent) {"settIcon", "qrc:/graphics/icons/settings_black.png"}, {"buzzerIcon", "qrc:/graphics/icons/buzzer_black.png"}, {"startpadIcon", "qrc:/graphics/icons/startpad_black.png"}, - {"baseStationIcon", "qrc:/graphics/icons/BaseStation_black.png"}, + {"baseStationIcon", "qrc:/images/BaseStationBlack.png"}, {"profilesIcon", "qrc:/graphics/icons/user_black.png"}, {"confirmIcon", "qrc:/graphics/icons/ok_black.png"} }); @@ -60,12 +64,16 @@ ScStwAppThemeManager::ScStwAppThemeManager(QObject *parent) : QObject(parent) ScStwAppTheme *darkTheme = new ScStwAppTheme( "Dark", { + {"accent", "#0094ff"}, {"background", "#2d3037"}, {"button", "#202227"}, {"buttonPressed", "#41454f"}, {"buttonBorder", "grey"}, {"disabledButton", "#555555"}, + {"buttonText", "white"}, + {"buttonPressedText",this->lighter("lightgrey", 0.8)}, + {"buttonDisabledText", this->lighter("lightgrey", 0.6)}, {"view", "#202227"}, {"menu", "#292b32"}, @@ -99,7 +107,7 @@ ScStwAppThemeManager::ScStwAppThemeManager(QObject *parent) : QObject(parent) {"settIcon", "qrc:/graphics/icons/settings.png"}, {"buzzerIcon", "qrc:/graphics/icons/buzzer.png"}, {"startpadIcon", "qrc:/graphics/icons/startpad.png"}, - {"baseStationIcon", "qrc:/graphics/icons/BaseStation.png"}, + {"baseStationIcon", "qrc:/images/BaseStationWhite.png"}, {"profilesIcon", "qrc:/graphics/icons/user.png"}, {"confirmIcon", "qrc:/graphics/icons/ok.png"} } @@ -134,3 +142,12 @@ ScStwAppTheme * ScStwAppThemeManager::findThemeByName(QString themeName) { return nullptr; } + +QString ScStwAppThemeManager::lighter(QString color, double factor) { + QColor qcolor = QColor(color); + qcolor.toHsv(); + int h, s, v; + qcolor.getHsv(&h, &s, &v); + qcolor.setHsv(h,s,v * factor); + return qcolor.name(); +}