Add selection to Ruler items
[pulseview.git] / pv / view / ruler.cpp
index 09c85c6451c37a3ea888783e949f2dd2937fe0d3..fa5c488e4f576107e51f490b75ec4162b906aeb9 100644 (file)
@@ -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();
        }
 }