Skip to content

Commit

Permalink
Merge pull request #41577 from FIF15/deprecate-redundant-property-ena…
Browse files Browse the repository at this point in the history
…bled-focus-mode

Deprecate Redundant property enabled_focus_mode
  • Loading branch information
akien-mga authored Oct 19, 2020
2 parents 4a92d21 + 8311a37 commit 3495cb9
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/classes/BaseButton.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
If [code]true[/code], the button is in disabled state and can't be clicked or toggled.
</member>
<member name="enabled_focus_mode" type="int" setter="set_enabled_focus_mode" getter="get_enabled_focus_mode" enum="Control.FocusMode" default="2">
Focus access mode to use when switching between enabled/disabled (see [member Control.focus_mode] and [member disabled]).
[i]Deprecated.[/i] This property has been deprecated due to redundancy and no longer has any effect when set. Please use [member Control.focus_mode] instead.
</member>
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="2" />
<member name="group" type="ButtonGroup" setter="set_button_group" getter="get_button_group">
Expand Down
1 change: 1 addition & 0 deletions scene/gui/base_button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ void BaseButton::set_enabled_focus_mode(FocusMode p_mode) {
if (!status.disabled) {
set_focus_mode(p_mode);
}
WARN_DEPRECATED_MSG("BaseButton's Enabled Focus Mode property has been deprecated due to redundancy and will be removed in Godot 4.0. Please use Control.set_focus_mode instead.");
}

Control::FocusMode BaseButton::get_enabled_focus_mode() const {
Expand Down
1 change: 0 additions & 1 deletion scene/gui/link_button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,5 @@ void LinkButton::_bind_methods() {

LinkButton::LinkButton() {
underline_mode = UNDERLINE_MODE_ALWAYS;
set_enabled_focus_mode(FOCUS_NONE);
set_default_cursor_shape(CURSOR_POINTING_HAND);
}
1 change: 0 additions & 1 deletion scene/gui/menu_button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ 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);

Expand Down

0 comments on commit 3495cb9

Please sign in to comment.