summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-12-14 08:56:57 +0100
committerGitHub <noreply@github.com>2018-12-14 08:56:57 +0100
commit7e4e9e95e4fb654f99721b093e6ed15d0bacc0d0 (patch)
tree1b6e8b526d7159e6a5af3ef836bf39e1c24f3b53
parent491743d670c82be5fb6b193e1a06074ab994fe61 (diff)
parent0e894a160cfc2c29623247fbc1f8c761e07dc24d (diff)
Merge pull request #24333 from YeldhamDev/filechooser_folder_icon
Change EditorLineEditFileChooser to use the "Folder" icon
-rw-r--r--editor/editor_file_dialog.cpp7
-rw-r--r--editor/editor_file_dialog.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index 81d9442656..2360e5f410 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -1699,6 +1699,12 @@ EditorFileDialog::~EditorFileDialog() {
memdelete(dir_access);
}
+void EditorLineEditFileChooser::_notification(int p_what) {
+
+ if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED)
+ button->set_icon(get_icon("Folder", "EditorIcons"));
+}
+
void EditorLineEditFileChooser::_bind_methods() {
ClassDB::bind_method(D_METHOD("_browse"), &EditorLineEditFileChooser::_browse);
@@ -1725,7 +1731,6 @@ EditorLineEditFileChooser::EditorLineEditFileChooser() {
add_child(line_edit);
line_edit->set_h_size_flags(SIZE_EXPAND_FILL);
button = memnew(Button);
- button->set_text(" .. ");
add_child(button);
button->connect("pressed", this, "_browse");
dialog = memnew(EditorFileDialog);
diff --git a/editor/editor_file_dialog.h b/editor/editor_file_dialog.h
index 56cefb9a47..574fefcab4 100644
--- a/editor/editor_file_dialog.h
+++ b/editor/editor_file_dialog.h
@@ -254,6 +254,7 @@ class EditorLineEditFileChooser : public HBoxContainer {
void _browse();
protected:
+ void _notification(int p_what);
static void _bind_methods();
public: