1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Dissolving class EditorLineEditFileChooser into EditorAutoloadSettings.

This commit is contained in:
unknown
2020-04-05 04:38:23 +05:30
parent 321ce4d4c4
commit 600f7cb97c
4 changed files with 41 additions and 74 deletions

View File

@@ -1733,42 +1733,3 @@ EditorFileDialog::~EditorFileDialog() {
unregister_func(this);
memdelete(dir_access);
}
void EditorLineEditFileChooser::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED)
button->set_icon(get_theme_icon("Folder", "EditorIcons"));
}
void EditorLineEditFileChooser::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_button"), &EditorLineEditFileChooser::get_button);
ClassDB::bind_method(D_METHOD("get_line_edit"), &EditorLineEditFileChooser::get_line_edit);
ClassDB::bind_method(D_METHOD("get_file_dialog"), &EditorLineEditFileChooser::get_file_dialog);
}
void EditorLineEditFileChooser::_chosen(const String &p_text) {
line_edit->set_text(p_text);
line_edit->emit_signal("text_entered", p_text);
}
void EditorLineEditFileChooser::_browse() {
dialog->popup_centered_ratio();
}
EditorLineEditFileChooser::EditorLineEditFileChooser() {
line_edit = memnew(LineEdit);
add_child(line_edit);
line_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL);
button = memnew(Button);
add_child(button);
button->connect("pressed", callable_mp(this, &EditorLineEditFileChooser::_browse));
dialog = memnew(EditorFileDialog);
add_child(dialog);
dialog->connect("file_selected", callable_mp(this, &EditorLineEditFileChooser::_chosen));
dialog->connect("dir_selected", callable_mp(this, &EditorLineEditFileChooser::_chosen));
dialog->connect("files_selected", callable_mp(this, &EditorLineEditFileChooser::_chosen));
}