Files
chatterino2/src/BaseTheme.hpp
nerix be72d73c3d feat: add Go to message action in various places (#3953)
* feat: add `Go to message` action in search popup

* chore: add changelog entry

* fix: only scroll if the scrollbar is shown

* fix: go to message when view isn't focused

* feat: animate highlighted message

* fix: missing includes

* fix: order of initialization

* fix: add `ChannelView::mayContainMessage` to filter messages

* feat: add `Go to message` action in `/mentions`

* fix: ignore any mentions channel when searching for split

* feat: add `Go to message` action in reply-threads

* fix: remove redundant `source` parameter

* feat: add `Go to message` action in user-cards

* feat: add link to deleted message

* fix: set current time to 0 when starting animation

* chore: update changelog

* fix: add default case (unreachable)

* chore: removed unused variable

* fix: search in mentions

* fix: always attempt to focus split

* fix: rename `Link::MessageId` to `Link::JumpToMessage`

* fix: rename `selectAndScrollToMessage` to `scrollToMessage`

* fix: rename internal `scrollToMessage` to `scrollToMessageLayout`

* fix: deleted message link in search popup

* chore: reword explanation

* fix: use for-loop instead of `std::find_if`

* refactor: define highlight colors in `BaseTheme`

* core: replace `iff` with `if`

* fix: only return if the message found

* Reword/phrase/dot changelog entries

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
2022-09-11 16:37:13 +02:00

122 lines
2.4 KiB
C++

#ifndef AB_THEME_H
#define AB_THEME_H
#include <QBrush>
#include <QColor>
#include <common/ChatterinoSetting.hpp>
#ifdef AB_CUSTOM_THEME
# define AB_THEME_CLASS BaseTheme
#else
# define AB_THEME_CLASS Theme
#endif
namespace chatterino {
class Theme;
class AB_THEME_CLASS
{
public:
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;
void update();
virtual void actuallyUpdate(double hue, double multiplier);
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};
private:
bool isLight_ = false;
};
// Implemented in parent project if AB_CUSTOM_THEME is set.
// Otherwise implemented in BaseThemecpp
Theme *getTheme();
} // namespace chatterino
#ifdef CHATTERINO
# include "singletons/Theme.hpp"
#endif
#endif