@@ -42,7 +42,7 @@ public FolderSettingsViewModel()
42
42
43
43
ChangeGroupOptionCommand = new RelayCommand < GroupOption > ( ChangeGroupOption ) ;
44
44
}
45
- public FolderSettingsViewModel ( FolderLayoutModes modeOverride ) : this ( )
45
+ public FolderSettingsViewModel ( FolderLayoutModes modeOverride ) : this ( )
46
46
=> ( rootLayoutMode , LayoutPreference . IsAdaptiveLayoutOverridden ) = ( modeOverride , true ) ;
47
47
48
48
private readonly FolderLayoutModes ? rootLayoutMode ;
@@ -391,30 +391,12 @@ private static LayoutPreferences GetDefaultLayoutPreferences(string folderPath)
391
391
if ( folderPath == CommonPaths . DownloadsPath )
392
392
{
393
393
// Default for downloads folder is to group by date created
394
- return new LayoutPreferences
395
- {
396
- LayoutMode = userSettingsService . LayoutSettingsService . DefaultLayoutMode ,
397
- GridViewSize = userSettingsService . LayoutSettingsService . DefaultGridViewSize ,
398
- DirectorySortOption = userSettingsService . LayoutSettingsService . DefaultDirectorySortOption ,
399
- DirectorySortDirection = userSettingsService . LayoutSettingsService . DefaultDirectorySortDirection ,
400
- SortDirectoriesAlongsideFiles = userSettingsService . LayoutSettingsService . DefaultSortDirectoriesAlongsideFiles ,
401
- ColumnsViewModel = new ColumnsViewModel ( ) ,
402
- DirectoryGroupOption = GroupOption . DateCreated ,
403
- } ;
394
+ return new LayoutPreferences ( ) { DirectoryGroupOption = GroupOption . DateCreated } ;
404
395
}
405
396
else if ( LibraryHelper . IsLibraryPath ( folderPath ) )
406
397
{
407
398
// Default for libraries is to group by folder path
408
- return new LayoutPreferences
409
- {
410
- LayoutMode = userSettingsService . LayoutSettingsService . DefaultLayoutMode ,
411
- GridViewSize = userSettingsService . LayoutSettingsService . DefaultGridViewSize ,
412
- DirectorySortOption = userSettingsService . LayoutSettingsService . DefaultDirectorySortOption ,
413
- DirectorySortDirection = userSettingsService . LayoutSettingsService . DefaultDirectorySortDirection ,
414
- SortDirectoriesAlongsideFiles = userSettingsService . LayoutSettingsService . DefaultSortDirectoriesAlongsideFiles ,
415
- ColumnsViewModel = new ColumnsViewModel ( ) ,
416
- DirectoryGroupOption = GroupOption . FolderPath ,
417
- } ;
399
+ return new LayoutPreferences ( ) { DirectoryGroupOption = GroupOption . FolderPath } ;
418
400
}
419
401
else
420
402
{
@@ -553,5 +535,16 @@ public void OnDefaultPreferencesChanged(string folderPath, string settingsName)
553
535
break ;
554
536
}
555
537
}
538
+
539
+ public void SetDefaultLayoutPreferences ( ColumnsViewModel columns )
540
+ {
541
+ IUserSettingsService userSettingsService = Ioc . Default . GetService < IUserSettingsService > ( ) ;
542
+ userSettingsService . LayoutSettingsService . ShowDateColumn = ! columns . DateModifiedColumn . UserCollapsed ;
543
+ userSettingsService . LayoutSettingsService . ShowDateCreatedColumn = ! columns . DateCreatedColumn . UserCollapsed ;
544
+ userSettingsService . LayoutSettingsService . ShowTypeColumn = ! columns . ItemTypeColumn . UserCollapsed ;
545
+ userSettingsService . LayoutSettingsService . ShowSizeColumn = ! columns . SizeColumn . UserCollapsed ;
546
+ userSettingsService . LayoutSettingsService . ShowFileTagColumn = ! columns . TagColumn . UserCollapsed ;
547
+ //TODO: save column sizes
548
+ }
556
549
}
557
550
}
0 commit comments