Merge pull request #24333 from YeldhamDev/filechooser_folder_icon

Change EditorLineEditFileChooser to use the "Folder" icon
This commit is contained in:
Rémi Verschelde 2018-12-14 08:56:57 +01:00 committed by GitHub
commit 7e4e9e95e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -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);

View file

@ -254,6 +254,7 @@ class EditorLineEditFileChooser : public HBoxContainer {
void _browse();
protected:
void _notification(int p_what);
static void _bind_methods();
public: