From 7dde056d480295d76a1188244fc595f5ee66fdfc Mon Sep 17 00:00:00 2001 From: volzhs Date: Wed, 14 Jun 2017 23:00:39 +0900 Subject: [PATCH] Make toggle between thumbnail and list for file dialog on editor --- editor/editor_file_dialog.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 25fade46d66..c2a408e8ab0 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -1300,16 +1300,21 @@ EditorFileDialog::EditorFileDialog() { favorite->connect("toggled", this, "_favorite_toggled"); pathhb->add_child(favorite); + Ref view_mode_group; + view_mode_group.instance(); + mode_thumbnails = memnew(ToolButton); mode_thumbnails->connect("pressed", this, "set_display_mode", varray(DISPLAY_THUMBNAILS)); mode_thumbnails->set_toggle_mode(true); mode_thumbnails->set_pressed(display_mode == DISPLAY_THUMBNAILS); + mode_thumbnails->set_button_group(view_mode_group); pathhb->add_child(mode_thumbnails); mode_list = memnew(ToolButton); mode_list->connect("pressed", this, "set_display_mode", varray(DISPLAY_LIST)); mode_list->set_toggle_mode(true); mode_list->set_pressed(display_mode == DISPLAY_LIST); + mode_list->set_button_group(view_mode_group); pathhb->add_child(mode_list); drives = memnew(OptionButton);