summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-05-07 12:09:49 -0300
committerGitHub <noreply@github.com>2018-05-07 12:09:49 -0300
commitb89e354ce634884ee2f5839577667b4e835f97c8 (patch)
tree62b73cc227ecf9501d41e31f6a38484ce7fefafa
parentfd8e93eb9f68e39297c3afe26625bdfe4f6f5a74 (diff)
parent7ff3b52dea5b19c3bee28f261d6b521afb717f3c (diff)
Merge pull request #18610 from homer666/editor-popup-adjustments
Adjust default editor dialog window sizes
-rw-r--r--editor/create_dialog.cpp9
-rw-r--r--editor/project_export.cpp9
-rw-r--r--editor/project_settings_editor.cpp9
-rw-r--r--editor/settings_config_dialog.cpp9
4 files changed, 32 insertions, 4 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 78fb35e354..36978e37a5 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -87,7 +87,14 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode) {
if (EditorSettings::get_singleton()->has_setting("interface/dialogs/create_new_node_bounds")) {
popup(EditorSettings::get_singleton()->get("interface/dialogs/create_new_node_bounds"));
} else {
- popup_centered_ratio();
+
+ Size2 popup_size = Size2(900, 700) * editor_get_scale();
+ Size2 window_size = get_viewport_rect().size;
+
+ popup_size.x = MIN(window_size.x * 0.8, popup_size.x);
+ popup_size.y = MIN(window_size.y * 0.8, popup_size.y);
+
+ popup_centered(popup_size);
}
if (p_dont_clear) {
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index 8b8c756219..9f87fc82b5 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -81,7 +81,14 @@ void ProjectExportDialog::popup_export() {
if (EditorSettings::get_singleton()->has_setting("interface/dialogs/export_bounds")) {
popup(EditorSettings::get_singleton()->get("interface/dialogs/export_bounds"));
} else {
- popup_centered_ratio();
+
+ Size2 popup_size = Size2(900, 700) * editor_get_scale();
+ Size2 window_size = get_viewport_rect().size;
+
+ popup_size.x = MIN(window_size.x * 0.8, popup_size.x);
+ popup_size.y = MIN(window_size.y * 0.8, popup_size.y);
+
+ popup_centered(popup_size);
}
}
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index 21f5e596be..a4265b4e32 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -768,7 +768,14 @@ void ProjectSettingsEditor::popup_project_settings() {
if (EditorSettings::get_singleton()->has_setting("interface/dialogs/project_settings_bounds")) {
popup(EditorSettings::get_singleton()->get("interface/dialogs/project_settings_bounds"));
} else {
- popup_centered_ratio();
+
+ Size2 popup_size = Size2(900, 700) * editor_get_scale();
+ Size2 window_size = get_viewport_rect().size;
+
+ popup_size.x = MIN(window_size.x * 0.8, popup_size.x);
+ popup_size.y = MIN(window_size.y * 0.8, popup_size.y);
+
+ popup_centered(popup_size);
}
globals_editor->update_category_list();
_update_translations();
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp
index f50f9f6f5f..c3e9e4ab62 100644
--- a/editor/settings_config_dialog.cpp
+++ b/editor/settings_config_dialog.cpp
@@ -101,7 +101,14 @@ void EditorSettingsDialog::popup_edit_settings() {
if (EditorSettings::get_singleton()->has_setting("interface/dialogs/editor_settings_bounds")) {
popup(EditorSettings::get_singleton()->get("interface/dialogs/editor_settings_bounds"));
} else {
- popup_centered_ratio(0.7);
+
+ Size2 popup_size = Size2(900, 700) * editor_get_scale();
+ Size2 window_size = get_viewport_rect().size;
+
+ popup_size.x = MIN(window_size.x * 0.8, popup_size.x);
+ popup_size.y = MIN(window_size.y * 0.8, popup_size.y);
+
+ popup_centered(popup_size);
}
_focus_current_search_box();