1 #pragma once 2 3 #include "BaseTheme.hpp" 4 #include "common/Singleton.hpp" 5 #include "util/RapidJsonSerializeQString.hpp" 6 7 #include <QBrush> 8 #include <QColor> 9 #include <pajlada/settings/setting.hpp> 10 #include <singletons/Settings.hpp> 11 12 namespace chatterino { 13 14 class WindowManager; 15 16 class Theme final : public Singleton, public BaseTheme 17 { 18 public: 19 Theme(); 20 21 /// SPLITS 22 struct { 23 QColor messageSeperator; 24 QColor background; 25 QColor dropPreview; 26 QColor dropPreviewBorder; 27 QColor dropTargetRect; 28 QColor dropTargetRectBorder; 29 QColor resizeHandle; 30 QColor resizeHandleBackground; 31 32 struct { 33 QColor border; 34 QColor background; 35 QColor text; 36 QColor focusedText; 37 // int margin; 38 } header; 39 40 struct { 41 QColor border; 42 QColor background; 43 QColor selection; 44 QColor focusedLine; 45 QColor text; 46 QString styleSheet; 47 // int margin; 48 } input; 49 } splits; 50 51 struct { 52 QPixmap copy; 53 } buttons; 54 55 void normalizeColor(QColor &color); 56 57 private: 58 void actuallyUpdate(double hue, double multiplier) override; 59 void fillLookupTableValues(double (&array)[360], double from, double to, 60 double fromValue, double toValue); 61 62 double middleLookupTable_[360] = {}; 63 double minLookupTable_[360] = {}; 64 65 pajlada::Signals::NoArgSignal repaintVisibleChatWidgets_; 66 67 friend class WindowManager; 68 }; 69 70 } // namespace chatterino 71