Merge pull request #95889 from KoBeWi/tree_growing_sideways

Allow horizontal scrolling in Tree using Shift
This commit is contained in:
Rémi Verschelde 2024-10-04 22:43:17 +02:00
commit 19081a850d
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -4034,25 +4034,25 @@ void Tree::gui_input(const Ref<InputEvent> &p_event) {
} break; } break;
case MouseButton::WHEEL_UP: { case MouseButton::WHEEL_UP: {
if (_scroll(false, -mb->get_factor() / 8)) { if (_scroll(mb->is_shift_pressed(), -mb->get_factor() / 8)) {
accept_event(); accept_event();
} }
} break; } break;
case MouseButton::WHEEL_DOWN: { case MouseButton::WHEEL_DOWN: {
if (_scroll(false, mb->get_factor() / 8)) { if (_scroll(mb->is_shift_pressed(), mb->get_factor() / 8)) {
accept_event(); accept_event();
} }
} break; } break;
case MouseButton::WHEEL_LEFT: { case MouseButton::WHEEL_LEFT: {
if (_scroll(true, -mb->get_factor() / 8)) { if (_scroll(!mb->is_shift_pressed(), -mb->get_factor() / 8)) {
accept_event(); accept_event();
} }
} break; } break;
case MouseButton::WHEEL_RIGHT: { case MouseButton::WHEEL_RIGHT: {
if (_scroll(true, mb->get_factor() / 8)) { if (_scroll(!mb->is_shift_pressed(), mb->get_factor() / 8)) {
accept_event(); accept_event();
} }