]> sigrok.org Git - pulseview.git/commitdiff
Add selection to Ruler items
authorJoel Holdsworth <redacted>
Mon, 13 May 2013 22:11:19 +0000 (23:11 +0100)
committerJoel Holdsworth <redacted>
Sun, 19 May 2013 08:46:00 +0000 (09:46 +0100)
pv/view/ruler.cpp
pv/view/view.cpp

index 09c85c6451c37a3ea888783e949f2dd2937fe0d3..fa5c488e4f576107e51f490b75ec4162b906aeb9 100644 (file)
@@ -193,6 +193,8 @@ void Ruler::mousePressEvent(QMouseEvent *e)
        if (e->buttons() & Qt::LeftButton) {
                _grabbed_marker = NULL;
 
        if (e->buttons() & Qt::LeftButton) {
                _grabbed_marker = NULL;
 
+               clear_selection();
+
                if (_view.cursors_shown()) {
                        CursorPair &cursors = _view.cursors();
                        if (cursors.first().get_label_rect(
                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();
                }
 
                                _grabbed_marker = &cursors.second();
                }
 
+               if(_grabbed_marker)
+                       _grabbed_marker->select();
+
                selection_changed();
        }
 }
                selection_changed();
        }
 }
index 6ea8cc0af30eea06c6fbc9e7523bf1e8ca257c1c..b240af06c1514f0f763e7ce097b7bbcc50cf95b4 100644 (file)
@@ -93,6 +93,11 @@ View::View(SigSession &session, QWidget *parent) :
        connect(_header, SIGNAL(signals_moved()),
                this, SLOT(on_signals_moved()));
 
        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);
 
        setViewportMargins(LabelMarginWidth, RulerHeight, 0, 0);
        setViewport(_viewport);