]> sigrok.org Git - pulseview.git/blobdiff - pv/view/view.h
Bring the cursors into view when they are shown
[pulseview.git] / pv / view / view.h
index 980ccf1f61e8488d38dea381953ab15bb8d6d112..0f5e254da4f12681dfff1f10621c91c0af1b9422 100644 (file)
 
 #include <stdint.h>
 
-#include <utility>
-
 #include <QAbstractScrollArea>
 #include <QSizeF>
 
-#include "cursor.h"
+#include "cursorpair.h"
 
 namespace pv {
 
@@ -98,10 +96,15 @@ public:
         */
        void show_cursors(bool show = true);
 
+       /**
+        * Moves the cursors to a convenient position in the view.
+        */
+       void centre_cursors();
+
        /**
         * Returns a reference to the pair of cursors.
         */
-       std::pair<Cursor, Cursor>& cursors();
+       CursorPair& cursors();
 
        const QPoint& hover_point() const;
 
@@ -157,7 +160,7 @@ private:
        bool _updating_scroll;
 
        bool _show_cursors;
-       std::pair<Cursor, Cursor> _cursors;
+       CursorPair _cursors;
 
        QPoint _hover_point;
 };