13
0

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
This commit is contained in:
Paul Davis 2009-11-28 02:19:13 +00:00
parent 31b8f64319
commit 673a995e5c

View File

@ -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<T*>::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<T*>::const_iterator i = _children.begin();