+ // Select the signal if it has been clicked
+ const shared_ptr<Signal> mouse_over_signal =
+ get_mouse_over_signal(event->pos());
+ if (mouse_over_signal) {
+ if (mouse_over_signal->selected())
+ mouse_over_signal->select(false);
+ else {
+ mouse_over_signal->select(true);
+
+ if (~QApplication::keyboardModifiers() &
+ Qt::ControlModifier)
+ _drag_sigs.clear();
+
+ // Add the signal to the drag list
+ if (event->button() & Qt::LeftButton)
+ _drag_sigs.push_back(
+ make_pair(mouse_over_signal,
+ mouse_over_signal->get_v_offset()));
+ }
+ }
+
+ if (~QApplication::keyboardModifiers() & Qt::ControlModifier) {
+ // Unselect all other signals because the Ctrl is not
+ // pressed
+ BOOST_FOREACH(const shared_ptr<Signal> s, sigs)
+ if (s != mouse_over_signal)
+ s->select(false);
+ }
+
+ update();
+}
+
+void Header::mouseReleaseEvent(QMouseEvent *event)
+{
+ assert(event);
+ if (event->button() == Qt::LeftButton) {
+ _drag_sigs.clear();
+ _view.normalize_layout();
+ }