diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2024-03-23 17:49:40 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2024-05-19 19:29:48 +0800 |
commit | 55459dd74e530b50dd520f08b32def5b7725101a (patch) | |
tree | b2cdd50e63b3367d05b787d1b040caef41312560 /editor/action_map_editor.cpp | |
parent | daa81bbb7d1c6d75d1711595604178ee62a5801d (diff) | |
download | redot-engine-55459dd74e530b50dd520f08b32def5b7725101a.tar.gz |
Disable Clear All button when not filtering in Editor Settings
Diffstat (limited to 'editor/action_map_editor.cpp')
-rw-r--r-- | editor/action_map_editor.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index 6ff0520ab6..3023c5907a 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -505,6 +505,9 @@ void ActionMapEditor::update_action_list(const Vector<ActionInfo> &p_action_info event_item->set_button_color(2, 1, Color(1, 1, 1, 0.75)); } } + + // Update UI. + clear_all_search->set_disabled(action_list_search->get_text().is_empty() && action_list_search_by_event->get_event().is_null()); } void ActionMapEditor::show_message(const String &p_message) { @@ -550,8 +553,9 @@ ActionMapEditor::ActionMapEditor() { action_list_search_by_event->connect(SceneStringName(focus_exited), callable_mp(this, &ActionMapEditor::_on_filter_unfocused)); top_hbox->add_child(action_list_search_by_event); - Button *clear_all_search = memnew(Button); + clear_all_search = memnew(Button); clear_all_search->set_text(TTR("Clear All")); + clear_all_search->set_tooltip_text(TTR("Clear all search filters.")); clear_all_search->connect(SceneStringName(pressed), callable_mp(action_list_search_by_event, &EventListenerLineEdit::clear_event)); clear_all_search->connect(SceneStringName(pressed), callable_mp(action_list_search, &LineEdit::clear)); top_hbox->add_child(clear_all_search); |