|
@@ -231,7 +231,6 @@ void FileSystemDock::_update_tree(const Vector<String> p_uncollapsed_paths, bool
|
|
|
|
|
|
void FileSystemDock::set_display_mode(DisplayMode p_display_mode) {
|
|
|
display_mode = p_display_mode;
|
|
|
- emit_signal("display_mode_changed");
|
|
|
_update_display_mode(false);
|
|
|
}
|
|
|
|
|
@@ -284,8 +283,7 @@ void FileSystemDock::_notification(int p_what) {
|
|
|
String ei = "EditorIcons";
|
|
|
button_reload->set_icon(get_icon("Reload", ei));
|
|
|
button_toggle_display_mode->set_icon(get_icon("Panels2", ei));
|
|
|
- _update_file_list_display_mode_button();
|
|
|
- button_file_list_display_mode->connect("pressed", this, "_change_file_display");
|
|
|
+ button_file_list_display_mode->connect("toggled", this, "_toggle_file_display");
|
|
|
|
|
|
files->connect("item_activated", this, "_file_list_activate_file");
|
|
|
button_hist_next->connect("pressed", this, "_fw_history");
|
|
@@ -501,9 +499,13 @@ void FileSystemDock::_tree_thumbnail_done(const String &p_path, const Ref<Textur
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void FileSystemDock::_update_file_list_display_mode_button() {
|
|
|
+void FileSystemDock::_toggle_file_display(bool p_active) {
|
|
|
+ _set_file_display(p_active);
|
|
|
+ emit_signal("display_mode_changed");
|
|
|
+}
|
|
|
|
|
|
- if (button_file_list_display_mode->is_pressed()) {
|
|
|
+void FileSystemDock::_set_file_display(bool p_active) {
|
|
|
+ if (p_active) {
|
|
|
file_list_display_mode = FILE_LIST_DISPLAY_LIST;
|
|
|
button_file_list_display_mode->set_icon(get_icon("FileThumbnail", "EditorIcons"));
|
|
|
button_file_list_display_mode->set_tooltip(TTR("View items as a grid of thumbnails."));
|
|
@@ -512,14 +514,6 @@ void FileSystemDock::_update_file_list_display_mode_button() {
|
|
|
button_file_list_display_mode->set_icon(get_icon("FileList", "EditorIcons"));
|
|
|
button_file_list_display_mode->set_tooltip(TTR("View items as a list."));
|
|
|
}
|
|
|
- emit_signal("display_mode_changed");
|
|
|
-}
|
|
|
-
|
|
|
-void FileSystemDock::_change_file_display() {
|
|
|
-
|
|
|
- _update_file_list_display_mode_button();
|
|
|
-
|
|
|
- EditorSettings::get_singleton()->set("docks/filesystem/files_display_mode", file_list_display_mode);
|
|
|
|
|
|
_update_file_list(true);
|
|
|
}
|
|
@@ -1679,6 +1673,7 @@ void FileSystemDock::_rescan() {
|
|
|
|
|
|
void FileSystemDock::_toggle_split_mode(bool p_active) {
|
|
|
set_display_mode(p_active ? DISPLAY_MODE_SPLIT : DISPLAY_MODE_TREE_ONLY);
|
|
|
+ emit_signal("display_mode_changed");
|
|
|
}
|
|
|
|
|
|
void FileSystemDock::fix_dependencies(const String &p_for_file) {
|
|
@@ -1696,7 +1691,7 @@ void FileSystemDock::set_file_list_display_mode(FileListDisplayMode p_mode) {
|
|
|
return;
|
|
|
|
|
|
button_file_list_display_mode->set_pressed(p_mode == FILE_LIST_DISPLAY_LIST);
|
|
|
- _change_file_display();
|
|
|
+ _toggle_file_display(p_mode == FILE_LIST_DISPLAY_LIST);
|
|
|
}
|
|
|
|
|
|
Variant FileSystemDock::get_drag_data_fw(const Point2 &p_point, Control *p_from) {
|
|
@@ -2285,7 +2280,7 @@ void FileSystemDock::_bind_methods() {
|
|
|
ClassDB::bind_method(D_METHOD("_tree_activate_file"), &FileSystemDock::_tree_activate_file);
|
|
|
ClassDB::bind_method(D_METHOD("_select_file"), &FileSystemDock::_select_file);
|
|
|
ClassDB::bind_method(D_METHOD("_navigate_to_path"), &FileSystemDock::_navigate_to_path);
|
|
|
- ClassDB::bind_method(D_METHOD("_change_file_display"), &FileSystemDock::_change_file_display);
|
|
|
+ ClassDB::bind_method(D_METHOD("_toggle_file_display"), &FileSystemDock::_toggle_file_display);
|
|
|
ClassDB::bind_method(D_METHOD("_fw_history"), &FileSystemDock::_fw_history);
|
|
|
ClassDB::bind_method(D_METHOD("_bw_history"), &FileSystemDock::_bw_history);
|
|
|
ClassDB::bind_method(D_METHOD("_fs_changed"), &FileSystemDock::_fs_changed);
|