2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2016-12-30 19:16:48 +01:00
|
|
|
|
2018-04-03 02:55:32 +02:00
|
|
|
#include "util/serialize-custom.hpp"
|
|
|
|
|
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>
|
2016-12-30 19:16:48 +01:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
2017-12-31 22:58:35 +01:00
|
|
|
namespace singletons {
|
2017-01-18 21:30:23 +01:00
|
|
|
|
2017-06-13 21:13:58 +02:00
|
|
|
class WindowManager;
|
|
|
|
|
2017-12-31 00:50:07 +01:00
|
|
|
class ThemeManager
|
2016-12-30 19:16:48 +01:00
|
|
|
{
|
2018-04-28 15:20:18 +02:00
|
|
|
public:
|
2017-12-31 00:50:07 +01:00
|
|
|
ThemeManager();
|
|
|
|
|
2018-04-27 22:11:19 +02:00
|
|
|
~ThemeManager() = delete;
|
2017-06-26 16:41:20 +02:00
|
|
|
|
|
|
|
inline bool isLightTheme() const
|
|
|
|
{
|
2018-01-15 01:35:35 +01:00
|
|
|
return this->isLight;
|
2017-06-26 16:41:20 +02:00
|
|
|
}
|
2016-12-30 20:41:24 +01:00
|
|
|
|
2018-01-02 02:15:11 +01:00
|
|
|
struct TabColors {
|
|
|
|
QColor text;
|
2018-05-23 04:22:17 +02:00
|
|
|
struct {
|
2018-01-02 02:15:11 +01:00
|
|
|
QBrush regular;
|
|
|
|
QBrush hover;
|
|
|
|
QBrush unfocused;
|
|
|
|
} backgrounds;
|
2018-05-23 04:22:17 +02:00
|
|
|
struct {
|
|
|
|
QColor regular;
|
|
|
|
QColor hover;
|
|
|
|
QColor unfocused;
|
|
|
|
} line;
|
2018-01-02 02:15:11 +01:00
|
|
|
};
|
|
|
|
|
2018-04-05 23:44:46 +02:00
|
|
|
/// WINDOW
|
|
|
|
struct {
|
|
|
|
QColor background;
|
|
|
|
QColor text;
|
|
|
|
QColor borderUnfocused;
|
|
|
|
QColor borderFocused;
|
|
|
|
} window;
|
|
|
|
|
|
|
|
/// TABS
|
2018-01-02 02:21:38 +01:00
|
|
|
struct {
|
2018-01-02 02:15:11 +01:00
|
|
|
TabColors regular;
|
|
|
|
TabColors newMessage;
|
2018-05-23 04:22:17 +02:00
|
|
|
TabColors highlighted;
|
|
|
|
TabColors selected;
|
2018-03-30 16:25:49 +02:00
|
|
|
QColor border;
|
2018-04-18 09:12:29 +02:00
|
|
|
QColor bottomLine;
|
2018-01-02 02:15:11 +01:00
|
|
|
} tabs;
|
|
|
|
|
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;
|
|
|
|
QColor background;
|
|
|
|
QColor text;
|
|
|
|
// 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;
|
|
|
|
|
2018-04-05 23:44:46 +02:00
|
|
|
/// MESSAGES
|
2018-01-02 02:21:38 +01:00
|
|
|
struct {
|
|
|
|
struct {
|
2018-01-02 02:15:11 +01:00
|
|
|
QColor regular;
|
|
|
|
QColor caret;
|
|
|
|
QColor link;
|
|
|
|
QColor system;
|
|
|
|
} textColors;
|
|
|
|
|
2018-01-02 02:21:38 +01:00
|
|
|
struct {
|
2018-01-02 02:15:11 +01:00
|
|
|
QColor regular;
|
2018-05-06 14:38:23 +02:00
|
|
|
QColor alternate;
|
2018-01-02 02:15:11 +01:00
|
|
|
QColor highlighted;
|
2018-06-04 12:23:23 +02:00
|
|
|
QColor subscription;
|
2018-01-02 02:15:11 +01:00
|
|
|
// QColor whisper;
|
|
|
|
} backgrounds;
|
|
|
|
|
|
|
|
QColor disabled;
|
|
|
|
// QColor seperator;
|
|
|
|
// QColor seperatorInner;
|
|
|
|
QColor selection;
|
|
|
|
} messages;
|
|
|
|
|
2018-04-05 23:44:46 +02:00
|
|
|
/// SCROLLBAR
|
2018-01-02 02:21:38 +01:00
|
|
|
struct {
|
2018-01-02 02:15:11 +01:00
|
|
|
QColor background;
|
|
|
|
QColor thumb;
|
|
|
|
QColor thumbSelected;
|
2018-05-26 17:11:09 +02:00
|
|
|
struct {
|
|
|
|
QColor highlight;
|
2018-06-04 12:23:23 +02:00
|
|
|
QColor subscription;
|
2018-05-26 17:11:09 +02:00
|
|
|
} highlights;
|
2018-01-02 02:15:11 +01:00
|
|
|
} scrollbars;
|
|
|
|
|
2018-04-05 23:44:46 +02:00
|
|
|
/// TOOLTIP
|
2018-01-02 02:21:38 +01:00
|
|
|
struct {
|
2018-01-02 02:15:11 +01:00
|
|
|
QColor text;
|
|
|
|
QColor background;
|
|
|
|
} tooltip;
|
2017-01-03 21:19:33 +01:00
|
|
|
|
2017-01-18 01:04:54 +01:00
|
|
|
void normalizeColor(QColor &color);
|
|
|
|
|
2017-02-02 01:23:26 +01:00
|
|
|
void update();
|
|
|
|
|
2018-04-03 02:55:32 +02:00
|
|
|
pajlada::Signals::NoArgSignal updated;
|
2016-12-30 19:20:04 +01:00
|
|
|
|
2018-01-12 23:09:05 +01:00
|
|
|
pajlada::Settings::Setting<QString> themeName;
|
2017-07-02 12:36:50 +02:00
|
|
|
pajlada::Settings::Setting<double> themeHue;
|
|
|
|
|
2018-01-12 23:09:05 +01:00
|
|
|
private:
|
2017-12-31 00:50:07 +01:00
|
|
|
void actuallyUpdate(double hue, double multiplier);
|
2017-09-12 19:06:16 +02:00
|
|
|
QColor blendColors(const QColor &color1, const QColor &color2, qreal ratio);
|
2017-01-18 01:04:54 +01:00
|
|
|
|
2017-06-26 16:41:20 +02:00
|
|
|
double middleLookupTable[360] = {};
|
|
|
|
double minLookupTable[360] = {};
|
2017-02-02 01:23:26 +01:00
|
|
|
|
2017-06-26 16:41:20 +02:00
|
|
|
void fillLookupTableValues(double (&array)[360], double from, double to, double fromValue,
|
|
|
|
double toValue);
|
2017-01-18 01:04:54 +01:00
|
|
|
|
2018-01-15 01:35:35 +01:00
|
|
|
bool isLight = false;
|
2017-12-31 00:50:07 +01:00
|
|
|
|
|
|
|
pajlada::Signals::NoArgSignal repaintVisibleChatWidgets;
|
|
|
|
|
|
|
|
friend class WindowManager;
|
2016-12-30 19:16:48 +01:00
|
|
|
};
|
|
|
|
|
2018-01-12 23:09:05 +01:00
|
|
|
} // namespace singletons
|
2017-06-07 10:09:24 +02:00
|
|
|
} // namespace chatterino
|