summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor/groups_editor.cpp19
-rw-r--r--editor/groups_editor.h3
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp1
-rw-r--r--scene/gui/control.cpp2
-rw-r--r--scene/gui/file_dialog.cpp7
5 files changed, 26 insertions, 6 deletions
diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp
index 7f5f0f5457..15455b759b 100644
--- a/editor/groups_editor.cpp
+++ b/editor/groups_editor.cpp
@@ -211,6 +211,10 @@ void GroupDialog::_add_group(String p_name) {
groups->ensure_cursor_is_visible();
}
+void GroupDialog::_add_group_text_changed(const String &p_new_text) {
+ add_group_button->set_disabled(p_new_text.strip_edges().is_empty());
+}
+
void GroupDialog::_group_renamed() {
TreeItem *renamed_group = groups->get_edited();
if (!renamed_group) {
@@ -457,8 +461,9 @@ GroupDialog::GroupDialog() {
chbc->add_child(add_group_text);
add_group_text->set_h_size_flags(Control::SIZE_EXPAND_FILL);
add_group_text->connect("text_submitted", callable_mp(this, &GroupDialog::_add_group_pressed));
+ add_group_text->connect("text_changed", callable_mp(this, &GroupDialog::_add_group_text_changed));
- Button *add_group_button = memnew(Button);
+ add_group_button = memnew(Button);
add_group_button->set_text(TTR("Add"));
chbc->add_child(add_group_button);
add_group_button->connect("pressed", callable_mp(this, &GroupDialog::_add_group_pressed), varray(String()));
@@ -557,6 +562,8 @@ GroupDialog::GroupDialog() {
error = memnew(ConfirmationDialog);
add_child(error);
error->get_ok_button()->set_text(TTR("Close"));
+
+ _add_group_text_changed("");
}
////////////////////////////////////////////////////////////////////////////////
@@ -571,6 +578,7 @@ void GroupsEditor::_add_group(const String &p_group) {
return;
}
+ group_name->clear();
if (node->is_in_group(name)) {
return;
}
@@ -587,8 +595,6 @@ void GroupsEditor::_add_group(const String &p_group) {
undo_redo->add_undo_method(SceneTreeDock::get_singleton()->get_tree_editor(), "update_tree");
undo_redo->commit_action();
-
- group_name->clear();
}
void GroupsEditor::_modify_group(Object *p_item, int p_column, int p_id) {
@@ -622,6 +628,10 @@ void GroupsEditor::_modify_group(Object *p_item, int p_column, int p_id) {
}
}
+void GroupsEditor::_group_name_changed(const String &p_new_text) {
+ add->set_disabled(p_new_text.strip_edges().is_empty());
+}
+
struct _GroupInfoComparator {
bool operator()(const Node::GroupInfo &p_a, const Node::GroupInfo &p_b) const {
return p_a.name.operator String() < p_b.name.operator String();
@@ -711,6 +721,7 @@ GroupsEditor::GroupsEditor() {
group_name->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hbc->add_child(group_name);
group_name->connect("text_submitted", callable_mp(this, &GroupsEditor::_add_group));
+ group_name->connect("text_changed", callable_mp(this, &GroupsEditor::_group_name_changed));
add = memnew(Button);
add->set_text(TTR("Add"));
@@ -724,6 +735,8 @@ GroupsEditor::GroupsEditor() {
tree->connect("button_pressed", callable_mp(this, &GroupsEditor::_modify_group));
tree->add_theme_constant_override("draw_guides", 1);
add_theme_constant_override("separation", 3 * EDSCALE);
+
+ _group_name_changed("");
}
GroupsEditor::~GroupsEditor() {
diff --git a/editor/groups_editor.h b/editor/groups_editor.h
index 677ef14a1f..aa70ac5bc4 100644
--- a/editor/groups_editor.h
+++ b/editor/groups_editor.h
@@ -49,6 +49,7 @@ class GroupDialog : public AcceptDialog {
TreeItem *groups_root;
LineEdit *add_group_text;
+ Button *add_group_button;
Tree *groups;
@@ -77,6 +78,7 @@ class GroupDialog : public AcceptDialog {
void _add_pressed();
void _removed_pressed();
void _add_group_pressed(const String &p_name);
+ void _add_group_text_changed(const String &p_new_text);
void _group_renamed();
void _rename_group_item(const String &p_old_name, const String &p_new_name);
@@ -122,6 +124,7 @@ class GroupsEditor : public VBoxContainer {
void update_tree();
void _add_group(const String &p_group = "");
void _modify_group(Object *p_item, int p_column, int p_id);
+ void _group_name_changed(const String &p_new_text);
void _show_group_dialog();
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index 07f0a83c6e..7199f69f0b 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -612,6 +612,7 @@ void EditorAssetLibrary::_notification(int p_what) {
} break;
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
_update_repository_options();
+ setup_http_request(request);
} break;
}
}
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index f167062f7d..562ea8a8f7 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -240,7 +240,7 @@ bool Control::_set(const StringName &p_name, const Variant &p_value) {
return false;
}
- if (p_value.get_type() == Variant::NIL) {
+ if (p_value.get_type() == Variant::NIL || (p_value.get_type() == Variant::OBJECT && (Object *)p_value == nullptr)) {
if (name.begins_with("theme_override_icons/") || name.begins_with("custom_icons/")) {
String dname = name.get_slicec('/', 1);
if (data.icon_override.has(dname)) {
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index 44ef641cb8..e5bd6f4882 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -110,6 +110,9 @@ void FileDialog::_notification(int p_what) {
show_hidden->set_icon(vbox->get_theme_icon(SNAME("toggle_hidden"), SNAME("FileDialog")));
_theme_changed();
}
+ if (p_what == NOTIFICATION_TRANSLATION_CHANGED) {
+ update_filters();
+ }
}
void FileDialog::unhandled_input(const Ref<InputEvent> &p_event) {
@@ -638,7 +641,7 @@ void FileDialog::update_filters() {
all_filters += ", ...";
}
- filter->add_item(String(TTRC("All Recognized")) + " (" + all_filters + ")");
+ filter->add_item(RTR("All Recognized") + " (" + all_filters + ")");
}
for (int i = 0; i < filters.size(); i++) {
String flt = filters[i].get_slice(";", 0).strip_edges();
@@ -650,7 +653,7 @@ void FileDialog::update_filters() {
}
}
- filter->add_item(TTRC("All Files (*)"));
+ filter->add_item(RTR("All Files") + " (*)");
}
void FileDialog::clear_filters() {