mirror-chatterino2/src/widgets/helper/ScrollbarHighlight.hpp

41 lines
985 B
C++
Raw Normal View History

#pragma once
2017-01-03 21:19:33 +01:00
#include <memory>
#include <QColor>
2017-04-14 17:52:22 +02:00
namespace chatterino {
2018-01-06 03:48:56 +01:00
class ScrollbarHighlight
2017-01-03 21:19:33 +01:00
{
public:
2018-01-06 03:48:56 +01:00
enum Style : char { None, Default, Line };
2017-01-03 21:19:33 +01:00
/**
* @brief Constructs an invalid ScrollbarHighlight.
*
* A highlight constructed this way will not show on the scrollbar.
* For these, use the static ScrollbarHighlight::newSubscription and
* ScrollbarHighlight::newHighlight methods.
*/
2018-01-06 03:48:56 +01:00
ScrollbarHighlight();
2017-01-03 21:19:33 +01:00
ScrollbarHighlight(const std::shared_ptr<QColor> color,
Style style = Default, bool isRedeemedHighlight = false,
bool isFirstMessageHighlight = false);
QColor getColor() const;
2018-01-06 03:48:56 +01:00
Style getStyle() const;
bool isRedeemedHighlight() const;
bool isFirstMessageHighlight() const;
2018-01-06 03:48:56 +01:00
bool isNull() const;
2017-01-03 21:19:33 +01:00
private:
std::shared_ptr<QColor> color_;
2018-07-06 19:23:47 +02:00
Style style_;
bool isRedeemedHighlight_;
bool isFirstMessageHighlight_;
2017-01-03 21:19:33 +01:00
};
2017-05-27 16:16:39 +02:00
} // namespace chatterino