diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-03-26 17:23:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-26 17:23:11 +0100 |
commit | 5f1107aa30295e686be6f41cb6d17fc2cff1e036 (patch) | |
tree | 7bce4c680e6686c9d29be8b479be5b39205ce7a3 /editor/editor_dir_dialog.cpp | |
parent | a2da99f40cf2123c0906c734a2eb01e9b65a45a2 (diff) | |
parent | be07f86f85ab70a48b310b42faa64e72a74ca694 (diff) |
Merge pull request #37317 from akien-mga/display-server-rebased
Separate DisplayServer from OS and add multiple windows support
Diffstat (limited to 'editor/editor_dir_dialog.cpp')
-rw-r--r-- | editor/editor_dir_dialog.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/editor/editor_dir_dialog.cpp b/editor/editor_dir_dialog.cpp index 20fe349ef6..cb87656382 100644 --- a/editor/editor_dir_dialog.cpp +++ b/editor/editor_dir_dialog.cpp @@ -35,6 +35,7 @@ #include "editor/editor_file_system.h" #include "editor/editor_settings.h" #include "editor_scale.h" +#include "servers/display_server.h" void EditorDirDialog::_update_dir(TreeItem *p_item, EditorFileSystemDirectory *p_dir, const String &p_select_path) { @@ -43,7 +44,7 @@ void EditorDirDialog::_update_dir(TreeItem *p_item, EditorFileSystemDirectory *p String path = p_dir->get_path(); p_item->set_metadata(0, p_dir->get_path()); - p_item->set_icon(0, get_icon("Folder", "EditorIcons")); + p_item->set_icon(0, tree->get_theme_icon("Folder", "EditorIcons")); if (!p_item->get_parent()) { p_item->set_text(0, "res://"); @@ -68,7 +69,7 @@ void EditorDirDialog::_update_dir(TreeItem *p_item, EditorFileSystemDirectory *p void EditorDirDialog::reload(const String &p_path) { - if (!is_visible_in_tree()) { + if (!is_visible()) { must_reload = true; return; } @@ -102,7 +103,7 @@ void EditorDirDialog::_notification(int p_what) { } if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { - if (must_reload && is_visible_in_tree()) { + if (must_reload && is_visible()) { reload(); } } @@ -141,11 +142,11 @@ void EditorDirDialog::_make_dir() { TreeItem *ti = tree->get_selected(); if (!ti) { mkdirerr->set_text(TTR("Please select a base directory first.")); - mkdirerr->popup_centered_minsize(); + mkdirerr->popup_centered(); return; } - makedialog->popup_centered_minsize(Size2(250, 80)); + makedialog->popup_centered(Size2(250, 80)); makedirname->grab_focus(); } @@ -162,7 +163,7 @@ void EditorDirDialog::_make_dir_confirm() { Error err = d->make_dir(makedirname->get_text()); if (err != OK) { - mkdirerr->popup_centered_minsize(Size2(250, 80) * EDSCALE); + mkdirerr->popup_centered(Size2(250, 80) * EDSCALE); } else { opened_paths.insert(dir); //reload(dir.plus_file(makedirname->get_text())); @@ -188,7 +189,7 @@ EditorDirDialog::EditorDirDialog() { tree->connect("item_activated", callable_mp(this, &EditorDirDialog::_item_activated)); - makedir = add_button(TTR("Create Folder"), OS::get_singleton()->get_swap_ok_cancel(), "makedir"); + makedir = add_button(TTR("Create Folder"), DisplayServer::get_singleton()->get_swap_ok_cancel(), "makedir"); makedir->connect("pressed", callable_mp(this, &EditorDirDialog::_make_dir)); makedialog = memnew(ConfirmationDialog); |