]> sigrok.org Git - pulseview.git/commitdiff
Trace: Renamed get_label_rect to label_rect
authorJoel Holdsworth <redacted>
Mon, 25 Aug 2014 22:46:38 +0000 (23:46 +0100)
committerJoel Holdsworth <redacted>
Wed, 19 Nov 2014 10:23:01 +0000 (10:23 +0000)
pv/view/header.cpp
pv/view/trace.cpp
pv/view/trace.h

index 802f897a607be89be0d1e6dfd684d65f61e75f57..186e44973aed7bec63064ff2eef72bcd051138a9 100644 (file)
@@ -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());
                }
        }
 
index 799a1fe3fac5d70ac421b68c35e690c69c129e85..91ce9997ed49f3a75ad5ac4077e90bc0d39ad669 100644 (file)
@@ -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;
 
index 7053f9ecbd0757b956c894da83108f9c0b5c82e2..85bdb92c5b193a2fc14054ad9a34ecd8e9030d61 100644 (file)
@@ -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();