working on something

This commit is contained in:
Rasmus Karlsson
2017-07-02 12:36:50 +02:00
parent f2ef14422b
commit 3c2ee99731
9 changed files with 116 additions and 99 deletions
+5 -6
View File
@@ -1,7 +1,6 @@
#define LOOKUP_COLOR_COUNT 360
#include "colorscheme.hpp"
#include "settingsmanager.hpp"
#include "windowmanager.hpp"
#include <QColor>
@@ -28,14 +27,16 @@ double getMultiplierByTheme(const std::string &themeName)
} // namespace detail
ColorScheme::ColorScheme(WindowManager &windowManager)
: themeName("/appearance/theme/name", "Dark")
, themeHue("/appearance/theme/hue", 0.0)
{
this->update();
SettingsManager::getInstance().themeName.getValueChangedSignal().connect([=](const auto &) {
this->themeName.getValueChangedSignal().connect([=](const auto &) {
this->update(); //
});
SettingsManager::getInstance().themeHue.getValueChangedSignal().connect([=](const auto &) {
this->themeHue.getValueChangedSignal().connect([=](const auto &) {
this->update(); //
});
@@ -46,9 +47,7 @@ ColorScheme::ColorScheme(WindowManager &windowManager)
void ColorScheme::update()
{
SettingsManager &settings = SettingsManager::getInstance();
this->setColors(settings.themeHue, detail::getMultiplierByTheme(settings.themeName));
this->setColors(this->themeHue, detail::getMultiplierByTheme(this->themeName));
}
// hue: theme color (0 - 1)