2017-01-03 21:19:33 +01:00
|
|
|
#ifndef SCROLLBAR_H
|
|
|
|
#define SCROLLBAR_H
|
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
#include "QMutex"
|
2017-01-11 18:52:09 +01:00
|
|
|
#include "QWidget"
|
2017-01-03 21:19:33 +01:00
|
|
|
#include "scrollbarhighlight.h"
|
|
|
|
|
|
|
|
class ScrollBar : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-01-11 18:52:09 +01:00
|
|
|
ScrollBar(QWidget *parent = 0);
|
2017-01-03 21:19:33 +01:00
|
|
|
~ScrollBar();
|
|
|
|
|
2017-01-11 18:52:09 +01:00
|
|
|
void removeHighlightsWhere(std::function<bool(ScrollBarHighlight &)> func);
|
|
|
|
void addHighlight(ScrollBarHighlight *highlight);
|
2017-01-03 21:19:33 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
QMutex mutex;
|
2017-01-11 18:52:09 +01:00
|
|
|
ScrollBarHighlight *highlights = NULL;
|
2017-01-03 21:19:33 +01:00
|
|
|
void paintEvent(QPaintEvent *);
|
|
|
|
|
|
|
|
QRect thumbRect;
|
|
|
|
};
|
|
|
|
|
2017-01-11 18:52:09 +01:00
|
|
|
#endif // SCROLLBAR_H
|