]> sigrok.org Git - pulseview.git/commitdiff
Trace: Removed pt_in_label_rect
authorJoel Holdsworth <redacted>
Thu, 28 Aug 2014 22:52:50 +0000 (23:52 +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 186e44973aed7bec63064ff2eef72bcd051138a9..17dd382dd4846bf8d44b85a8c5e881596bd47f88 100644 (file)
@@ -88,7 +88,7 @@ shared_ptr<Trace> Header::get_mouse_over_trace(const QPoint &pt)
        for (const shared_ptr<Trace> t : traces)
        {
                assert(t);
-               if (t->pt_in_label_rect(0, w, pt))
+               if (t->enabled() && t->label_rect(w).contains(pt))
                        return t;
        }
 
@@ -122,8 +122,8 @@ void Header::paintEvent(QPaintEvent*)
        {
                assert(t);
 
-               const bool highlight = !dragging && t->pt_in_label_rect(
-                       0, w, _mouse_point);
+               const bool highlight = !dragging &&
+                       t->label_rect(w).contains(_mouse_point);
                t->paint_label(painter, w, highlight);
        }
 
index ca5f7150353ac67f03f94aae996d37e49d4a35eb..e825337c6d4156fb4e430cfface2a5aab2d0cb08 100644 (file)
@@ -164,12 +164,6 @@ void Trace::paint_label(QPainter &p, int right, bool hover)
                Qt::AlignCenter | Qt::AlignVCenter, _name);
 }
 
-bool Trace::pt_in_label_rect(int left, int right, const QPoint &point)
-{
-       (void)left;
-       return enabled() && label_rect(right).contains(point);
-}
-
 QMenu* Trace::create_context_menu(QWidget *parent)
 {
        QMenu *const menu = SelectableItem::create_context_menu(parent);
index 85bdb92c5b193a2fc14054ad9a34ecd8e9030d61..0202a4e5770ef5e39c33060d38e64e5853bd9596 100644 (file)
@@ -120,16 +120,6 @@ public:
         */
        virtual void paint_label(QPainter &p, int right, bool hover);
 
-       /**
-        * Determines if a point is in the header label rect.
-        * @param left the x-coordinate of the left edge of the header
-        *      area.
-        * @param right the x-coordinate of the right edge of the header
-        *      area.
-        * @param point the point to test.
-        */
-       bool pt_in_label_rect(int left, int right, const QPoint &point);
-
        virtual QMenu* create_context_menu(QWidget *parent);
 
        pv::widgets::Popup* create_popup(QWidget *parent);