1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Fix theme application in various editor dialogs

99% of the time we shouldn't rely on the signal, we
should use the notification instead. I left some comments
in places where I couldn't quickly improve the code.
This commit is contained in:
Yuri Sizov
2023-12-04 13:18:48 +01:00
parent d76c1d0e51
commit 01888ae7ab
12 changed files with 54 additions and 73 deletions

View File

@@ -250,23 +250,22 @@ void EditorQuickOpen::_notification(int p_what) {
}
} break;
case NOTIFICATION_THEME_CHANGED: {
search_box->set_right_icon(get_editor_theme_icon(SNAME("Search")));
} break;
case NOTIFICATION_EXIT_TREE: {
disconnect("confirmed", callable_mp(this, &EditorQuickOpen::_confirmed));
} break;
}
}
void EditorQuickOpen::_theme_changed() {
search_box->set_right_icon(search_options->get_editor_theme_icon(SNAME("Search")));
}
void EditorQuickOpen::_bind_methods() {
ADD_SIGNAL(MethodInfo("quick_open"));
}
EditorQuickOpen::EditorQuickOpen() {
VBoxContainer *vbc = memnew(VBoxContainer);
vbc->connect("theme_changed", callable_mp(this, &EditorQuickOpen::_theme_changed));
add_child(vbc);
search_box = memnew(LineEdit);