mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
renamed Themes to Theme
This commit is contained in:
parent
c01d1ed732
commit
86347dc63e
29 changed files with 45 additions and 45 deletions
|
@ -222,8 +222,8 @@ SOURCES += \
|
|||
src/singletons/Paths.cpp \
|
||||
src/singletons/Resources.cpp \
|
||||
src/singletons/Settings.cpp \
|
||||
src/singletons/Themes.cpp \
|
||||
src/singletons/Updates.cpp
|
||||
src/singletons/Updates.cpp \
|
||||
src/singletons/Theme.cpp
|
||||
|
||||
HEADERS += \
|
||||
src/Application.hpp \
|
||||
|
@ -390,9 +390,9 @@ HEADERS += \
|
|||
src/singletons/Paths.hpp \
|
||||
src/singletons/Resources.hpp \
|
||||
src/singletons/Settings.hpp \
|
||||
src/singletons/Themes.hpp \
|
||||
src/singletons/Updates.hpp \
|
||||
src/singletons/NativeMessaging.hpp
|
||||
src/singletons/NativeMessaging.hpp \
|
||||
src/singletons/Theme.hpp
|
||||
|
||||
RESOURCES += \
|
||||
resources/resources.qrc \
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include "singletons/Paths.hpp"
|
||||
#include "singletons/Resources.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
#include "util/IsBigEndian.hpp"
|
||||
#include "util/PostToThread.hpp"
|
||||
|
@ -47,7 +47,7 @@ void Application::construct()
|
|||
this->settings = getSettings();
|
||||
this->paths = Paths::getInstance();
|
||||
|
||||
this->themes = new Themes;
|
||||
this->themes = new Theme;
|
||||
this->windows = new WindowManager;
|
||||
this->logging = new Logging;
|
||||
this->commands = new CommandController;
|
||||
|
|
|
@ -16,7 +16,7 @@ class TaggedUsersController;
|
|||
class AccountController;
|
||||
class ModerationActions;
|
||||
|
||||
class Themes;
|
||||
class Theme;
|
||||
class WindowManager;
|
||||
class Logging;
|
||||
class Paths;
|
||||
|
@ -45,7 +45,7 @@ public:
|
|||
friend void test();
|
||||
|
||||
Paths *paths = nullptr;
|
||||
Themes *themes = nullptr;
|
||||
Theme *themes = nullptr;
|
||||
WindowManager *windows = nullptr;
|
||||
Logging *logging = nullptr;
|
||||
CommandController *commands = nullptr;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "common/LinkParser.hpp"
|
||||
#include "singletons/Emotes.hpp"
|
||||
#include "singletons/Resources.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ MessageColor::MessageColor(Type _type)
|
|||
{
|
||||
}
|
||||
|
||||
const QColor &MessageColor::getColor(Themes &themeManager) const
|
||||
const QColor &MessageColor::getColor(Theme &themeManager) const
|
||||
{
|
||||
switch (this->type) {
|
||||
case Type::Custom:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
|
||||
#include <QColor>
|
||||
|
||||
|
@ -12,7 +12,7 @@ struct MessageColor {
|
|||
MessageColor(const QColor &color);
|
||||
MessageColor(Type type = Text);
|
||||
|
||||
const QColor &getColor(Themes &themeManager) const;
|
||||
const QColor &getColor(Theme &themeManager) const;
|
||||
|
||||
private:
|
||||
Type type;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "singletons/Emotes.hpp"
|
||||
#include "singletons/Resources.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
#include "util/IrcHelpers.hpp"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "Application.hpp"
|
||||
#include "debug/Log.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "widgets/BaseWindow.hpp"
|
||||
|
||||
#include <QChildEvent>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
namespace chatterino {
|
||||
|
||||
class Themes;
|
||||
class Theme;
|
||||
class BaseWindow;
|
||||
|
||||
class BaseWidget : public QWidget
|
||||
|
@ -41,7 +41,7 @@ protected:
|
|||
|
||||
void setScale(float value);
|
||||
|
||||
Themes *themeManager;
|
||||
Theme *themeManager;
|
||||
|
||||
private:
|
||||
void init();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "Application.hpp"
|
||||
#include "debug/Log.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
#include "widgets/Window.hpp"
|
||||
#include "widgets/dialogs/SettingsDialog.hpp"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "widgets/Scrollbar.hpp"
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "widgets/helper/ChannelView.hpp"
|
||||
|
||||
#include <QDebug>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "Application.hpp"
|
||||
#include "singletons/Fonts.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDesktopWidget>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "controllers/accounts/AccountController.hpp"
|
||||
#include "providers/twitch/TwitchServer.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
#include "widgets/AccountSwitchPopupWidget.hpp"
|
||||
#include "widgets/Notebook.hpp"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace chatterino {
|
||||
|
||||
class Themes;
|
||||
class Theme;
|
||||
|
||||
class Window : public BaseWindow
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "messages/layouts/MessageLayout.hpp"
|
||||
#include "providers/twitch/TwitchServer.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
#include "util/DistanceBetweenPoints.hpp"
|
||||
#include "widgets/TooltipWidget.hpp"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "widgets/helper/DropPreview.hpp"
|
||||
#include "Application.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QPainter>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "widgets/helper/NotebookButton.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "widgets/Notebook.hpp"
|
||||
#include "widgets/helper/RippleEffectButton.hpp"
|
||||
#include "widgets/splits/SplitContainer.hpp"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "common/Common.hpp"
|
||||
#include "debug/Log.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "util/Clamp.hpp"
|
||||
#include "util/Helpers.hpp"
|
||||
#include "widgets/Notebook.hpp"
|
||||
|
@ -221,8 +221,8 @@ void NotebookTab::paintEvent(QPaintEvent *)
|
|||
// int fullHeight = (int)(scale * 48);
|
||||
|
||||
// select the right tab colors
|
||||
Themes::TabColors colors;
|
||||
Themes::TabColors regular = this->themeManager->tabs.regular;
|
||||
Theme::TabColors colors;
|
||||
Theme::TabColors regular = this->themeManager->tabs.regular;
|
||||
|
||||
if (this->selected_) {
|
||||
colors = this->themeManager->tabs.selected;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <QDebug>
|
||||
#include <QPainter>
|
||||
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "widgets/helper/RippleEffectLabel.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "widgets/splits/SplitHeader.hpp"
|
||||
|
||||
#include <QBrush>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "widgets/helper/ScrollbarHighlight.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "widgets/Scrollbar.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "TitlebarButton.hpp"
|
||||
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "providers/twitch/TwitchMessageBuilder.hpp"
|
||||
#include "providers/twitch/TwitchServer.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
#include "util/StreamLink.hpp"
|
||||
#include "widgets/Window.hpp"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "Application.hpp"
|
||||
#include "common/Common.hpp"
|
||||
#include "debug/AssertInGuiThread.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
#include "util/Helpers.hpp"
|
||||
#include "util/LayoutCreator.hpp"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "providers/twitch/TwitchChannel.hpp"
|
||||
#include "providers/twitch/TwitchServer.hpp"
|
||||
#include "singletons/Resources.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "util/LayoutCreator.hpp"
|
||||
#include "widgets/Label.hpp"
|
||||
#include "widgets/TooltipWidget.hpp"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "providers/twitch/TwitchChannel.hpp"
|
||||
#include "providers/twitch/TwitchServer.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/Themes.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "util/LayoutCreator.hpp"
|
||||
#include "widgets/Notebook.hpp"
|
||||
#include "widgets/splits/Split.hpp"
|
||||
|
|
Loading…
Reference in a new issue