2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2015-06-04 10:43:34 +02:00
|
|
|
|
2017-11-02 13:06:38 +01:00
|
|
|
#include "highlightscrollbarcontroller.h"
|
2015-06-04 10:43:34 +02:00
|
|
|
|
2017-11-02 13:06:38 +01:00
|
|
|
#include <QAbstractScrollArea>
|
2015-06-04 10:43:34 +02:00
|
|
|
#include <QPainter>
|
|
|
|
|
#include <QResizeEvent>
|
2017-11-02 13:06:38 +01:00
|
|
|
#include <QScrollBar>
|
2015-06-04 10:43:34 +02:00
|
|
|
#include <QStyle>
|
|
|
|
|
#include <QStyleOptionSlider>
|
|
|
|
|
|
|
|
|
|
using namespace Utils;
|
2020-06-26 13:59:38 +02:00
|
|
|
|
2017-01-14 22:49:37 +02:00
|
|
|
namespace Core {
|
|
|
|
|
|
2020-02-13 16:14:56 +01:00
|
|
|
/*!
|
|
|
|
|
\class Core::Highlight
|
|
|
|
|
\inmodule QtCreator
|
|
|
|
|
\internal
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
\class Core::HighlightScrollBarController
|
|
|
|
|
\inmodule QtCreator
|
|
|
|
|
\internal
|
|
|
|
|
*/
|
|
|
|
|
|
2017-01-14 22:49:37 +02:00
|
|
|
class HighlightScrollBarOverlay : public QWidget
|
|
|
|
|
{
|
|
|
|
|
public:
|
2017-11-02 13:06:38 +01:00
|
|
|
HighlightScrollBarOverlay(HighlightScrollBarController *scrollBarController)
|
|
|
|
|
: QWidget(scrollBarController->scrollArea())
|
|
|
|
|
, m_highlightController(scrollBarController)
|
|
|
|
|
{
|
|
|
|
|
setAttribute(Qt::WA_TransparentForMouseEvents);
|
2023-05-03 19:42:51 +02:00
|
|
|
scrollBar()->parentWidget()->installEventFilter(this);
|
2017-11-02 13:06:38 +01:00
|
|
|
doResize();
|
|
|
|
|
doMove();
|
|
|
|
|
show();
|
|
|
|
|
}
|
2017-01-14 22:49:37 +02:00
|
|
|
|
2017-11-02 13:06:38 +01:00
|
|
|
void doResize()
|
|
|
|
|
{
|
2023-05-03 19:42:51 +02:00
|
|
|
resize(scrollBar()->size());
|
2017-11-02 13:06:38 +01:00
|
|
|
}
|
2017-01-14 22:49:37 +02:00
|
|
|
|
2017-11-02 13:06:38 +01:00
|
|
|
void doMove()
|
|
|
|
|
{
|
2023-05-03 19:42:51 +02:00
|
|
|
move(parentWidget()->mapFromGlobal(scrollBar()->mapToGlobal(scrollBar()->pos())));
|
2017-11-02 13:06:38 +01:00
|
|
|
}
|
2017-01-14 22:49:37 +02:00
|
|
|
|
2017-11-02 13:06:38 +01:00
|
|
|
void scheduleUpdate();
|
2017-01-14 22:49:37 +02:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void paintEvent(QPaintEvent *paintEvent) override;
|
2017-11-02 13:06:38 +01:00
|
|
|
bool eventFilter(QObject *object, QEvent *event) override;
|
2017-01-14 22:49:37 +02:00
|
|
|
|
|
|
|
|
private:
|
2017-11-29 18:25:01 +01:00
|
|
|
void drawHighlights(QPainter *painter,
|
|
|
|
|
int docStart,
|
|
|
|
|
int docSize,
|
|
|
|
|
double docSizeToHandleSizeRatio,
|
|
|
|
|
int handleOffset,
|
|
|
|
|
const QRect &viewport);
|
2017-11-02 13:06:38 +01:00
|
|
|
void updateCache();
|
|
|
|
|
QRect overlayRect() const;
|
2017-11-29 18:25:01 +01:00
|
|
|
QRect handleRect() const;
|
2015-06-04 10:43:34 +02:00
|
|
|
|
2017-11-29 18:25:01 +01:00
|
|
|
// line start to line end
|
|
|
|
|
QMap<Highlight::Priority, QMap<Utils::Theme::Color, QMap<int, int>>> m_highlightCache;
|
2015-06-04 10:43:34 +02:00
|
|
|
|
2023-05-03 19:42:51 +02:00
|
|
|
inline QScrollBar *scrollBar() const { return m_highlightController->scrollBar(); }
|
2017-11-02 13:06:38 +01:00
|
|
|
HighlightScrollBarController *m_highlightController;
|
2017-11-29 18:25:01 +01:00
|
|
|
bool m_isCacheUpdateScheduled = true;
|
2017-11-02 13:06:38 +01:00
|
|
|
};
|
2015-06-04 10:43:34 +02:00
|
|
|
|
|
|
|
|
void HighlightScrollBarOverlay::scheduleUpdate()
|
|
|
|
|
{
|
2017-11-29 18:25:01 +01:00
|
|
|
if (m_isCacheUpdateScheduled)
|
2015-06-04 10:43:34 +02:00
|
|
|
return;
|
|
|
|
|
|
2017-11-29 18:25:01 +01:00
|
|
|
m_isCacheUpdateScheduled = true;
|
2021-01-28 11:29:14 +01:00
|
|
|
QMetaObject::invokeMethod(this, QOverload<>::of(&QWidget::update), Qt::QueuedConnection);
|
2015-06-04 10:43:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HighlightScrollBarOverlay::paintEvent(QPaintEvent *paintEvent)
|
|
|
|
|
{
|
|
|
|
|
QWidget::paintEvent(paintEvent);
|
|
|
|
|
|
|
|
|
|
updateCache();
|
|
|
|
|
|
2017-11-29 18:25:01 +01:00
|
|
|
if (m_highlightCache.isEmpty())
|
2015-06-04 10:43:34 +02:00
|
|
|
return;
|
|
|
|
|
|
2017-11-29 18:25:01 +01:00
|
|
|
QPainter painter(this);
|
|
|
|
|
painter.setRenderHint(QPainter::Antialiasing, false);
|
|
|
|
|
|
|
|
|
|
const QRect &gRect = overlayRect();
|
|
|
|
|
const QRect &hRect = handleRect();
|
|
|
|
|
|
2020-02-28 08:51:44 +01:00
|
|
|
constexpr int marginX = 3;
|
|
|
|
|
constexpr int marginH = -2 * marginX + 1;
|
2017-11-29 18:25:01 +01:00
|
|
|
const QRect aboveHandleRect = QRect(gRect.x() + marginX,
|
|
|
|
|
gRect.y(),
|
|
|
|
|
gRect.width() + marginH,
|
|
|
|
|
hRect.y() - gRect.y());
|
|
|
|
|
const QRect handleRect = QRect(gRect.x() + marginX,
|
|
|
|
|
hRect.y(),
|
|
|
|
|
gRect.width() + marginH,
|
|
|
|
|
hRect.height());
|
|
|
|
|
const QRect belowHandleRect = QRect(gRect.x() + marginX,
|
|
|
|
|
hRect.y() + hRect.height(),
|
|
|
|
|
gRect.width() + marginH,
|
|
|
|
|
gRect.height() - hRect.height() + gRect.y() - hRect.y());
|
|
|
|
|
|
2023-05-03 19:42:51 +02:00
|
|
|
const int aboveValue = scrollBar()->value();
|
|
|
|
|
const int belowValue = scrollBar()->maximum() - scrollBar()->value();
|
2020-02-28 11:32:58 +01:00
|
|
|
const int sizeDocAbove = int(aboveValue * m_highlightController->lineHeight());
|
|
|
|
|
const int sizeDocBelow = int(belowValue * m_highlightController->lineHeight());
|
2017-11-29 18:25:01 +01:00
|
|
|
const int sizeDocVisible = int(m_highlightController->visibleRange());
|
|
|
|
|
|
|
|
|
|
const int scrollBarBackgroundHeight = aboveHandleRect.height() + belowHandleRect.height();
|
|
|
|
|
const int sizeDocInvisible = sizeDocAbove + sizeDocBelow;
|
|
|
|
|
const double backgroundRatio = sizeDocInvisible
|
|
|
|
|
? ((double)scrollBarBackgroundHeight / sizeDocInvisible) : 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (aboveValue) {
|
|
|
|
|
drawHighlights(&painter,
|
|
|
|
|
0,
|
|
|
|
|
sizeDocAbove,
|
|
|
|
|
backgroundRatio,
|
|
|
|
|
0,
|
|
|
|
|
aboveHandleRect);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (belowValue) {
|
|
|
|
|
// This is the hypothetical handle height if the handle would
|
|
|
|
|
// be stretched using the background ratio.
|
|
|
|
|
const double handleVirtualHeight = sizeDocVisible * backgroundRatio;
|
|
|
|
|
// Skip the doc above and visible part.
|
|
|
|
|
const int offset = qRound(aboveHandleRect.height() + handleVirtualHeight);
|
|
|
|
|
|
|
|
|
|
drawHighlights(&painter,
|
|
|
|
|
sizeDocAbove + sizeDocVisible,
|
|
|
|
|
sizeDocBelow,
|
|
|
|
|
backgroundRatio,
|
|
|
|
|
offset,
|
|
|
|
|
belowHandleRect);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const double handleRatio = sizeDocVisible
|
|
|
|
|
? ((double)handleRect.height() / sizeDocVisible) : 0;
|
|
|
|
|
|
|
|
|
|
// This is the hypothetical handle position if the background would
|
|
|
|
|
// be stretched using the handle ratio.
|
|
|
|
|
const double aboveVirtualHeight = sizeDocAbove * handleRatio;
|
|
|
|
|
|
|
|
|
|
// This is the accurate handle position (double)
|
|
|
|
|
const double accurateHandlePos = sizeDocAbove * backgroundRatio;
|
|
|
|
|
// The correction between handle position (int) and accurate position (double)
|
|
|
|
|
const double correction = aboveHandleRect.height() - accurateHandlePos;
|
|
|
|
|
// Skip the doc above and apply correction
|
|
|
|
|
const int offset = qRound(aboveVirtualHeight + correction);
|
|
|
|
|
|
|
|
|
|
drawHighlights(&painter,
|
|
|
|
|
sizeDocAbove,
|
|
|
|
|
sizeDocVisible,
|
|
|
|
|
handleRatio,
|
|
|
|
|
offset,
|
|
|
|
|
handleRect);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HighlightScrollBarOverlay::drawHighlights(QPainter *painter,
|
|
|
|
|
int docStart,
|
|
|
|
|
int docSize,
|
|
|
|
|
double docSizeToHandleSizeRatio,
|
|
|
|
|
int handleOffset,
|
|
|
|
|
const QRect &viewport)
|
|
|
|
|
{
|
|
|
|
|
if (docSize <= 0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
painter->save();
|
|
|
|
|
painter->setClipRect(viewport);
|
|
|
|
|
|
|
|
|
|
const double lineHeight = m_highlightController->lineHeight();
|
|
|
|
|
|
2022-10-07 14:46:06 +02:00
|
|
|
for (const QMap<Utils::Theme::Color, QMap<int, int>> &colors : std::as_const(m_highlightCache)) {
|
2017-11-29 18:25:01 +01:00
|
|
|
const auto itColorEnd = colors.constEnd();
|
|
|
|
|
for (auto itColor = colors.constBegin(); itColor != itColorEnd; ++itColor) {
|
|
|
|
|
const QColor &color = creatorTheme()->color(itColor.key());
|
|
|
|
|
const QMap<int, int> &positions = itColor.value();
|
|
|
|
|
const auto itPosEnd = positions.constEnd();
|
2018-07-21 21:11:46 +02:00
|
|
|
const auto firstPos = int(docStart / lineHeight);
|
2017-11-29 18:25:01 +01:00
|
|
|
auto itPos = positions.upperBound(firstPos);
|
|
|
|
|
if (itPos != positions.constBegin())
|
|
|
|
|
--itPos;
|
|
|
|
|
while (itPos != itPosEnd) {
|
|
|
|
|
const double posStart = itPos.key() * lineHeight;
|
|
|
|
|
const double posEnd = (itPos.value() + 1) * lineHeight;
|
|
|
|
|
if (posEnd < docStart) {
|
|
|
|
|
++itPos;
|
|
|
|
|
continue;
|
2015-06-04 10:43:34 +02:00
|
|
|
}
|
2017-11-29 18:25:01 +01:00
|
|
|
if (posStart > docStart + docSize)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
const int height = qMax(qRound((posEnd - posStart) * docSizeToHandleSizeRatio), 1);
|
|
|
|
|
const int top = qRound(posStart * docSizeToHandleSizeRatio) - handleOffset + viewport.y();
|
|
|
|
|
|
|
|
|
|
const QRect rect(viewport.left(), top, viewport.width(), height);
|
|
|
|
|
painter->fillRect(rect, color);
|
|
|
|
|
++itPos;
|
2015-06-04 10:43:34 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-11-29 18:25:01 +01:00
|
|
|
painter->restore();
|
2015-06-04 10:43:34 +02:00
|
|
|
}
|
2017-01-14 22:49:37 +02:00
|
|
|
|
2017-11-02 13:06:38 +01:00
|
|
|
bool HighlightScrollBarOverlay::eventFilter(QObject *object, QEvent *event)
|
|
|
|
|
{
|
|
|
|
|
switch (event->type()) {
|
|
|
|
|
case QEvent::Move:
|
|
|
|
|
doMove();
|
|
|
|
|
break;
|
|
|
|
|
case QEvent::Resize:
|
|
|
|
|
doResize();
|
|
|
|
|
break;
|
|
|
|
|
case QEvent::ZOrderChange:
|
|
|
|
|
raise();
|
|
|
|
|
break;
|
2022-10-27 13:24:52 +02:00
|
|
|
case QEvent::Show:
|
|
|
|
|
show();
|
|
|
|
|
break;
|
|
|
|
|
case QEvent::Hide:
|
|
|
|
|
hide();
|
|
|
|
|
break;
|
2017-11-02 13:06:38 +01:00
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return QWidget::eventFilter(object, event);
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-29 18:25:01 +01:00
|
|
|
static void insertPosition(QMap<int, int> *map, int position)
|
|
|
|
|
{
|
|
|
|
|
auto itNext = map->upperBound(position);
|
|
|
|
|
|
|
|
|
|
bool gluedWithPrev = false;
|
|
|
|
|
if (itNext != map->begin()) {
|
2020-08-12 09:40:51 +02:00
|
|
|
auto itPrev = std::prev(itNext);
|
2017-11-29 18:25:01 +01:00
|
|
|
const int keyStart = itPrev.key();
|
|
|
|
|
const int keyEnd = itPrev.value();
|
|
|
|
|
if (position >= keyStart && position <= keyEnd)
|
|
|
|
|
return; // pos is already included
|
|
|
|
|
|
|
|
|
|
if (keyEnd + 1 == position) {
|
|
|
|
|
// glue with prev
|
|
|
|
|
(*itPrev)++;
|
|
|
|
|
gluedWithPrev = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (itNext != map->end() && itNext.key() == position + 1) {
|
|
|
|
|
const int keyEnd = itNext.value();
|
|
|
|
|
itNext = map->erase(itNext);
|
|
|
|
|
if (gluedWithPrev) {
|
|
|
|
|
// glue with prev and next
|
2020-08-12 09:40:51 +02:00
|
|
|
auto itPrev = std::prev(itNext);
|
2017-11-29 18:25:01 +01:00
|
|
|
*itPrev = keyEnd;
|
|
|
|
|
} else {
|
|
|
|
|
// glue with next
|
|
|
|
|
itNext = map->insert(itNext, position, keyEnd);
|
|
|
|
|
}
|
|
|
|
|
return; // glued
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (gluedWithPrev)
|
|
|
|
|
return; // glued
|
|
|
|
|
|
|
|
|
|
map->insert(position, position);
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-02 13:06:38 +01:00
|
|
|
void HighlightScrollBarOverlay::updateCache()
|
|
|
|
|
{
|
2017-11-29 18:25:01 +01:00
|
|
|
if (!m_isCacheUpdateScheduled)
|
2017-11-02 13:06:38 +01:00
|
|
|
return;
|
|
|
|
|
|
2017-11-29 18:25:01 +01:00
|
|
|
m_highlightCache.clear();
|
|
|
|
|
|
|
|
|
|
const QHash<Id, QVector<Highlight>> highlightsForId = m_highlightController->highlights();
|
2019-01-16 14:47:24 +01:00
|
|
|
for (const QVector<Highlight> &highlights : highlightsForId) {
|
2017-11-29 18:25:01 +01:00
|
|
|
for (const auto &highlight : highlights) {
|
|
|
|
|
auto &highlightMap = m_highlightCache[highlight.priority][highlight.color];
|
|
|
|
|
insertPosition(&highlightMap, highlight.position);
|
2017-11-02 13:06:38 +01:00
|
|
|
}
|
|
|
|
|
}
|
2017-11-29 18:25:01 +01:00
|
|
|
|
|
|
|
|
m_isCacheUpdateScheduled = false;
|
2017-11-02 13:06:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QRect HighlightScrollBarOverlay::overlayRect() const
|
|
|
|
|
{
|
2023-05-03 19:42:51 +02:00
|
|
|
QStyleOptionSlider opt = qt_qscrollbarStyleOption(scrollBar());
|
|
|
|
|
return scrollBar()->style()->subControlRect(QStyle::CC_ScrollBar, &opt, QStyle::SC_ScrollBarGroove, scrollBar());
|
2017-11-02 13:06:38 +01:00
|
|
|
}
|
|
|
|
|
|
2017-11-29 18:25:01 +01:00
|
|
|
QRect HighlightScrollBarOverlay::handleRect() const
|
|
|
|
|
{
|
2023-05-03 19:42:51 +02:00
|
|
|
QStyleOptionSlider opt = qt_qscrollbarStyleOption(scrollBar());
|
|
|
|
|
return scrollBar()->style()->subControlRect(QStyle::CC_ScrollBar, &opt, QStyle::SC_ScrollBarSlider, scrollBar());
|
2017-11-29 18:25:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2017-11-02 13:06:38 +01:00
|
|
|
/////////////
|
|
|
|
|
|
2017-06-01 12:06:03 +02:00
|
|
|
Highlight::Highlight(Id category_, int position_,
|
|
|
|
|
Theme::Color color_, Highlight::Priority priority_)
|
|
|
|
|
: category(category_)
|
|
|
|
|
, position(position_)
|
|
|
|
|
, color(color_)
|
|
|
|
|
, priority(priority_)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-02 13:06:38 +01:00
|
|
|
/////////////
|
|
|
|
|
|
|
|
|
|
HighlightScrollBarController::~HighlightScrollBarController()
|
|
|
|
|
{
|
|
|
|
|
if (m_overlay)
|
|
|
|
|
delete m_overlay;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QScrollBar *HighlightScrollBarController::scrollBar() const
|
|
|
|
|
{
|
|
|
|
|
if (m_scrollArea)
|
|
|
|
|
return m_scrollArea->verticalScrollBar();
|
|
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QAbstractScrollArea *HighlightScrollBarController::scrollArea() const
|
|
|
|
|
{
|
|
|
|
|
return m_scrollArea;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HighlightScrollBarController::setScrollArea(QAbstractScrollArea *scrollArea)
|
|
|
|
|
{
|
|
|
|
|
if (m_scrollArea == scrollArea)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (m_overlay) {
|
|
|
|
|
delete m_overlay;
|
|
|
|
|
m_overlay = nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_scrollArea = scrollArea;
|
|
|
|
|
|
|
|
|
|
if (m_scrollArea) {
|
|
|
|
|
m_overlay = new HighlightScrollBarOverlay(this);
|
|
|
|
|
m_overlay->scheduleUpdate();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-29 18:25:01 +01:00
|
|
|
double HighlightScrollBarController::lineHeight() const
|
|
|
|
|
{
|
2022-10-25 10:52:52 +02:00
|
|
|
return ceil(m_lineHeight);
|
2017-11-29 18:25:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HighlightScrollBarController::setLineHeight(double lineHeight)
|
|
|
|
|
{
|
|
|
|
|
m_lineHeight = lineHeight;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double HighlightScrollBarController::visibleRange() const
|
2017-11-02 13:06:38 +01:00
|
|
|
{
|
|
|
|
|
return m_visibleRange;
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-29 18:25:01 +01:00
|
|
|
void HighlightScrollBarController::setVisibleRange(double visibleRange)
|
2017-11-02 13:06:38 +01:00
|
|
|
{
|
|
|
|
|
m_visibleRange = visibleRange;
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-29 18:25:01 +01:00
|
|
|
double HighlightScrollBarController::margin() const
|
2017-11-02 13:06:38 +01:00
|
|
|
{
|
2017-11-29 18:25:01 +01:00
|
|
|
return m_margin;
|
2017-11-02 13:06:38 +01:00
|
|
|
}
|
|
|
|
|
|
2017-11-29 18:25:01 +01:00
|
|
|
void HighlightScrollBarController::setMargin(double margin)
|
2017-11-02 13:06:38 +01:00
|
|
|
{
|
2017-11-29 18:25:01 +01:00
|
|
|
m_margin = margin;
|
2017-11-02 13:06:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QHash<Id, QVector<Highlight>> HighlightScrollBarController::highlights() const
|
|
|
|
|
{
|
|
|
|
|
return m_highlights;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HighlightScrollBarController::addHighlight(Highlight highlight)
|
|
|
|
|
{
|
|
|
|
|
if (!m_overlay)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
m_highlights[highlight.category] << highlight;
|
|
|
|
|
m_overlay->scheduleUpdate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HighlightScrollBarController::removeHighlights(Id category)
|
|
|
|
|
{
|
|
|
|
|
if (!m_overlay)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
m_highlights.remove(category);
|
|
|
|
|
m_overlay->scheduleUpdate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HighlightScrollBarController::removeAllHighlights()
|
|
|
|
|
{
|
|
|
|
|
if (!m_overlay)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
m_highlights.clear();
|
|
|
|
|
m_overlay->scheduleUpdate();
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-14 22:49:37 +02:00
|
|
|
} // namespace Core
|