Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED

This commit is contained in:
Aaron Record
2022-07-29 23:35:34 -06:00
parent 4808d01b2b
commit 4b817a565c
98 changed files with 262 additions and 473 deletions

View File

@ -1011,13 +1011,6 @@ void GridMapEditor::_draw_grids(const Vector3 &cell_size) {
}
}
void GridMapEditor::_update_theme() {
options->set_icon(get_theme_icon(SNAME("GridMap"), SNAME("EditorIcons")));
search_box->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
mode_thumbnail->set_icon(get_theme_icon(SNAME("FileThumbnail"), SNAME("EditorIcons")));
mode_list->set_icon(get_theme_icon(SNAME("FileList"), SNAME("EditorIcons")));
}
void GridMapEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
@ -1038,7 +1031,6 @@ void GridMapEditor::_notification(int p_what) {
_update_selection_transform();
_update_paste_indicator();
_update_theme();
} break;
case NOTIFICATION_EXIT_TREE: {
@ -1079,7 +1071,10 @@ void GridMapEditor::_notification(int p_what) {
} break;
case NOTIFICATION_THEME_CHANGED: {
_update_theme();
options->set_icon(get_theme_icon(SNAME("GridMap"), SNAME("EditorIcons")));
search_box->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
mode_thumbnail->set_icon(get_theme_icon(SNAME("FileThumbnail"), SNAME("EditorIcons")));
mode_list->set_icon(get_theme_icon(SNAME("FileList"), SNAME("EditorIcons")));
} break;
case NOTIFICATION_APPLICATION_FOCUS_OUT: {