From 71eaa2d547082212d32f78eb4d9580a276a0510f Mon Sep 17 00:00:00 2001 From: neikeq Date: Fri, 4 Dec 2015 19:33:30 +0100 Subject: Add refresh button to file dialogs --- scene/gui/file_dialog.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scene/gui/file_dialog.cpp') diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 8e428fd71c..75a1cb92ee 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -46,6 +46,11 @@ VBoxContainer *FileDialog::get_vbox() { } void FileDialog::_notification(int p_what) { + + if (p_what==NOTIFICATION_ENTER_TREE) { + + refresh->set_icon(get_icon("Reload","EditorIcons")); + } if (p_what==NOTIFICATION_DRAW) { @@ -700,6 +705,10 @@ FileDialog::FileDialog() { pathhb->add_child(dir); dir->set_h_size_flags(SIZE_EXPAND_FILL); + refresh = memnew( ToolButton ); + refresh->connect("pressed",this,"_update_file_list"); + pathhb->add_child(refresh); + drives = memnew( OptionButton ); pathhb->add_child(drives); drives->connect("item_selected",this,"_select_drive"); -- cgit v1.2.3