summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/coreplugin/find/highlightscrollbar.cpp35
-rw-r--r--src/plugins/coreplugin/find/highlightscrollbar.h32
2 files changed, 34 insertions, 33 deletions
diff --git a/src/plugins/coreplugin/find/highlightscrollbar.cpp b/src/plugins/coreplugin/find/highlightscrollbar.cpp
index 5c25984758..7a7a9f13b0 100644
--- a/src/plugins/coreplugin/find/highlightscrollbar.cpp
+++ b/src/plugins/coreplugin/find/highlightscrollbar.cpp
@@ -33,8 +33,39 @@
#include <QStyleOptionSlider>
#include <QTimer>
-using namespace Core;
using namespace Utils;
+namespace Core {
+
+class HighlightScrollBarOverlay : public QWidget
+{
+public:
+ HighlightScrollBarOverlay(HighlightScrollBar *scrollBar)
+ : QWidget(scrollBar)
+ , m_visibleRange(0.0)
+ , m_offset(0.0)
+ , m_cacheUpdateScheduled(false)
+ , m_scrollBar(scrollBar)
+ {}
+
+ void scheduleUpdate();
+ void updateCache();
+ void adjustPosition();
+
+ float m_visibleRange;
+ float m_offset;
+ QHash<Id, QSet<int> > m_highlights;
+ QHash<Id, Utils::Theme::Color> m_colors;
+ QHash<Id, HighlightScrollBar::Priority> m_priorities;
+
+ bool m_cacheUpdateScheduled;
+ QMap<int, Id> m_cache;
+
+protected:
+ void paintEvent(QPaintEvent *paintEvent) override;
+
+private:
+ HighlightScrollBar *m_scrollBar;
+};
HighlightScrollBar::HighlightScrollBar(Qt::Orientation orientation, QWidget *parent)
: QScrollBar(orientation, parent)
@@ -295,3 +326,5 @@ void HighlightScrollBarOverlay::paintEvent(QPaintEvent *paintEvent)
}
}
}
+
+} // namespace Core
diff --git a/src/plugins/coreplugin/find/highlightscrollbar.h b/src/plugins/coreplugin/find/highlightscrollbar.h
index d049e9b49f..505db15758 100644
--- a/src/plugins/coreplugin/find/highlightscrollbar.h
+++ b/src/plugins/coreplugin/find/highlightscrollbar.h
@@ -82,36 +82,4 @@ private:
friend class HighlightScrollBarOverlay;
};
-class HighlightScrollBarOverlay : public QWidget
-{
- Q_OBJECT
-public:
- HighlightScrollBarOverlay(HighlightScrollBar *scrollBar)
- : QWidget(scrollBar)
- , m_visibleRange(0.0)
- , m_offset(0.0)
- , m_cacheUpdateScheduled(false)
- , m_scrollBar(scrollBar)
- {}
-
- void scheduleUpdate();
- void updateCache();
- void adjustPosition();
-
- float m_visibleRange;
- float m_offset;
- QHash<Id, QSet<int> > m_highlights;
- QHash<Id, Utils::Theme::Color> m_colors;
- QHash<Id, HighlightScrollBar::Priority> m_priorities;
-
- bool m_cacheUpdateScheduled;
- QMap<int, Id> m_cache;
-
-protected:
- void paintEvent(QPaintEvent *paintEvent) override;
-
-private:
- HighlightScrollBar *m_scrollBar;
-};
-
} // namespace Core