16#ifndef QGSDECORATEDSCROLLBAR_H
17#define QGSDECORATEDSCROLLBAR_H
29class QAbstractScrollArea;
30class QgsScrollBarHighlightOverlay;
90 QScrollBar *scrollBar()
const;
97 QAbstractScrollArea *scrollArea()
const;
104 void setScrollArea( QAbstractScrollArea *scrollArea );
111 double lineHeight()
const;
118 void setLineHeight(
double height );
125 double visibleRange()
const;
132 void setVisibleRange(
double visibleRange );
139 double margin()
const;
146 void setMargin(
double margin );
153 QHash<int, QVector<QgsScrollBarHighlight>> highlights() const
SIP_SKIP;
163 void removeHighlights(
int category );
168 void removeAllHighlights();
173 double mLineHeight = 0.0;
174 double mVisibleRange = 0.0;
175 double mMargin = 0.0;
176 QAbstractScrollArea *mScrollArea =
nullptr;
177 QPointer<QgsScrollBarHighlightOverlay> mOverlay;
182class QgsScrollBarHighlightOverlay :
public QWidget
191 void scheduleUpdate();
194 void paintEvent( QPaintEvent *paintEvent )
override;
195 bool eventFilter( QObject *
object, QEvent *event )
override;
198 void drawHighlights( QPainter *painter,
201 double docSizeToHandleSizeRatio,
203 const QRect &viewport );
205 QRect overlayRect()
const;
206 QRect handleRect()
const;
209 QMap<QgsScrollBarHighlight::Priority, QMap<QRgb, QMap<int, int>>> mHighlightCache;
211 inline QScrollBar *scrollBar()
const {
return mHighlightController->scrollBar(); }
213 bool mIsCacheUpdateScheduled =
true;