2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2016-12-30 19:16:48 +01:00
|
|
|
|
2018-07-07 11:41:01 +02:00
|
|
|
#include "common/Singleton.hpp"
|
2018-08-10 19:00:14 +02:00
|
|
|
#include "util/RapidJsonSerializeQString.hpp"
|
2018-04-03 02:55:32 +02:00
|
|
|
|
2017-01-01 02:30:42 +01:00
|
|
|
#include <QBrush>
|
2017-01-11 18:52:09 +01:00
|
|
|
#include <QColor>
|
2017-07-02 12:36:50 +02:00
|
|
|
#include <pajlada/settings/setting.hpp>
|
2018-10-01 13:05:50 +02:00
|
|
|
#include <singletons/Settings.hpp>
|
2016-12-30 19:16:48 +01:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
2017-01-18 21:30:23 +01:00
|
|
|
|
2017-06-13 21:13:58 +02:00
|
|
|
class WindowManager;
|
|
|
|
|
2022-11-10 10:07:50 +01:00
|
|
|
class Theme final : public Singleton
|
2016-12-30 19:16:48 +01:00
|
|
|
{
|
2018-04-28 15:20:18 +02:00
|
|
|
public:
|
2018-06-28 20:03:04 +02:00
|
|
|
Theme();
|
2017-12-31 00:50:07 +01:00
|
|
|
|
2022-11-10 10:07:50 +01:00
|
|
|
bool isLightTheme() const;
|
|
|
|
|
|
|
|
struct TabColors {
|
|
|
|
QColor text;
|
|
|
|
struct {
|
|
|
|
QBrush regular;
|
|
|
|
QBrush hover;
|
|
|
|
QBrush unfocused;
|
|
|
|
} backgrounds;
|
|
|
|
struct {
|
|
|
|
QColor regular;
|
|
|
|
QColor hover;
|
|
|
|
QColor unfocused;
|
|
|
|
} line;
|
|
|
|
};
|
|
|
|
|
|
|
|
QColor accent{"#00aeef"};
|
|
|
|
|
|
|
|
/// WINDOW
|
|
|
|
struct {
|
|
|
|
QColor background;
|
|
|
|
QColor text;
|
|
|
|
QColor borderUnfocused;
|
|
|
|
QColor borderFocused;
|
|
|
|
} window;
|
|
|
|
|
|
|
|
/// TABS
|
|
|
|
struct {
|
|
|
|
TabColors regular;
|
|
|
|
TabColors newMessage;
|
|
|
|
TabColors highlighted;
|
|
|
|
TabColors selected;
|
|
|
|
QColor border;
|
|
|
|
QColor dividerLine;
|
|
|
|
} tabs;
|
|
|
|
|
|
|
|
/// MESSAGES
|
|
|
|
struct {
|
|
|
|
struct {
|
|
|
|
QColor regular;
|
|
|
|
QColor caret;
|
|
|
|
QColor link;
|
|
|
|
QColor system;
|
|
|
|
QColor chatPlaceholder;
|
|
|
|
} textColors;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
QColor regular;
|
|
|
|
QColor alternate;
|
|
|
|
// QColor whisper;
|
|
|
|
} backgrounds;
|
|
|
|
|
|
|
|
QColor disabled;
|
|
|
|
// QColor seperator;
|
|
|
|
// QColor seperatorInner;
|
|
|
|
QColor selection;
|
|
|
|
|
|
|
|
QColor highlightAnimationStart;
|
|
|
|
QColor highlightAnimationEnd;
|
|
|
|
} messages;
|
|
|
|
|
|
|
|
/// SCROLLBAR
|
|
|
|
struct {
|
|
|
|
QColor background;
|
|
|
|
QColor thumb;
|
|
|
|
QColor thumbSelected;
|
|
|
|
struct {
|
|
|
|
QColor highlight;
|
|
|
|
QColor subscription;
|
|
|
|
} highlights;
|
|
|
|
} scrollbars;
|
|
|
|
|
|
|
|
/// TOOLTIP
|
|
|
|
struct {
|
|
|
|
QColor text;
|
|
|
|
QColor background;
|
|
|
|
} tooltip;
|
|
|
|
|
2018-04-05 23:44:46 +02:00
|
|
|
/// SPLITS
|
2018-01-02 02:21:38 +01:00
|
|
|
struct {
|
2018-01-02 02:15:11 +01:00
|
|
|
QColor messageSeperator;
|
|
|
|
QColor background;
|
|
|
|
QColor dropPreview;
|
2018-05-08 20:35:31 +02:00
|
|
|
QColor dropPreviewBorder;
|
2018-06-01 14:20:46 +02:00
|
|
|
QColor dropTargetRect;
|
|
|
|
QColor dropTargetRectBorder;
|
|
|
|
QColor resizeHandle;
|
|
|
|
QColor resizeHandleBackground;
|
2018-01-02 02:15:11 +01:00
|
|
|
|
2018-01-02 02:21:38 +01:00
|
|
|
struct {
|
2018-01-02 02:15:11 +01:00
|
|
|
QColor border;
|
2022-01-22 16:23:02 +01:00
|
|
|
QColor focusedBorder;
|
2018-01-02 02:15:11 +01:00
|
|
|
QColor background;
|
2022-01-22 16:23:02 +01:00
|
|
|
QColor focusedBackground;
|
2018-01-02 02:15:11 +01:00
|
|
|
QColor text;
|
2018-06-23 23:48:54 +02:00
|
|
|
QColor focusedText;
|
2018-01-02 02:15:11 +01:00
|
|
|
// int margin;
|
|
|
|
} header;
|
|
|
|
|
2018-01-02 02:21:38 +01:00
|
|
|
struct {
|
2018-01-02 02:15:11 +01:00
|
|
|
QColor border;
|
|
|
|
QColor background;
|
|
|
|
QColor selection;
|
2018-06-06 13:35:06 +02:00
|
|
|
QColor focusedLine;
|
2018-01-02 02:15:11 +01:00
|
|
|
QColor text;
|
|
|
|
QString styleSheet;
|
|
|
|
// int margin;
|
|
|
|
} input;
|
|
|
|
} splits;
|
|
|
|
|
2021-07-25 13:15:38 +02:00
|
|
|
struct {
|
|
|
|
QPixmap copy;
|
|
|
|
} buttons;
|
|
|
|
|
2017-01-18 01:04:54 +01:00
|
|
|
void normalizeColor(QColor &color);
|
2022-11-10 10:07:50 +01:00
|
|
|
void update();
|
|
|
|
QColor blendColors(const QColor &color1, const QColor &color2, qreal ratio);
|
|
|
|
|
|
|
|
pajlada::Signals::NoArgSignal updated;
|
|
|
|
|
|
|
|
QStringSetting themeName{"/appearance/theme/name", "Dark"};
|
|
|
|
DoubleSetting themeHue{"/appearance/theme/hue", 0.0};
|
2017-01-18 01:04:54 +01:00
|
|
|
|
2018-01-12 23:09:05 +01:00
|
|
|
private:
|
2022-11-10 10:07:50 +01:00
|
|
|
bool isLight_ = false;
|
|
|
|
void actuallyUpdate(double hue, double multiplier);
|
2018-07-06 19:23:47 +02:00
|
|
|
|
|
|
|
pajlada::Signals::NoArgSignal repaintVisibleChatWidgets_;
|
2017-12-31 00:50:07 +01:00
|
|
|
|
|
|
|
friend class WindowManager;
|
2016-12-30 19:16:48 +01:00
|
|
|
};
|
|
|
|
|
2022-11-10 10:07:50 +01:00
|
|
|
Theme *getTheme();
|
2017-06-07 10:09:24 +02:00
|
|
|
} // namespace chatterino
|