From 12bfb55c6ce07ec81c8c886444a56c8ba3163c2c Mon Sep 17 00:00:00 2001 From: Franklin Sobrinho Date: Mon, 14 Dec 2015 08:43:56 -0300 Subject: Implement double-click on remaining dialogs --- tools/editor/editor_dir_dialog.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'tools/editor/editor_dir_dialog.cpp') diff --git a/tools/editor/editor_dir_dialog.cpp b/tools/editor/editor_dir_dialog.cpp index a8421acff8..1f3b5eed65 100644 --- a/tools/editor/editor_dir_dialog.cpp +++ b/tools/editor/editor_dir_dialog.cpp @@ -205,31 +205,36 @@ void EditorDirDialog::_bind_methods() { EditorDirDialog::EditorDirDialog() { + updating=false; + set_title("Choose a Directory"); + set_hide_on_ok(false); + tree = memnew( Tree ); add_child(tree); set_child_rect(tree); - updating=false; - get_ok()->set_text("Choose"); - set_hide_on_ok(false); - - + tree->connect("item_activated",this,"_ok"); makedir = add_button("Create Folder",OS::get_singleton()->get_swap_ok_cancel()?true:false,"makedir"); makedir->connect("pressed",this,"_make_dir"); makedialog = memnew( ConfirmationDialog ); makedialog->set_title("Create Folder"); + add_child(makedialog); + VBoxContainer *makevb= memnew( VBoxContainer ); makedialog->add_child(makevb); makedialog->set_child_rect(makevb); + makedirname = memnew( LineEdit ); makevb->add_margin_child("Name:",makedirname); - add_child(makedialog); makedialog->register_text_enter(makedirname); makedialog->connect("confirmed",this,"_make_dir_confirm"); + mkdirerr = memnew( AcceptDialog ); mkdirerr->set_text("Could not create folder."); add_child(mkdirerr); + get_ok()->set_text("Choose"); + } -- cgit v1.2.3