16#ifndef QGSDECORATEDSCROLLBAR_H
17#define QGSDECORATEDSCROLLBAR_H
29class QAbstractScrollArea;
30class QgsScrollBarHighlightOverlay;
88 QScrollBar *scrollBar()
const;
95 QAbstractScrollArea *scrollArea()
const;
102 void setScrollArea( QAbstractScrollArea *scrollArea );
109 double lineHeight()
const;
116 void setLineHeight(
double height );
123 double visibleRange()
const;
130 void setVisibleRange(
double visibleRange );
137 double margin()
const;
144 void setMargin(
double margin );
151 QHash<int, QVector<QgsScrollBarHighlight>> highlights() const
SIP_SKIP;
161 void removeHighlights(
int category );
166 void removeAllHighlights();
170 double mLineHeight = 0.0;
171 double mVisibleRange = 0.0;
172 double mMargin = 0.0;
173 QAbstractScrollArea *mScrollArea =
nullptr;
174 QPointer<QgsScrollBarHighlightOverlay> mOverlay;
179class QgsScrollBarHighlightOverlay :
public QWidget
188 void scheduleUpdate();
191 void paintEvent( QPaintEvent *paintEvent )
override;
192 bool eventFilter( QObject *
object, QEvent *event )
override;
195 void drawHighlights( QPainter *painter,
int docStart,
int docSize,
double docSizeToHandleSizeRatio,
int handleOffset,
const QRect &viewport );
197 QRect overlayRect()
const;
198 QRect handleRect()
const;
201 QMap<QgsScrollBarHighlight::Priority, QMap<QRgb, QMap<int, int>>> mHighlightCache;
203 inline QScrollBar *scrollBar()
const {
return mHighlightController->scrollBar(); }
205 bool mIsCacheUpdateScheduled =
true;