diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-08-07 08:21:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-07 08:21:43 +0200 |
commit | 9cb4fbe9d583e3f797e6b653fc9124515a7dd8f7 (patch) | |
tree | 19d3056f47fb04ad938538cd45675b9bceb3a1b3 /editor | |
parent | 4cb406e02a7bc5761fd081b944cc1a5b09e2a365 (diff) | |
parent | d2dec8d6144b7e516cc76ed48800f79d08bdb861 (diff) |
Merge pull request #47700 from Calinou/editor-mouse-wheel-change-scene-tabs
Allow using the mouse wheel to navigate scene tabs
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_node.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 78500ab16c..2126a7b8be 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4944,6 +4944,16 @@ void EditorNode::_scene_tab_input(const Ref<InputEvent> &p_input) { scene_tabs_context_menu->set_position(mb->get_global_position()); scene_tabs_context_menu->popup(); } + if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_UP && mb->is_pressed()) { + int previous_tab = editor_data.get_edited_scene() - 1; + previous_tab = previous_tab >= 0 ? previous_tab : editor_data.get_edited_scene_count() - 1; + _scene_tab_changed(previous_tab); + } + if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_DOWN && mb->is_pressed()) { + int next_tab = editor_data.get_edited_scene() + 1; + next_tab %= editor_data.get_edited_scene_count(); + _scene_tab_changed(next_tab); + } } } |