made appbase compile standalone

This commit is contained in:
fourtf
2018-11-25 15:02:48 +01:00
parent a9ca33f431
commit 0b94d0f763
14 changed files with 32 additions and 525 deletions
+3 -89
View File
@@ -1,5 +1,6 @@
#pragma once
#include "ABTheme.hpp"
#include "common/Singleton.hpp"
#include "util/RapidJsonSerializeQString.hpp"
@@ -12,48 +13,11 @@ namespace chatterino {
class WindowManager;
class Theme final : public Singleton
class Theme final : public Singleton, public ABTheme
{
public:
Theme();
bool isLightTheme() const
{
return this->isLight_;
}
struct TabColors {
QColor text;
struct {
QBrush regular;
QBrush hover;
QBrush unfocused;
} backgrounds;
struct {
QColor regular;
QColor hover;
QColor unfocused;
} line;
};
/// WINDOW
struct {
QColor background;
QColor text;
QColor borderUnfocused;
QColor borderFocused;
} window;
/// TABS
struct {
TabColors regular;
TabColors newMessage;
TabColors highlighted;
TabColors selected;
QColor border;
QColor bottomLine;
} tabs;
/// SPLITS
struct {
QColor messageSeperator;
@@ -84,66 +48,16 @@ public:
} input;
} splits;
/// MESSAGES
struct {
struct {
QColor regular;
QColor caret;
QColor link;
QColor system;
} textColors;
struct {
QColor regular;
QColor alternate;
QColor highlighted;
QColor subscription;
// QColor whisper;
} backgrounds;
QColor disabled;
// QColor seperator;
// QColor seperatorInner;
QColor selection;
} messages;
/// SCROLLBAR
struct {
QColor background;
QColor thumb;
QColor thumbSelected;
struct {
QColor highlight;
QColor subscription;
} highlights;
} scrollbars;
/// TOOLTIP
struct {
QColor text;
QColor background;
} tooltip;
void normalizeColor(QColor &color);
void update();
pajlada::Signals::NoArgSignal updated;
QStringSetting themeName{"/appearance/theme/name", "Dark"};
DoubleSetting themeHue{"/appearance/theme/hue", 0.0};
private:
void actuallyUpdate(double hue, double multiplier);
QColor blendColors(const QColor &color1, const QColor &color2, qreal ratio);
void actuallyUpdate(double hue, double multiplier) override;
void fillLookupTableValues(double (&array)[360], double from, double to,
double fromValue, double toValue);
double middleLookupTable_[360] = {};
double minLookupTable_[360] = {};
bool isLight_ = false;
pajlada::Signals::NoArgSignal repaintVisibleChatWidgets_;
friend class WindowManager;