You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED
This commit is contained in:
@@ -5856,26 +5856,21 @@ Node *CanvasItemEditorViewport::_make_texture_node_type(String texture_node_type
|
||||
return node;
|
||||
}
|
||||
|
||||
void CanvasItemEditorViewport::_update_theme() {
|
||||
List<BaseButton *> btn_list;
|
||||
button_group->get_buttons(&btn_list);
|
||||
|
||||
for (int i = 0; i < btn_list.size(); i++) {
|
||||
CheckBox *check = Object::cast_to<CheckBox>(btn_list[i]);
|
||||
check->set_icon(get_theme_icon(check->get_text(), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
label->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
}
|
||||
|
||||
void CanvasItemEditorViewport::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_update_theme();
|
||||
List<BaseButton *> btn_list;
|
||||
button_group->get_buttons(&btn_list);
|
||||
|
||||
for (int i = 0; i < btn_list.size(); i++) {
|
||||
CheckBox *check = Object::cast_to<CheckBox>(btn_list[i]);
|
||||
check->set_icon(get_theme_icon(check->get_text(), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
label->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
_update_theme();
|
||||
connect("mouse_exited", callable_mp(this, &CanvasItemEditorViewport::_on_mouse_exit));
|
||||
} break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user