From 673a995e5c718bc6aa994c50a70deb6f96e3eb59 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 28 Nov 2009 02:19:13 +0000 Subject: [PATCH] add ctrl-click behaviour to DndVBox, though not generalized to use primary/secondary keyboard mods etc. etc. git-svn-id: svn://localhost/ardour2/branches/3.0@6202 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/gtkmm2ext/gtkmm2ext/dndvbox.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libs/gtkmm2ext/gtkmm2ext/dndvbox.h b/libs/gtkmm2ext/gtkmm2ext/dndvbox.h index 7a011e9dcc..166544d73f 100644 --- a/libs/gtkmm2ext/gtkmm2ext/dndvbox.h +++ b/libs/gtkmm2ext/gtkmm2ext/dndvbox.h @@ -258,9 +258,18 @@ private: add_to_selection (child); } SelectionChanged (); /* EMIT SIGNAL */ + } else { + /* XXX THIS NEEDS GENERALIZING FOR OS X */ + if (ev->button == 1 && (ev->state & Gdk::CONTROL_MASK)) { + if (child && selected (child)) { + remove_from_selection (child); + SelectionChanged (); /* EMIT SIGNAL */ + } + } } } + return ButtonPress (ev, child); /* EMIT SIGNAL */ } @@ -292,6 +301,16 @@ private: _selection.push_back (child); } + + void remove_from_selection (T* child) + { + typename std::list::iterator x = find (_selection.begin(), _selection.end(), child); + if (x != _selection.end()) { + child->action_widget().set_state (Gtk::STATE_NORMAL); + _selection.erase (x); + } + } + T* child_from_widget (Gtk::Widget const * w) const { typename std::list::const_iterator i = _children.begin();