Working multiple window support, including editor

This commit is contained in:
Juan Linietsky
2020-03-06 14:00:16 -03:00
committed by Juan Linietsky
parent f51fdc6eef
commit 4758057f20
105 changed files with 1956 additions and 1742 deletions

View File

@@ -142,7 +142,7 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd, Vector<Pair<Str
if (search_text.is_subsequence_ofi(path)) {
Pair<String, Ref<Texture2D>> pair;
pair.first = path;
pair.second = get_icon("folder", "FileDialog");
pair.second = search_options->get_icon("folder", "FileDialog");
if (search_text != String() && list.size() > 0) {
@@ -171,7 +171,7 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd, Vector<Pair<Str
if (ClassDB::is_parent_class(efsd->get_file_type(i), base_type) && (search_text.is_subsequence_ofi(file))) {
Pair<String, Ref<Texture2D>> pair;
pair.first = file;
pair.second = get_icon((has_icon(efsd->get_file_type(i), ei) ? efsd->get_file_type(i) : ot), ei);
pair.second = search_options->get_icon((search_options->has_icon(efsd->get_file_type(i), ei) ? efsd->get_file_type(i) : ot), ei);
list.push_back(pair);
}
}
@@ -253,6 +253,11 @@ void EditorQuickOpen::_confirmed() {
hide();
}
void EditorQuickOpen::_theme_changed() {
search_box->set_right_icon(search_options->get_icon("Search", "EditorIcons"));
}
void EditorQuickOpen::_notification(int p_what) {
switch (p_what) {
@@ -262,9 +267,6 @@ void EditorQuickOpen::_notification(int p_what) {
search_box->set_clear_button_enabled(true);
[[fallthrough]];
}
case NOTIFICATION_THEME_CHANGED: {
search_box->set_right_icon(get_icon("Search", "EditorIcons"));
} break;
case NOTIFICATION_EXIT_TREE: {
disconnect("confirmed", callable_mp(this, &EditorQuickOpen::_confirmed));
} break;
@@ -284,6 +286,8 @@ void EditorQuickOpen::_bind_methods() {
EditorQuickOpen::EditorQuickOpen() {
VBoxContainer *vbc = memnew(VBoxContainer);
vbc->connect("theme_changed", callable_mp(this, &EditorQuickOpen::_theme_changed));
add_child(vbc);
search_box = memnew(LineEdit);
vbc->add_margin_child(TTR("Search:"), search_box);