]> sigrok.org Git - pulseview.git/blobdiff - pv/view/cursor.h
Initial code to render text inside cursor markers
[pulseview.git] / pv / view / cursor.h
index 3ee0200518108a30e52ef7b20b7ced7108d92386..1469f2cc1edf0db599f8b6f147cabbb4fd235abd 100644 (file)
 
 #include "timemarker.h"
 
+#include <QSizeF>
+
+class QPainter;
+
 namespace pv {
 namespace view {
 
@@ -34,10 +38,13 @@ private:
        static const QColor LineColour;
        static const QColor FillColour;
        static const QColor HighlightColour;
+       static const QColor TextColour;
 
        static const int Size;
        static const int Offset;
 
+       static const int ArrowSize;
+
 public:
        /**
         * Constructor.
@@ -60,6 +67,14 @@ public:
         * @param rect The rectangle of the ruler client area.
         */
        void paint_label(QPainter &p, const QRect &rect);
+
+private:
+       void compute_text_size(QPainter &p);
+
+       void format_text(char *text);
+
+private:
+       QSizeF _text_size;
 };
 
 } // namespace view