From: Joel Holdsworth Date: Mon, 13 May 2013 22:11:19 +0000 (+0100) Subject: Add selection to Ruler items X-Git-Tag: pulseview-0.2.0~350 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=17348f85b8dd4c96aace88f790ba4fda2bccca5a Add selection to Ruler items --- diff --git a/pv/view/ruler.cpp b/pv/view/ruler.cpp index 09c85c64..fa5c488e 100644 --- a/pv/view/ruler.cpp +++ b/pv/view/ruler.cpp @@ -193,6 +193,8 @@ void Ruler::mousePressEvent(QMouseEvent *e) if (e->buttons() & Qt::LeftButton) { _grabbed_marker = NULL; + clear_selection(); + if (_view.cursors_shown()) { CursorPair &cursors = _view.cursors(); if (cursors.first().get_label_rect( @@ -203,6 +205,9 @@ void Ruler::mousePressEvent(QMouseEvent *e) _grabbed_marker = &cursors.second(); } + if(_grabbed_marker) + _grabbed_marker->select(); + selection_changed(); } } diff --git a/pv/view/view.cpp b/pv/view/view.cpp index 6ea8cc0a..b240af06 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -93,6 +93,11 @@ View::View(SigSession &session, QWidget *parent) : connect(_header, SIGNAL(signals_moved()), this, SLOT(on_signals_moved())); + connect(_header, SIGNAL(selection_changed()), + _ruler, SLOT(clear_selection())); + connect(_ruler, SIGNAL(selection_changed()), + _header, SLOT(clear_selection())); + setViewportMargins(LabelMarginWidth, RulerHeight, 0, 0); setViewport(_viewport);