renamed Themes to Theme
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#define LOOKUP_COLOR_COUNT 360
|
||||
|
||||
#include "Themes.hpp"
|
||||
#include "Theme.hpp"
|
||||
|
||||
#include <QColor>
|
||||
|
||||
@@ -27,7 +27,7 @@ double getMultiplierByTheme(const QString &themeName)
|
||||
|
||||
} // namespace detail
|
||||
|
||||
Themes::Themes()
|
||||
Theme::Theme()
|
||||
: themeName("/appearance/theme/name", "Dark")
|
||||
, themeHue("/appearance/theme/hue", 0.0)
|
||||
{
|
||||
@@ -37,14 +37,14 @@ Themes::Themes()
|
||||
this->themeHue.connectSimple([this](auto) { this->update(); }, false);
|
||||
}
|
||||
|
||||
void Themes::update()
|
||||
void Theme::update()
|
||||
{
|
||||
this->actuallyUpdate(this->themeHue, detail::getMultiplierByTheme(this->themeName.getValue()));
|
||||
}
|
||||
|
||||
// hue: theme color (0 - 1)
|
||||
// multiplier: 1 = white, 0.8 = light, -0.8 dark, -1 black
|
||||
void Themes::actuallyUpdate(double hue, double multiplier)
|
||||
void Theme::actuallyUpdate(double hue, double multiplier)
|
||||
{
|
||||
isLight = multiplier > 0;
|
||||
bool lightWin = isLight;
|
||||
@@ -217,7 +217,7 @@ void Themes::actuallyUpdate(double hue, double multiplier)
|
||||
this->updated.invoke();
|
||||
}
|
||||
|
||||
QColor Themes::blendColors(const QColor &color1, const QColor &color2, qreal ratio)
|
||||
QColor Theme::blendColors(const QColor &color1, const QColor &color2, qreal ratio)
|
||||
{
|
||||
int r = int(color1.red() * (1 - ratio) + color2.red() * ratio);
|
||||
int g = int(color1.green() * (1 - ratio) + color2.green() * ratio);
|
||||
@@ -226,7 +226,7 @@ QColor Themes::blendColors(const QColor &color1, const QColor &color2, qreal rat
|
||||
return QColor(r, g, b, 255);
|
||||
}
|
||||
|
||||
void Themes::normalizeColor(QColor &color)
|
||||
void Theme::normalizeColor(QColor &color)
|
||||
{
|
||||
if (this->isLight) {
|
||||
if (color.lightnessF() > 0.5) {
|
||||
@@ -10,12 +10,12 @@ namespace chatterino {
|
||||
|
||||
class WindowManager;
|
||||
|
||||
class Themes
|
||||
class Theme
|
||||
{
|
||||
public:
|
||||
Themes();
|
||||
Theme();
|
||||
|
||||
~Themes() = delete;
|
||||
~Theme() = delete;
|
||||
|
||||
inline bool isLightTheme() const
|
||||
{
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "providers/twitch/TwitchServer.hpp"
|
||||
#include "singletons/Fonts.hpp"
|
||||
#include "singletons/Paths.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "util/Clamp.hpp"
|
||||
#include "widgets/AccountSwitchPopupWidget.hpp"
|
||||
#include "widgets/dialogs/SettingsDialog.hpp"
|
||||
|
||||
Reference in New Issue
Block a user