From: Joel Holdsworth Date: Thu, 28 Aug 2014 22:52:50 +0000 (+0100) Subject: Trace: Removed pt_in_label_rect X-Git-Tag: pulseview-0.3.0~488 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=25201e884a0d95a71b1bc2598265a08a199203b5;p=pulseview.git Trace: Removed pt_in_label_rect --- diff --git a/pv/view/header.cpp b/pv/view/header.cpp index 186e4497..17dd382d 100644 --- a/pv/view/header.cpp +++ b/pv/view/header.cpp @@ -88,7 +88,7 @@ shared_ptr Header::get_mouse_over_trace(const QPoint &pt) for (const shared_ptr 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); } diff --git a/pv/view/trace.cpp b/pv/view/trace.cpp index ca5f7150..e825337c 100644 --- a/pv/view/trace.cpp +++ b/pv/view/trace.cpp @@ -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); diff --git a/pv/view/trace.h b/pv/view/trace.h index 85bdb92c..0202a4e5 100644 --- a/pv/view/trace.h +++ b/pv/view/trace.h @@ -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);