Add selection to Ruler items
[pulseview.git] / pv / view / ruler.cpp
index 049cc4af196a8c2203d0ef3ee285e9fa33f17a84..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(
@@ -202,6 +204,11 @@ void Ruler::mousePressEvent(QMouseEvent *e)
                                rect()).contains(e->pos()))
                                _grabbed_marker = &cursors.second();
                }
+
+               if(_grabbed_marker)
+                       _grabbed_marker->select();
+
+               selection_changed();
        }
 }