]> sigrok.org Git - pulseview.git/commitdiff
Moved LabelPadding into View
authorJoel Holdsworth <redacted>
Thu, 1 Nov 2012 23:06:24 +0000 (23:06 +0000)
committerJoel Holdsworth <redacted>
Thu, 1 Nov 2012 23:19:58 +0000 (23:19 +0000)
pv/signal.cpp
pv/signal.h
pv/view/view.cpp
pv/view/view.h

index aeb693b77d043a670556fd1889e40395211d931e..c23a3954455b155d74b042907c361fa245f18c3a 100644 (file)
@@ -24,7 +24,6 @@
 
 namespace pv {
 
-const QSizeF Signal::LabelPadding(4, 0);
 const int Signal::LabelHitPadding = 2;
 
 Signal::Signal(QString name) :
@@ -104,10 +103,12 @@ void Signal::compute_text_size(QPainter &p)
 
 QRectF Signal::get_label_rect(const QRect &rect)
 {
+       using pv::view::View;
+
        const float nominal_offset = get_nominal_offset(rect);
        const QSizeF label_size(
-               _text_size.width() + LabelPadding.width() * 2,
-               _text_size.height() + LabelPadding.height() * 2);
+               _text_size.width() + View::LabelPadding.width() * 2,
+               _text_size.height() + View::LabelPadding.height() * 2);
        const float label_arrow_length = label_size.height() / 2;
        return QRectF(
                rect.right() - label_arrow_length - label_size.width(),
index 789b43601deff51dbe36c477a24b0c79f3df7b15..951ae3172bc576cd12e76dd9ccf349d937584cd4 100644 (file)
@@ -36,7 +36,6 @@ class SignalData;
 class Signal
 {
 private:
-       static const QSizeF LabelPadding;
        static const int LabelHitPadding;
 
 protected:
index d2f708e5e103d5642d1af1de46f9a30a3ce68073..81b3fcd225c60f8c1d24e994557a94492e8acbdd 100644 (file)
@@ -55,6 +55,8 @@ const int View::SignalHeight = 50;
 
 const QColor View::CursorAreaColour(220, 231, 243);
 
+const QSizeF View::LabelPadding(4, 0);
+
 View::View(SigSession &session, QWidget *parent) :
        QAbstractScrollArea(parent),
        _session(session),
index f196cfe07d9c3bea5d97e7bf972d6aef9008baa0..3397ba2ce28800c3b996c7a1f19e455ef800ce6a 100644 (file)
@@ -26,6 +26,7 @@
 #include <utility>
 
 #include <QAbstractScrollArea>
+#include <QSizeF>
 
 #include "cursor.h"
 
@@ -56,6 +57,8 @@ public:
 
        static const QColor CursorAreaColour;
 
+       static const QSizeF LabelPadding;
+
 public:
        explicit View(SigSession &session, QWidget *parent = 0);