some additions to themes

This commit is contained in:
Dorian Zedler 2020-05-19 14:41:23 +02:00
parent c027fa242a
commit cf443a1c70
Signed by: dorian
GPG key ID: 989DE36109AFA354
5 changed files with 30 additions and 8 deletions

View file

@ -2,6 +2,7 @@
#define SCSTWAPPTHEMEMANAGER_H
#include <QObject>
#include <QColor>
#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();

View file

@ -1,5 +1,7 @@
<RCC>
<qresource prefix="/">
<file>fonts/fa5solid.woff</file>
<file>images/BaseStationBlack.png</file>
<file>images/BaseStationWhite.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

View file

@ -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();
}