diff options
Diffstat (limited to 'editor/localization_editor.cpp')
-rw-r--r-- | editor/localization_editor.cpp | 95 |
1 files changed, 18 insertions, 77 deletions
diff --git a/editor/localization_editor.cpp b/editor/localization_editor.cpp index 0e68af06f0..977ca83671 100644 --- a/editor/localization_editor.cpp +++ b/editor/localization_editor.cpp @@ -37,24 +37,6 @@ #include "scene/gui/control.h" void LocalizationEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_TEXT_SERVER_CHANGED) { - ts_name->set_text(TTR("Text server: ") + TS->get_name()); - - FileAccessRef file_check = FileAccess::create(FileAccess::ACCESS_RESOURCES); - if (TS->has_feature(TextServer::FEATURE_USE_SUPPORT_DATA)) { - if (file_check->file_exists("res://" + TS->get_support_data_filename())) { - ts_data_status->set_text(TTR("Support data: ") + TTR("Installed")); - ts_install->set_disabled(true); - } else { - ts_data_status->set_text(TTR("Support data: ") + TTR("Not installed")); - ts_install->set_disabled(false); - } - } else { - ts_data_status->set_text(TTR("Support data: ") + TTR("Not supported")); - ts_install->set_disabled(false); - } - ts_data_info->set_text(TTR("Info: ") + TS->get_support_data_info()); - } if (p_what == NOTIFICATION_ENTER_TREE) { translation_list->connect("button_pressed", callable_mp(this, &LocalizationEditor::_translation_delete)); translation_pot_list->connect("button_pressed", callable_mp(this, &LocalizationEditor::_pot_delete)); @@ -649,26 +631,6 @@ void LocalizationEditor::update_translations() { updating_translations = false; } -void LocalizationEditor::_install_ts_data() { - if (TS->has_feature(TextServer::FEATURE_USE_SUPPORT_DATA)) { - TS->save_support_data("res://" + TS->get_support_data_filename()); - } - - FileAccessRef file_check = FileAccess::create(FileAccess::ACCESS_RESOURCES); - if (TS->has_feature(TextServer::FEATURE_USE_SUPPORT_DATA)) { - if (file_check->file_exists("res://" + TS->get_support_data_filename())) { - ts_data_status->set_text(TTR("Support data: ") + TTR("Installed")); - ts_install->set_disabled(true); - } else { - ts_data_status->set_text(TTR("Support data: ") + TTR("Not installed")); - ts_install->set_disabled(false); - } - } else { - ts_data_status->set_text(TTR("Support data: ") + TTR("Not supported")); - ts_install->set_disabled(false); - } -} - void LocalizationEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("update_translations"), &LocalizationEditor::update_translations); @@ -694,7 +656,9 @@ LocalizationEditor::LocalizationEditor() { translations->add_child(tvb); HBoxContainer *thb = memnew(HBoxContainer); - thb->add_child(memnew(Label(TTR("Translations:")))); + Label *l = memnew(Label(TTR("Translations:"))); + l->set_theme_type_variation("HeaderSmall"); + thb->add_child(l); thb->add_spacer(); tvb->add_child(thb); @@ -722,7 +686,9 @@ LocalizationEditor::LocalizationEditor() { translations->add_child(tvb); HBoxContainer *thb = memnew(HBoxContainer); - thb->add_child(memnew(Label(TTR("Resources:")))); + Label *l = memnew(Label(TTR("Resources:"))); + l->set_theme_type_variation("HeaderSmall"); + thb->add_child(l); thb->add_spacer(); tvb->add_child(thb); @@ -746,7 +712,9 @@ LocalizationEditor::LocalizationEditor() { add_child(translation_res_file_open_dialog); thb = memnew(HBoxContainer); - thb->add_child(memnew(Label(TTR("Remaps by Locale:")))); + l = memnew(Label(TTR("Remaps by Locale:"))); + l->set_theme_type_variation("HeaderSmall"); + thb->add_child(l); thb->add_spacer(); tvb->add_child(thb); @@ -766,8 +734,10 @@ LocalizationEditor::LocalizationEditor() { translation_remap_options->set_column_title(1, TTR("Locale")); translation_remap_options->set_column_titles_visible(true); translation_remap_options->set_column_expand(0, true); + translation_remap_options->set_column_clip_content(0, true); translation_remap_options->set_column_expand(1, false); - translation_remap_options->set_column_min_width(1, 200); + translation_remap_options->set_column_clip_content(1, true); + translation_remap_options->set_column_custom_minimum_width(1, 200); translation_remap_options->connect("item_edited", callable_mp(this, &LocalizationEditor::_translation_res_option_changed)); translation_remap_options->connect("button_pressed", callable_mp(this, &LocalizationEditor::_translation_res_option_delete)); tmc->add_child(translation_remap_options); @@ -794,7 +764,9 @@ LocalizationEditor::LocalizationEditor() { translation_locale_filter_mode->connect("item_selected", callable_mp(this, &LocalizationEditor::_translation_filter_mode_changed)); tmc->add_margin_child(TTR("Filter mode:"), translation_locale_filter_mode); - tmc->add_child(memnew(Label(TTR("Locales:")))); + Label *l = memnew(Label(TTR("Locales:"))); + l->set_theme_type_variation("HeaderSmall"); + tmc->add_child(l); translation_filter = memnew(Tree); translation_filter->set_v_size_flags(Control::SIZE_EXPAND_FILL); translation_filter->set_columns(1); @@ -808,7 +780,9 @@ LocalizationEditor::LocalizationEditor() { translations->add_child(tvb); HBoxContainer *thb = memnew(HBoxContainer); - thb->add_child(memnew(Label(TTR("Files with translation strings:")))); + Label *l = memnew(Label(TTR("Files with translation strings:"))); + l->set_theme_type_variation("HeaderSmall"); + thb->add_child(l); thb->add_spacer(); tvb->add_child(thb); @@ -838,37 +812,4 @@ LocalizationEditor::LocalizationEditor() { pot_file_open_dialog->connect("files_selected", callable_mp(this, &LocalizationEditor::_pot_add)); add_child(pot_file_open_dialog); } - - { - VBoxContainer *tvb = memnew(VBoxContainer); - tvb->set_name(TTR("Text Server Data")); - translations->add_child(tvb); - - ts_name = memnew(Label(TTR("Text server: ") + TS->get_name())); - tvb->add_child(ts_name); - - ts_data_status = memnew(Label(TTR("Support data: "))); - tvb->add_child(ts_data_status); - - ts_data_info = memnew(Label(TTR("Info: ") + TS->get_support_data_info())); - tvb->add_child(ts_data_info); - - ts_install = memnew(Button(TTR("Install support data..."))); - ts_install->connect("pressed", callable_mp(this, &LocalizationEditor::_install_ts_data)); - tvb->add_child(ts_install); - - FileAccessRef file_check = FileAccess::create(FileAccess::ACCESS_RESOURCES); - if (TS->has_feature(TextServer::FEATURE_USE_SUPPORT_DATA)) { - if (file_check->file_exists("res://" + TS->get_support_data_filename())) { - ts_data_status->set_text(TTR("Support data: ") + TTR("Installed")); - ts_install->set_disabled(true); - } else { - ts_data_status->set_text(TTR("Support data: ") + TTR("Not installed")); - ts_install->set_disabled(false); - } - } else { - ts_data_status->set_text(TTR("Support data: ") + TTR("Not supported")); - ts_install->set_disabled(false); - } - } } |