From: Joel Holdsworth Date: Thu, 1 Nov 2012 23:06:24 +0000 (+0000) Subject: Moved LabelPadding into View X-Git-Tag: pulseview-0.1.0~227 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=2e04f9bdf11fa7191965fcad052e4cbc474494f8;p=pulseview.git Moved LabelPadding into View --- diff --git a/pv/signal.cpp b/pv/signal.cpp index aeb693b7..c23a3954 100644 --- a/pv/signal.cpp +++ b/pv/signal.cpp @@ -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(), diff --git a/pv/signal.h b/pv/signal.h index 789b4360..951ae317 100644 --- a/pv/signal.h +++ b/pv/signal.h @@ -36,7 +36,6 @@ class SignalData; class Signal { private: - static const QSizeF LabelPadding; static const int LabelHitPadding; protected: diff --git a/pv/view/view.cpp b/pv/view/view.cpp index d2f708e5..81b3fcd2 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -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), diff --git a/pv/view/view.h b/pv/view/view.h index f196cfe0..3397ba2c 100644 --- a/pv/view/view.h +++ b/pv/view/view.h @@ -26,6 +26,7 @@ #include #include +#include #include "cursor.h" @@ -56,6 +57,8 @@ public: static const QColor CursorAreaColour; + static const QSizeF LabelPadding; + public: explicit View(SigSession &session, QWidget *parent = 0);