mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
Make scroll-wheel modifier keys consistent in editor summary pane.
Separate out the handling of left/right scroll events from normal up/down ones in the editor summary pane scroll wheel handling, and use the new constants for scroll wheel keyboard modifiers in conjunction with up/down scroll events. Modifiers for left/right scroll events should be unaffected by this.
This commit is contained in:
parent
21914c884e
commit
741f9de3f7
1 changed files with 39 additions and 39 deletions
|
|
@ -623,45 +623,45 @@ EditorSummary::on_scroll_event (GdkEventScroll* ev)
|
||||||
double x = xr.first;
|
double x = xr.first;
|
||||||
double y = yr.first;
|
double y = yr.first;
|
||||||
|
|
||||||
double amount = 8;
|
switch (ev->direction) {
|
||||||
|
case GDK_SCROLL_UP:
|
||||||
if (Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier)) {
|
if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) {
|
||||||
amount = 64;
|
x -= 64;
|
||||||
} else if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) {
|
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomHorizontalModifier)) {
|
||||||
amount = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) {
|
|
||||||
|
|
||||||
/* secondary-wheel == left-right scrolling */
|
|
||||||
|
|
||||||
if (ev->direction == GDK_SCROLL_UP) {
|
|
||||||
x -= amount;
|
|
||||||
} else if (ev->direction == GDK_SCROLL_DOWN) {
|
|
||||||
x += amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
|
|
||||||
|
|
||||||
/* primary-wheel == zoom */
|
|
||||||
|
|
||||||
if (ev->direction == GDK_SCROLL_UP) {
|
|
||||||
_editor->temporal_zoom_step (false);
|
_editor->temporal_zoom_step (false);
|
||||||
} else {
|
} else {
|
||||||
|
y -= 8;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GDK_SCROLL_DOWN:
|
||||||
|
if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) {
|
||||||
|
x += 64;
|
||||||
|
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomHorizontalModifier)) {
|
||||||
_editor->temporal_zoom_step (true);
|
_editor->temporal_zoom_step (true);
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
y += 8;
|
||||||
if (ev->direction == GDK_SCROLL_DOWN) {
|
|
||||||
y += amount;
|
|
||||||
} else if (ev->direction == GDK_SCROLL_UP) {
|
|
||||||
y -= amount;
|
|
||||||
} else if (ev->direction == GDK_SCROLL_LEFT) {
|
|
||||||
x -= amount;
|
|
||||||
} else if (ev->direction == GDK_SCROLL_RIGHT) {
|
|
||||||
x += amount;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case GDK_SCROLL_LEFT:
|
||||||
|
if (Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier)) {
|
||||||
|
x -= 64;
|
||||||
|
} else if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) {
|
||||||
|
x -= 1;
|
||||||
|
} else {
|
||||||
|
x -= 8;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GDK_SCROLL_RIGHT:
|
||||||
|
if (Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier)) {
|
||||||
|
x += 64;
|
||||||
|
} else if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) {
|
||||||
|
x += 1;
|
||||||
|
} else {
|
||||||
|
x += 8;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_editor (x, y);
|
set_editor (x, y);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue