refined highlight and added bits highlights
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "Application.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
#include "widgets/helper/ChannelView.hpp"
|
||||
|
||||
#include <QDebug>
|
||||
@@ -242,6 +243,8 @@ void Scrollbar::paintEvent(QPaintEvent *)
|
||||
QPainter painter(this);
|
||||
painter.fillRect(rect(), this->theme->scrollbars.background);
|
||||
|
||||
bool enableRedeemedHighlights = getSettings()->enableRedeemedHighlight;
|
||||
|
||||
// painter.fillRect(QRect(xOffset, 0, width(), this->buttonHeight),
|
||||
// this->themeManager->ScrollbarArrow);
|
||||
// painter.fillRect(QRect(xOffset, height() - this->buttonHeight,
|
||||
@@ -274,7 +277,8 @@ void Scrollbar::paintEvent(QPaintEvent *)
|
||||
int w = this->width();
|
||||
float y = 0;
|
||||
float dY = float(this->height()) / float(snapshotLength);
|
||||
int highlightHeight = int(std::ceil(dY));
|
||||
int highlightHeight =
|
||||
int(std::ceil(std::max<float>(this->scale() * 2, dY)));
|
||||
|
||||
for (size_t i = 0; i < snapshotLength; i++)
|
||||
{
|
||||
@@ -282,7 +286,13 @@ void Scrollbar::paintEvent(QPaintEvent *)
|
||||
|
||||
if (!highlight.isNull())
|
||||
{
|
||||
if (highlight.isRedeemedHighlight() && !enableRedeemedHighlights)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
QColor color = highlight.getColor();
|
||||
color.setAlpha(255);
|
||||
|
||||
switch (highlight.getStyle())
|
||||
{
|
||||
|
||||
@@ -13,9 +13,10 @@ ScrollbarHighlight::ScrollbarHighlight()
|
||||
}
|
||||
|
||||
ScrollbarHighlight::ScrollbarHighlight(const std::shared_ptr<QColor> color,
|
||||
Style style)
|
||||
Style style, bool isRedeemedHighlight)
|
||||
: color_(color)
|
||||
, style_(style)
|
||||
, isRedeemedHighlight_(isRedeemedHighlight)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -29,6 +30,11 @@ ScrollbarHighlight::Style ScrollbarHighlight::getStyle() const
|
||||
return this->style_;
|
||||
}
|
||||
|
||||
bool ScrollbarHighlight::isRedeemedHighlight() const
|
||||
{
|
||||
return this->isRedeemedHighlight_;
|
||||
}
|
||||
|
||||
bool ScrollbarHighlight::isNull() const
|
||||
{
|
||||
return this->style_ == None;
|
||||
|
||||
@@ -17,15 +17,17 @@ public:
|
||||
ScrollbarHighlight();
|
||||
|
||||
ScrollbarHighlight(const std::shared_ptr<QColor> color,
|
||||
Style style = Default);
|
||||
Style style = Default, bool isRedeemedHighlight = false);
|
||||
|
||||
QColor getColor() const;
|
||||
Style getStyle() const;
|
||||
bool isRedeemedHighlight() const;
|
||||
bool isNull() const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<QColor> color_;
|
||||
Style style_;
|
||||
bool isRedeemedHighlight_;
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -29,7 +29,6 @@ namespace chatterino {
|
||||
|
||||
HighlightingPage::HighlightingPage()
|
||||
{
|
||||
auto app = getApp();
|
||||
LayoutCreator<HighlightingPage> layoutCreator(this);
|
||||
|
||||
auto layout = layoutCreator.emplace<QVBoxLayout>().withoutMargin();
|
||||
@@ -228,7 +227,8 @@ void HighlightingPage::tableCellClicked(const QModelIndex &clicked,
|
||||
Qt::CheckStateRole);
|
||||
}
|
||||
}
|
||||
else if (clicked.column() == Column::Color)
|
||||
else if (clicked.column() == Column::Color &&
|
||||
clicked.row() != HighlightModel::WHISPER_ROW)
|
||||
{
|
||||
auto initial =
|
||||
view->getModel()->data(clicked, Qt::DecorationRole).value<QColor>();
|
||||
|
||||
Reference in New Issue
Block a user