Browse Source

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.

FIF15 4 years ago
parent
commit
f07fb4e595
2 changed files with 2 additions and 0 deletions
  1. 1 0
      scene/gui/link_button.cpp
  2. 1 0
      scene/gui/menu_button.cpp

+ 1 - 0
scene/gui/link_button.cpp

@@ -140,5 +140,6 @@ void LinkButton::_bind_methods() {
 
 
 LinkButton::LinkButton() {
 LinkButton::LinkButton() {
 	underline_mode = UNDERLINE_MODE_ALWAYS;
 	underline_mode = UNDERLINE_MODE_ALWAYS;
+	set_enabled_focus_mode(FOCUS_NONE);
 	set_default_cursor_shape(CURSOR_POINTING_HAND);
 	set_default_cursor_shape(CURSOR_POINTING_HAND);
 }
 }

+ 1 - 0
scene/gui/menu_button.cpp

@@ -129,6 +129,7 @@ MenuButton::MenuButton() {
 	set_flat(true);
 	set_flat(true);
 	set_toggle_mode(true);
 	set_toggle_mode(true);
 	set_disable_shortcuts(false);
 	set_disable_shortcuts(false);
+	set_enabled_focus_mode(FOCUS_NONE);
 	set_process_unhandled_key_input(true);
 	set_process_unhandled_key_input(true);
 	set_action_mode(ACTION_MODE_BUTTON_PRESS);
 	set_action_mode(ACTION_MODE_BUTTON_PRESS);