diff options
-rw-r--r-- | editor/create_dialog.cpp | 7 | ||||
-rw-r--r-- | editor/editor_help_search.cpp | 7 | ||||
-rw-r--r-- | editor/project_export.cpp | 7 | ||||
-rw-r--r-- | editor/project_settings_editor.cpp | 8 | ||||
-rw-r--r-- | editor/settings_config_dialog.cpp | 7 |
5 files changed, 20 insertions, 16 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 926fa37040..9f1082ecc4 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -89,8 +89,9 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode) { _save_and_update_favorite_list(); // Restore valid window bounds or pop up at default size. - if (EditorSettings::get_singleton()->has_setting("interface/dialogs/create_new_node_bounds")) { - popup(EditorSettings::get_singleton()->get("interface/dialogs/create_new_node_bounds")); + Rect2 saved_size = EditorSettings::get_singleton()->get_project_metadata("dialog_bounds", "create_new_node", Rect2()); + if (saved_size != Rect2()) { + popup(saved_size); } else { Size2 popup_size = Size2(900, 700) * editor_get_scale(); @@ -415,7 +416,7 @@ void CreateDialog::_notification(int p_what) { } } break; case NOTIFICATION_POPUP_HIDE: { - EditorSettings::get_singleton()->set("interface/dialogs/create_new_node_bounds", get_rect()); + EditorSettings::get_singleton()->get_project_metadata("dialog_bounds", "create_new_node", get_rect()); } break; } } diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index 8676dac921..4e4c5143f2 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -132,7 +132,7 @@ void EditorHelpSearch::_notification(int p_what) { results_tree->clear(); get_ok()->set_disabled(true); - EditorSettings::get_singleton()->set("interface/dialogs/search_help_bounds", get_rect()); + EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "search_help", get_rect()); } break; case NOTIFICATION_PROCESS: { @@ -177,8 +177,9 @@ void EditorHelpSearch::popup_dialog() { void EditorHelpSearch::popup_dialog(const String &p_term) { // Restore valid window bounds or pop up at default size. - if (EditorSettings::get_singleton()->has_setting("interface/dialogs/search_help_bounds")) - popup(EditorSettings::get_singleton()->get("interface/dialogs/search_help_bounds")); + Rect2 saved_size = EditorSettings::get_singleton()->get_project_metadata("dialog_bounds", "search_help", Rect2()); + if (saved_size != Rect2()) + popup(saved_size); else popup_centered_ratio(0.5F); diff --git a/editor/project_export.cpp b/editor/project_export.cpp index f8ba6fd4e3..6e1d5c07ce 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -56,7 +56,7 @@ void ProjectExportDialog::_notification(int p_what) { custom_feature_display->get_parent_control()->add_style_override("panel", get_stylebox("bg", "Tree")); } break; case NOTIFICATION_POPUP_HIDE: { - EditorSettings::get_singleton()->set("interface/dialogs/export_bounds", get_rect()); + EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "export", get_rect()); } break; case NOTIFICATION_THEME_CHANGED: { duplicate_preset->set_icon(get_icon("Duplicate", "EditorIcons")); @@ -84,8 +84,9 @@ void ProjectExportDialog::popup_export() { } // Restore valid window bounds or pop up at default size. - if (EditorSettings::get_singleton()->has_setting("interface/dialogs/export_bounds")) { - popup(EditorSettings::get_singleton()->get("interface/dialogs/export_bounds")); + Rect2 saved_size = EditorSettings::get_singleton()->get_project_metadata("dialog_bounds", "export", Rect2()); + if (saved_size != Rect2()) { + popup(saved_size); } else { Size2 popup_size = Size2(900, 700) * editor_get_scale(); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 7a68646f40..af8d33d3d1 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -115,10 +115,9 @@ void ProjectSettingsEditor::_notification(int p_what) { } break; case NOTIFICATION_POPUP_HIDE: { - EditorSettings::get_singleton()->set("interface/dialogs/project_settings_bounds", get_rect()); + EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "project_settings", get_rect()); } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - search_button->set_icon(get_icon("Search", "EditorIcons")); search_box->set_right_icon(get_icon("Search", "EditorIcons")); search_box->set_clear_button_enabled(true); @@ -788,8 +787,9 @@ void ProjectSettingsEditor::_update_actions() { void ProjectSettingsEditor::popup_project_settings() { // Restore valid window bounds or pop up at default size. - if (EditorSettings::get_singleton()->has_setting("interface/dialogs/project_settings_bounds")) { - popup(EditorSettings::get_singleton()->get("interface/dialogs/project_settings_bounds")); + Rect2 saved_size = EditorSettings::get_singleton()->get_project_metadata("dialog_bounds", "project_settings", Rect2()); + if (saved_size != Rect2()) { + popup(saved_size); } else { Size2 popup_size = Size2(900, 700) * editor_get_scale(); diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index 537c9ac6b8..a4956bee27 100644 --- a/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -94,8 +94,9 @@ void EditorSettingsDialog::popup_edit_settings() { set_process_unhandled_input(true); // Restore valid window bounds or pop up at default size. - if (EditorSettings::get_singleton()->has_setting("interface/dialogs/editor_settings_bounds")) { - popup(EditorSettings::get_singleton()->get("interface/dialogs/editor_settings_bounds")); + Rect2 saved_size = EditorSettings::get_singleton()->get_project_metadata("dialog_bounds", "editor_settings", Rect2()); + if (saved_size != Rect2()) { + popup(saved_size); } else { Size2 popup_size = Size2(900, 700) * editor_get_scale(); @@ -132,7 +133,7 @@ void EditorSettingsDialog::_notification(int p_what) { _update_icons(); } break; case NOTIFICATION_POPUP_HIDE: { - EditorSettings::get_singleton()->set("interface/dialogs/editor_settings_bounds", get_rect()); + EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "editor_settings", get_rect()); set_process_unhandled_input(false); } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { |