Merge pull request #66240 from bruvzg/ftr_hide
[Font Inspector Plugin] Hide "Add Feature" button if supported feature list is empty.
This commit is contained in:
commit
6d6f7f3de8
2 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue