summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-06-14 22:47:50 +0200
committerGitHub <noreply@github.com>2017-06-14 22:47:50 +0200
commitbe3115119994141d3708eb67cfb7db3bc14f84a8 (patch)
treefdaa926ed1ec14ed8255ce4892a7dfbfb5801b8c
parenta91b62e4c73626496136418067d339831223715f (diff)
parent7dde056d480295d76a1188244fc595f5ee66fdfc (diff)
Merge pull request #9174 from volzhs/file-mode-toggle
Make toggle between thumbnail and list for file dialog on editor
-rw-r--r--editor/editor_file_dialog.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index 25fade46d6..c2a408e8ab 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<ButtonGroup> 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);