You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Merge pull request #47700 from Calinou/editor-mouse-wheel-change-scene-tabs
Allow using the mouse wheel to navigate scene tabs
This commit is contained in:
@@ -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->set_position(mb->get_global_position());
|
||||||
scene_tabs_context_menu->popup();
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user