diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-10-06 16:01:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-06 16:01:55 +0200 |
commit | 07112b92a85de9b2134f3208149b295f871d3642 (patch) | |
tree | 34669cbeb9908e9ae1d680a0027bb7e2c404e7c1 /editor/editor_file_dialog.cpp | |
parent | ed333248f59da26fc0a3a1b30baf461ed332f0d9 (diff) | |
parent | 725c2bdf48fff51ab359b69dbf6cc982a8693554 (diff) |
Merge pull request #42598 from KoBeWi/update_setting_or_something
Update the setting when clicking Show hidden files
Diffstat (limited to 'editor/editor_file_dialog.cpp')
-rw-r--r-- | editor/editor_file_dialog.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index f4d52d6bce..2140b6bd13 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -60,7 +60,7 @@ VBoxContainer *EditorFileDialog::get_vbox() { void EditorFileDialog::_notification(int p_what) { if (p_what == NOTIFICATION_READY || p_what == NOTIFICATION_THEME_CHANGED) { - // update icons + // Update icons. mode_thumbnails->set_icon(item_list->get_theme_icon("FileThumbnail", "EditorIcons")); mode_list->set_icon(item_list->get_theme_icon("FileList", "EditorIcons")); dir_prev->set_icon(item_list->get_theme_icon("Back", "EditorIcons")); @@ -94,7 +94,7 @@ void EditorFileDialog::_notification(int p_what) { } set_display_mode((DisplayMode)EditorSettings::get_singleton()->get("filesystem/file_dialog/display_mode").operator int()); - // update icons + // Update icons. mode_thumbnails->set_icon(item_list->get_theme_icon("FileThumbnail", "EditorIcons")); mode_list->set_icon(item_list->get_theme_icon("FileList", "EditorIcons")); dir_prev->set_icon(item_list->get_theme_icon("Back", "EditorIcons")); @@ -138,9 +138,7 @@ void EditorFileDialog::_unhandled_input(const Ref<InputEvent> &p_event) { handled = true; } if (ED_IS_SHORTCUT("file_dialog/toggle_hidden_files", p_event)) { - bool show = !show_hidden_files; - set_show_hidden_files(show); - EditorSettings::get_singleton()->set("filesystem/file_dialog/show_hidden_files", show); + set_show_hidden_files(!show_hidden_files); handled = true; } if (ED_IS_SHORTCUT("file_dialog/toggle_favorite", p_event)) { @@ -1385,6 +1383,11 @@ void EditorFileDialog::_bind_methods() { } void EditorFileDialog::set_show_hidden_files(bool p_show) { + if (p_show == show_hidden_files) { + return; + } + + EditorSettings::get_singleton()->set("filesystem/file_dialog/show_hidden_files", p_show); show_hidden_files = p_show; show_hidden->set_pressed(p_show); invalidate(); |