diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-23 17:21:51 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-23 17:21:51 +0100 |
commit | 1757a600240c0070c419ec9b6087593f459f8f9d (patch) | |
tree | 7a3d50e31df857c62b676cc90f0092affa457da3 | |
parent | 49bb53093d5567deefa55eb1bef9951aed9b2f95 (diff) | |
parent | 09d7a1b864d6c418285aa6bdd8610e36fedc6e2c (diff) |
Merge pull request #68369 from Chaosus/fix_quick_open
Fix Quick Open window to use EDSCALE and save the size between popups
-rw-r--r-- | editor/editor_command_palette.cpp | 8 | ||||
-rw-r--r-- | editor/editor_quick_open.cpp | 10 |
2 files changed, 16 insertions, 2 deletions
diff --git a/editor/editor_command_palette.cpp b/editor/editor_command_palette.cpp index 3f93fa1f41..b92b0fca59 100644 --- a/editor/editor_command_palette.cpp +++ b/editor/editor_command_palette.cpp @@ -171,7 +171,13 @@ void EditorCommandPalette::_confirmed() { } void EditorCommandPalette::open_popup() { - popup_centered_clamped(Size2i(600, 440), 0.8f); + static bool was_showed = false; + if (!was_showed) { + was_showed = true; + popup_centered_clamped(Size2(600, 440) * EDSCALE, 0.8f); + } else { + show(); + } command_search_box->clear(); command_search_box->grab_focus(); diff --git a/editor/editor_quick_open.cpp b/editor/editor_quick_open.cpp index 50429878f9..bb533b88d6 100644 --- a/editor/editor_quick_open.cpp +++ b/editor/editor_quick_open.cpp @@ -32,12 +32,20 @@ #include "core/os/keyboard.h" #include "editor/editor_node.h" +#include "editor/editor_scale.h" void EditorQuickOpen::popup_dialog(const String &p_base, bool p_enable_multi, bool p_dontclear) { base_type = p_base; allow_multi_select = p_enable_multi; search_options->set_select_mode(allow_multi_select ? Tree::SELECT_MULTI : Tree::SELECT_SINGLE); - popup_centered_clamped(Size2i(600, 440), 0.8f); + + static bool was_showed = false; + if (!was_showed) { + was_showed = true; + popup_centered_clamped(Size2(600, 440) * EDSCALE, 0.8f); + } else { + show(); + } EditorFileSystemDirectory *efsd = EditorFileSystem::get_singleton()->get_filesystem(); _build_search_cache(efsd); |