From: Joel Holdsworth Date: Mon, 25 Aug 2014 22:46:38 +0000 (+0100) Subject: Trace: Renamed get_label_rect to label_rect X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=commitdiff_plain;h=1053d05c140fc52caa8829f0d4827add4eeb40f4 Trace: Renamed get_label_rect to label_rect --- diff --git a/pv/view/header.cpp b/pv/view/header.cpp index 802f897..186e449 100644 --- a/pv/view/header.cpp +++ b/pv/view/header.cpp @@ -73,7 +73,7 @@ QSize Header::sizeHint() const assert(t); if (t->enabled()) { - max_width = max(max_width, (int)t->get_label_rect(0).width()); + max_width = max(max_width, (int)t->label_rect(0).width()); } } diff --git a/pv/view/trace.cpp b/pv/view/trace.cpp index 799a1fe..91ce999 100644 --- a/pv/view/trace.cpp +++ b/pv/view/trace.cpp @@ -119,23 +119,23 @@ void Trace::paint_label(QPainter &p, int right, bool hover) const QColor colour = get_colour(); - const QRectF label_rect = get_label_rect(right); + const QRectF r = label_rect(right); // Paint the label const QPointF points[] = { - label_rect.topLeft(), - label_rect.topRight(), + r.topLeft(), + r.topRight(), QPointF(right, y), - label_rect.bottomRight(), - label_rect.bottomLeft() + r.bottomRight(), + r.bottomLeft() }; const QPointF highlight_points[] = { - QPointF(label_rect.left() + 1, label_rect.top() + 1), - QPointF(label_rect.right(), label_rect.top() + 1), + QPointF(r.left() + 1, r.top() + 1), + QPointF(r.right(), r.top() + 1), QPointF(right - 1, y), - QPointF(label_rect.right(), label_rect.bottom() - 1), - QPointF(label_rect.left() + 1, label_rect.bottom() - 1) + QPointF(r.right(), r.bottom() - 1), + QPointF(r.left() + 1, r.bottom() - 1) }; if (selected()) { @@ -159,14 +159,14 @@ void Trace::paint_label(QPainter &p, int right, bool hover) // Paint the text p.setPen(get_text_colour()); p.setFont(QApplication::font()); - p.drawText(label_rect, Qt::AlignCenter | Qt::AlignVCenter, _name); + p.drawText(r, Qt::AlignCenter | Qt::AlignVCenter, _name); } bool Trace::pt_in_label_rect(int left, int right, const QPoint &point) { (void)left; - const QRectF label = get_label_rect(right); + const QRectF label = label_rect(right); return enabled() && QRectF( QPointF(label.left() - LabelHitPadding, label.top() - LabelHitPadding), @@ -200,7 +200,7 @@ int Trace::get_y() const return _v_offset - _view->v_offset(); } -QRectF Trace::get_label_rect(int right) +QRectF Trace::label_rect(int right) { using pv::view::View; diff --git a/pv/view/trace.h b/pv/view/trace.h index 7053f9e..85bdb92 100644 --- a/pv/view/trace.h +++ b/pv/view/trace.h @@ -145,7 +145,7 @@ public: * area. * @return Returns the rectangle of the signal label. */ - QRectF get_label_rect(int right); + QRectF label_rect(int right); public: virtual void hover_point_changed();