summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorneikeq <ignalfonsore@gmail.com>2015-12-04 19:33:30 +0100
committerneikeq <ignalfonsore@gmail.com>2015-12-04 19:33:30 +0100
commit71eaa2d547082212d32f78eb4d9580a276a0510f (patch)
tree3f5744d058fc12f9a34c01edeeb1dbf8736531b1 /scene
parent35fa048af555e1f8411a2034706e9e452ce2f399 (diff)
Add refresh button to file dialogs
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/file_dialog.cpp9
-rw-r--r--scene/gui/file_dialog.h3
2 files changed, 12 insertions, 0 deletions
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");
diff --git a/scene/gui/file_dialog.h b/scene/gui/file_dialog.h
index ec42c7744a..370088b215 100644
--- a/scene/gui/file_dialog.h
+++ b/scene/gui/file_dialog.h
@@ -34,6 +34,7 @@
#include "scene/gui/line_edit.h"
#include "scene/gui/option_button.h"
#include "scene/gui/dialogs.h"
+#include "scene/gui/tool_button.h"
#include "os/dir_access.h"
#include "box_container.h"
/**
@@ -86,6 +87,8 @@ private:
OptionButton *filter;
DirAccess *dir_access;
ConfirmationDialog *confirm_save;
+
+ ToolButton *refresh;
Vector<String> filters;