summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-04-07 15:25:44 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-04-07 15:28:10 +0200
commitd2dec8d6144b7e516cc76ed48800f79d08bdb861 (patch)
treea8e6e65f23a1049f5b14576f500019a443ae0803
parent1075943cc54266eefd85b1829c282e09d19ef491 (diff)
Allow using the mouse wheel to navigate scene tabs
This works in a way similar to tabs in KDE or some patched Chromium builds.
-rw-r--r--editor/editor_node.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 9ca46cfcc0..2dec57b73b 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -4891,6 +4891,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);
+ }
}
}