From f07fb4e595fc1c0df41ff4d83f73a517f86bb31f Mon Sep 17 00:00:00 2001 From: FIF15 Date: Mon, 30 Nov 2020 10:47:26 +0800 Subject: [PATCH] fix #43695 by revert part of #41577 Restore the default focus mode for MenuButton and LinkButton, since it is different from the default of BaseButton. --- scene/gui/link_button.cpp | 1 + scene/gui/menu_button.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/scene/gui/link_button.cpp b/scene/gui/link_button.cpp index 75ccc77df28..4b8054bac64 100644 --- a/scene/gui/link_button.cpp +++ b/scene/gui/link_button.cpp @@ -140,5 +140,6 @@ void LinkButton::_bind_methods() { LinkButton::LinkButton() { underline_mode = UNDERLINE_MODE_ALWAYS; + set_enabled_focus_mode(FOCUS_NONE); set_default_cursor_shape(CURSOR_POINTING_HAND); } diff --git a/scene/gui/menu_button.cpp b/scene/gui/menu_button.cpp index a7acdf1ae33..6e348054e29 100644 --- a/scene/gui/menu_button.cpp +++ b/scene/gui/menu_button.cpp @@ -129,6 +129,7 @@ MenuButton::MenuButton() { set_flat(true); set_toggle_mode(true); set_disable_shortcuts(false); + set_enabled_focus_mode(FOCUS_NONE); set_process_unhandled_key_input(true); set_action_mode(ACTION_MODE_BUTTON_PRESS);