mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 19:56:31 +01:00
Improve shift-selection behaviour in processor box.
git-svn-id: svn://localhost/ardour2/branches/3.0@8073 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
601d6bb3bf
commit
e6665809fb
1 changed files with 43 additions and 5 deletions
|
|
@ -252,14 +252,52 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ev->button == 1 || ev->button == 3) {
|
if (ev->button == 1 || ev->button == 3) {
|
||||||
|
|
||||||
if (!selected (child)) {
|
if (!selected (child)) {
|
||||||
|
|
||||||
|
if ((ev->state & Gdk::SHIFT_MASK) && !_selection.empty()) {
|
||||||
|
|
||||||
|
/* Shift-click; select all between the clicked child and any existing selections */
|
||||||
|
|
||||||
|
bool selecting = false;
|
||||||
|
bool done = false;
|
||||||
|
for (typename std::list<T*>::const_iterator i = _children.begin(); i != _children.end(); ++i) {
|
||||||
|
|
||||||
|
bool const was_selected = selected (*i);
|
||||||
|
|
||||||
|
if (selecting && !was_selected) {
|
||||||
|
add_to_selection (*i);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!selecting && !done) {
|
||||||
|
if (selected (*i)) {
|
||||||
|
selecting = true;
|
||||||
|
} else if (*i == child) {
|
||||||
|
selecting = true;
|
||||||
|
add_to_selection (child);
|
||||||
|
}
|
||||||
|
} else if (selecting) {
|
||||||
|
if (was_selected || *i == child) {
|
||||||
|
selecting = false;
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
if ((ev->state & Gdk::CONTROL_MASK) == 0) {
|
if ((ev->state & Gdk::CONTROL_MASK) == 0) {
|
||||||
clear_selection ();
|
clear_selection ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (child) {
|
if (child) {
|
||||||
add_to_selection (child);
|
add_to_selection (child);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
SelectionChanged (); /* EMIT SIGNAL */
|
SelectionChanged (); /* EMIT SIGNAL */
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* XXX THIS NEEDS GENERALIZING FOR OS X */
|
/* XXX THIS NEEDS GENERALIZING FOR OS X */
|
||||||
if (ev->button == 1 && (ev->state & Gdk::CONTROL_MASK)) {
|
if (ev->button == 1 && (ev->state & Gdk::CONTROL_MASK)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue