Merge pull request #114579 from KoBeWi/dobleclickonlynotabs
Don't open new scene when double-clicking tabs
This commit is contained in:
@@ -128,7 +128,7 @@ void EditorSceneTabs::_scene_tab_input(const Ref<InputEvent> &p_input) {
|
||||
Ref<InputEventMouseButton> mb = p_input;
|
||||
|
||||
if (mb.is_valid()) {
|
||||
if (mb->get_button_index() == MouseButton::LEFT && mb->is_double_click()) {
|
||||
if (scene_tabs->get_hovered_tab() < 0 && mb->get_button_index() == MouseButton::LEFT && mb->is_double_click()) {
|
||||
int tab_buttons = 0;
|
||||
if (scene_tabs->get_offset_buttons_visible()) {
|
||||
tab_buttons = get_theme_icon(SNAME("increment"), SNAME("TabBar"))->get_width() + get_theme_icon(SNAME("decrement"), SNAME("TabBar"))->get_width();
|
||||
@@ -137,8 +137,7 @@ void EditorSceneTabs::_scene_tab_input(const Ref<InputEvent> &p_input) {
|
||||
if ((is_layout_rtl() && mb->get_position().x > tab_buttons) || (!is_layout_rtl() && mb->get_position().x < scene_tabs->get_size().width - tab_buttons)) {
|
||||
EditorNode::get_singleton()->trigger_menu_option(EditorNode::SCENE_NEW_SCENE, true);
|
||||
}
|
||||
}
|
||||
if (mb->get_button_index() == MouseButton::RIGHT && mb->is_pressed()) {
|
||||
} else if (mb->get_button_index() == MouseButton::RIGHT && mb->is_pressed()) {
|
||||
// Context menu.
|
||||
_update_context_menu();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user