1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-04 17:04:49 +00:00

Fix UI focus being shown when it shouldn't

This commit is contained in:
Michael Alexsander
2025-10-07 12:05:34 -03:00
parent 06faefc9f4
commit e32b9274a3
7 changed files with 39 additions and 16 deletions

View File

@@ -435,6 +435,13 @@ void ActionMapEditor::update_action_list(const Vector<ActionInfo> &p_action_info
actions_cache = p_action_infos;
}
Pair<String, int> selected_item;
TreeItem *ti = action_tree->get_selected();
if (ti) {
selected_item.first = ti->get_text(0);
selected_item.second = action_tree->get_selected_column();
}
HashSet<String> collapsed_actions;
TreeItem *root = action_tree->get_root();
if (root) {
@@ -496,6 +503,10 @@ void ActionMapEditor::update_action_list(const Vector<ActionInfo> &p_action_info
action_item->set_custom_bg_color(0, get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor)));
action_item->set_custom_bg_color(1, get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor)));
if (selected_item.first == action_info.name) {
action_item->select(selected_item.second);
}
for (int evnt_idx = 0; evnt_idx < events.size(); evnt_idx++) {
Ref<InputEvent> event = events[evnt_idx];
if (event.is_null()) {
@@ -544,6 +555,10 @@ void ActionMapEditor::update_action_list(const Vector<ActionInfo> &p_action_info
event_item->add_button(2, get_editor_theme_icon(SNAME("Remove")), BUTTON_REMOVE_EVENT, false, TTRC("Remove Event"), TTRC("Remove Event"));
event_item->set_button_color(2, 0, Color(1, 1, 1, 0.75));
event_item->set_button_color(2, 1, Color(1, 1, 1, 0.75));
if (selected_item.first == event_item->get_text(0)) {
event_item->select(selected_item.second);
}
}
}
}