summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-09-22 08:27:18 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-09-22 08:27:18 +0200
commit6d6f7f3de811b5740f58042b2bdb35bbc66a78cb (patch)
tree61fe1d6d27aca7f37ba51a5ccd8822eb7820ce3a
parent08bd94e4ba4a9070ff78531e202833ca7e0f1e93 (diff)
parent4351af30c878f74ddbc8c5cf04c23fb4395999c4 (diff)
Merge pull request #66240 from bruvzg/ftr_hide
[Font Inspector Plugin] Hide "Add Feature" button if supported feature list is empty.
-rw-r--r--editor/import/dynamic_font_import_settings.cpp1
-rw-r--r--editor/plugins/font_config_plugin.cpp10
2 files changed, 11 insertions, 0 deletions
diff --git a/editor/import/dynamic_font_import_settings.cpp b/editor/import/dynamic_font_import_settings.cpp
index c1761339b2..1e0f45419f 100644
--- a/editor/import/dynamic_font_import_settings.cpp
+++ b/editor/import/dynamic_font_import_settings.cpp
@@ -1009,6 +1009,7 @@ void DynamicFontImportSettings::open_settings(const String &p_path) {
vars_list_root = vars_list->create_item();
+ import_settings_data->settings.clear();
import_settings_data->defaults.clear();
for (List<ResourceImporter::ImportOption>::Element *E = options_general.front(); E; E = E->next()) {
import_settings_data->defaults[E->get().option.name] = E->get().default_value;
diff --git a/editor/plugins/font_config_plugin.cpp b/editor/plugins/font_config_plugin.cpp
index 2df951518e..ba11479714 100644
--- a/editor/plugins/font_config_plugin.cpp
+++ b/editor/plugins/font_config_plugin.cpp
@@ -622,6 +622,16 @@ void EditorPropertyOTFeatures::update_property() {
supported = fd->get_supported_feature_list();
}
+ if (supported.is_empty()) {
+ edit->set_text(vformat(TTR("No supported features")));
+ if (container) {
+ set_bottom_editor(nullptr);
+ memdelete(container);
+ button_add = nullptr;
+ container = nullptr;
+ }
+ return;
+ }
edit->set_text(vformat(TTR("Features (%d of %d set)"), dict.size(), supported.size()));
bool unfolded = get_edited_object()->editor_is_section_unfolded(get_edited_property());