summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2022-09-22 08:20:40 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2022-09-22 08:20:40 +0300
commit4351af30c878f74ddbc8c5cf04c23fb4395999c4 (patch)
treeb80303fc34f4d4b243236dfb11c9fc0533e2cb35 /editor/plugins
parente5c544750c04951922dadff1c765d035414d0e28 (diff)
[Font Inspector Plugin] Hide "Add Feature" button if supported feature list is empty.
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/font_config_plugin.cpp10
1 files changed, 10 insertions, 0 deletions
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());