2018-06-26 14:09:39 +02:00
|
|
|
#include "widgets/helper/ScrollbarHighlight.hpp"
|
2020-01-25 11:03:10 +01:00
|
|
|
|
|
|
|
#include "Application.hpp"
|
2018-06-28 20:03:04 +02:00
|
|
|
#include "singletons/Theme.hpp"
|
2018-06-26 14:09:39 +02:00
|
|
|
#include "widgets/Scrollbar.hpp"
|
2017-01-03 21:19:33 +01:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
2017-01-18 21:30:23 +01:00
|
|
|
|
2018-01-06 03:48:56 +01:00
|
|
|
ScrollbarHighlight::ScrollbarHighlight()
|
2020-01-25 11:03:10 +01:00
|
|
|
: color_(std::make_shared<QColor>())
|
2018-07-06 19:23:47 +02:00
|
|
|
, style_(Style::None)
|
2018-01-06 03:48:56 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-01-25 11:03:10 +01:00
|
|
|
ScrollbarHighlight::ScrollbarHighlight(const std::shared_ptr<QColor> color,
|
2021-10-30 13:24:38 +02:00
|
|
|
Style style, bool isRedeemedHighlight,
|
2022-10-01 01:23:31 +02:00
|
|
|
bool isFirstMessageHighlight,
|
|
|
|
bool isElevatedMessageHighlight)
|
2018-07-06 19:23:47 +02:00
|
|
|
: color_(color)
|
|
|
|
, style_(style)
|
2020-04-15 23:15:45 +02:00
|
|
|
, isRedeemedHighlight_(isRedeemedHighlight)
|
2021-10-30 13:24:38 +02:00
|
|
|
, isFirstMessageHighlight_(isFirstMessageHighlight)
|
2022-10-01 01:23:31 +02:00
|
|
|
, isElevatedMessageHighlight_(isElevatedMessageHighlight)
|
2017-01-03 21:19:33 +01:00
|
|
|
{
|
|
|
|
}
|
2017-05-27 16:16:39 +02:00
|
|
|
|
2020-01-25 11:03:10 +01:00
|
|
|
QColor ScrollbarHighlight::getColor() const
|
2018-01-06 03:48:56 +01:00
|
|
|
{
|
2020-01-25 11:03:10 +01:00
|
|
|
return *this->color_;
|
2018-01-06 03:48:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ScrollbarHighlight::Style ScrollbarHighlight::getStyle() const
|
|
|
|
{
|
2018-07-06 19:23:47 +02:00
|
|
|
return this->style_;
|
2018-01-06 03:48:56 +01:00
|
|
|
}
|
|
|
|
|
2020-04-15 23:15:45 +02:00
|
|
|
bool ScrollbarHighlight::isRedeemedHighlight() const
|
|
|
|
{
|
|
|
|
return this->isRedeemedHighlight_;
|
|
|
|
}
|
|
|
|
|
2021-10-30 13:24:38 +02:00
|
|
|
bool ScrollbarHighlight::isFirstMessageHighlight() const
|
|
|
|
{
|
|
|
|
return this->isFirstMessageHighlight_;
|
|
|
|
}
|
|
|
|
|
2022-10-01 01:23:31 +02:00
|
|
|
bool ScrollbarHighlight::isElevatedMessageHighlight() const
|
|
|
|
{
|
|
|
|
return this->isElevatedMessageHighlight_;
|
|
|
|
}
|
|
|
|
|
2018-01-06 03:48:56 +01:00
|
|
|
bool ScrollbarHighlight::isNull() const
|
|
|
|
{
|
2022-06-05 17:40:57 +02:00
|
|
|
return this->style_ == None || !this->color_;
|
2018-01-06 03:48:56 +01:00
|
|
|
}
|
|
|
|
|
2017-05-27 16:16:39 +02:00
|
|
|
} // namespace chatterino
|