Merge pull request #71885 from KoBeWi/NullItemEditor
Fix handling of nulls in some editors
This commit is contained in:
commit
db23d7a47c
|
@ -3990,6 +3990,10 @@ void CanvasItemEditor::_selection_changed() {
|
|||
}
|
||||
|
||||
void CanvasItemEditor::edit(CanvasItem *p_canvas_item) {
|
||||
if (!p_canvas_item) {
|
||||
return;
|
||||
}
|
||||
|
||||
Array selection = editor_selection->get_selected_nodes();
|
||||
if (selection.size() != 1 || Object::cast_to<Node>(selection[0]) != p_canvas_item) {
|
||||
_reset_drag();
|
||||
|
|
|
@ -3335,8 +3335,10 @@ void ThemeTypeEditor::set_edited_theme(const Ref<Theme> &p_theme) {
|
|||
}
|
||||
|
||||
edited_theme = p_theme;
|
||||
if (edited_theme.is_valid()) {
|
||||
edited_theme->connect("changed", callable_mp(this, &ThemeTypeEditor::_update_type_list_debounced));
|
||||
_update_type_list();
|
||||
}
|
||||
|
||||
add_type_dialog->set_edited_theme(edited_theme);
|
||||
}
|
||||
|
@ -3496,7 +3498,9 @@ void ThemeEditor::edit(const Ref<Theme> &p_theme) {
|
|||
preview_tab->set_preview_theme(p_theme);
|
||||
}
|
||||
|
||||
if (theme.is_valid()) {
|
||||
theme_name->set_text(TTR("Theme:") + " " + theme->get_path().get_file());
|
||||
}
|
||||
}
|
||||
|
||||
Ref<Theme> ThemeEditor::get_edited_theme() {
|
||||
|
|
Loading…
Reference in New Issue