-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
FoldersPage.xaml
270 lines (241 loc) · 11.9 KB
/
FoldersPage.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<!-- Copyright (c) 2023 Files Community. Licensed under the MIT License. See the LICENSE. -->
<Page
x:Class="Files.App.Views.Settings.FoldersPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:helpers="using:Files.App.Helpers"
xmlns:local="using:Files.App.UserControls.Settings"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:Files.App.ViewModels.Settings"
mc:Ignorable="d">
<Page.Resources>
<ResourceDictionary Source="/ResourceDictionaries/RightAlignedToggleSwitchStyle.xaml" />
</Page.Resources>
<Page.DataContext>
<vm:FoldersViewModel x:Name="ViewModel" />
</Page.DataContext>
<Grid>
<StackPanel
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Spacing="4">
<StackPanel.ChildrenTransitions>
<TransitionCollection>
<EntranceThemeTransition />
</TransitionCollection>
</StackPanel.ChildrenTransitions>
<!-- Title -->
<TextBlock
Padding="0,0,0,12"
FontSize="24"
FontWeight="Medium"
Text="{helpers:ResourceString Name=FilesAndFolders}" />
<!-- Display -->
<TextBlock
Padding="0,16,0,4"
FontSize="16"
FontWeight="Medium"
Text="{helpers:ResourceString Name=Display}" />
<!-- Hidden Items -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=HiddenItems}" HorizontalAlignment="Stretch">
<local:SettingsBlockControl.Icon>
<FontIcon Glyph="" />
</local:SettingsBlockControl.Icon>
<local:SettingsBlockControl.ExpandableContent>
<StackPanel>
<!-- Hidden Files -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=SettingsFilesAndFoldersShowHiddenItems}" HorizontalAlignment="Stretch">
<ToggleSwitch
AutomationProperties.Name="{helpers:ResourceString Name=SettingsFilesAndFoldersShowHiddenItems}"
IsOn="{x:Bind ViewModel.ShowHiddenItems, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
</local:SettingsBlockControl>
<!-- Dots Files -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowDotFiles}" HorizontalAlignment="Stretch">
<ToggleSwitch
AutomationProperties.Name="{helpers:ResourceString Name=ShowDotFiles}"
IsOn="{x:Bind ViewModel.ShowDotFiles, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
</local:SettingsBlockControl>
<!-- System Files -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowProtectedSystemFiles}" HorizontalAlignment="Stretch">
<ToggleSwitch
AutomationProperties.Name="{helpers:ResourceString Name=ShowProtectedSystemFiles}"
IsOn="{x:Bind ViewModel.ShowProtectedSystemFiles, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
</local:SettingsBlockControl>
<!-- Alternate Data Streams -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowAlternateStreams}" HorizontalAlignment="Stretch">
<ToggleSwitch
AutomationProperties.Name="{helpers:ResourceString Name=ShowAlternateStreams}"
IsOn="{x:Bind ViewModel.AreAlternateStreamsVisible, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
</local:SettingsBlockControl>
</StackPanel>
</local:SettingsBlockControl.ExpandableContent>
</local:SettingsBlockControl>
<!-- File Extensions -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=SettingsFilesAndFoldersShowFileExtensions}" HorizontalAlignment="Stretch">
<local:SettingsBlockControl.Icon>
<FontIcon Glyph="" />
</local:SettingsBlockControl.Icon>
<ToggleSwitch
AutomationProperties.Name="{helpers:ResourceString Name=SettingsFilesAndFoldersShowFileExtensions}"
IsOn="{x:Bind ViewModel.ShowFileExtensions, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
</local:SettingsBlockControl>
<!-- Show Thumbnails -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=Thumbnails}" HorizontalAlignment="Stretch">
<local:SettingsBlockControl.Icon>
<FontIcon Glyph="" />
</local:SettingsBlockControl.Icon>
<local:SettingsBlockControl.ExpandableContent>
<StackPanel>
<!-- File Thumbnails -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=FileThumbnails}" HorizontalAlignment="Stretch">
<ToggleSwitch
AutomationProperties.Name="{helpers:ResourceString Name=FileThumbnails}"
IsOn="{x:Bind ViewModel.ShowFileThumbnails, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
</local:SettingsBlockControl>
<!-- Folder Thumbnails -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=FolderThumbnails}" HorizontalAlignment="Stretch">
<ComboBox AutomationProperties.Name="{helpers:ResourceString Name=FolderThumbnails}" SelectedIndex="{x:Bind ViewModel.SelectedFolderIconOptionIndex, Mode=TwoWay}">
<ComboBoxItem Content="{helpers:ResourceString Name=ShowThumbnails}" />
<ComboBoxItem Content="{helpers:ResourceString Name=AlwaysShowIcons}" />
<ComboBoxItem Content="{helpers:ResourceString Name=OnlyShowCachedThumbnails}" />
</ComboBox>
</local:SettingsBlockControl>
<!-- Performance Warning -->
<InfoBar
CornerRadius="0,0,2,2"
IsClosable="False"
IsIconVisible="True"
IsOpen="True"
Message="{helpers:ResourceString Name=ShowThumbnailsWarning}"
Severity="Warning" />
</StackPanel>
</local:SettingsBlockControl.ExpandableContent>
</local:SettingsBlockControl>
<!-- Show Checkboxes When Selecting Items -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowCheckboxesWhenSelectingItems}" HorizontalAlignment="Stretch">
<local:SettingsBlockControl.Icon>
<FontIcon Glyph="" />
</local:SettingsBlockControl.Icon>
<ToggleSwitch
AutomationProperties.Name="{helpers:ResourceString Name=ShowCheckboxesWhenSelectingItems}"
IsOn="{x:Bind ViewModel.ShowCheckboxesWhenSelectingItems, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
</local:SettingsBlockControl>
<!-- Behaviors -->
<TextBlock
Padding="0,16,0,4"
FontSize="16"
FontWeight="Medium"
Text="{helpers:ResourceString Name=Behaviors}" />
<!-- Opening items -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=OpeningItems}" HorizontalAlignment="Stretch">
<local:SettingsBlockControl.Icon>
<FontIcon Glyph="" />
</local:SettingsBlockControl.Icon>
<local:SettingsBlockControl.ExpandableContent>
<StackPanel>
<local:SettingsBlockControl Title="{helpers:ResourceString Name=SettingsOpenItemsWithOneClick}" HorizontalAlignment="Stretch">
<ToggleSwitch
AutomationProperties.Name="{helpers:ResourceString Name=SettingsOpenItemsWithOneClick}"
IsOn="{x:Bind ViewModel.OpenItemsWithOneClick, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
</local:SettingsBlockControl>
<local:SettingsBlockControl Title="{helpers:ResourceString Name=OpenFolderWithOneClickColumnsLayout}" HorizontalAlignment="Stretch">
<ToggleSwitch
AutomationProperties.Name="{helpers:ResourceString Name=OpenFolderWithOneClickColumnsLayout}"
IsOn="{x:Bind ViewModel.ColumnLayoutOpenFoldersWithOneClick, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
</local:SettingsBlockControl>
<local:SettingsBlockControl Title="{helpers:ResourceString Name=OpenFoldersInNewTab}" HorizontalAlignment="Stretch">
<ToggleSwitch
x:Name="OpenFoldersNewTab"
AutomationProperties.Name="{helpers:ResourceString Name=OpenFoldersInNewTab}"
IsOn="{x:Bind ViewModel.OpenFoldersNewTab, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
</local:SettingsBlockControl>
</StackPanel>
</local:SettingsBlockControl.ExpandableContent>
</local:SettingsBlockControl>
<!-- Confirm Delete -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowConfirmationWhenDeletingItems}" HorizontalAlignment="Stretch">
<local:SettingsBlockControl.Icon>
<FontIcon Glyph="" />
</local:SettingsBlockControl.Icon>
<ComboBox AutomationProperties.Name="{helpers:ResourceString Name=ShowConfirmationWhenDeletingItems}" SelectedIndex="{x:Bind ViewModel.SelectedDeleteConfirmationPolicyIndex, Mode=TwoWay}">
<ComboBoxItem Content="{helpers:ResourceString Name=Always}" />
<ComboBoxItem Content="{helpers:ResourceString Name=PermanentDeletionOnly}" />
<ComboBoxItem Content="{helpers:ResourceString Name=Never}" />
</ComboBox>
</local:SettingsBlockControl>
<!-- File Extension Warning -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowFileExtensionWarning}" HorizontalAlignment="Stretch">
<local:SettingsBlockControl.Icon>
<FontIcon Glyph="" />
</local:SettingsBlockControl.Icon>
<ToggleSwitch
AutomationProperties.Name="{helpers:ResourceString Name=ShowFileExtensionWarning}"
IsOn="{x:Bind ViewModel.ShowFileExtensionWarning, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
</local:SettingsBlockControl>
<!-- Select On Hover -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=SelectFilesAndFoldersOnHover}" HorizontalAlignment="Stretch">
<local:SettingsBlockControl.Icon>
<FontIcon Glyph="" />
</local:SettingsBlockControl.Icon>
<ToggleSwitch
AutomationProperties.Name="{helpers:ResourceString Name=SelectFilesAndFoldersOnHover}"
IsOn="{x:Bind ViewModel.SelectFilesOnHover, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
</local:SettingsBlockControl>
<!-- Double click to go up -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=DoubleClickBlankSpaceToGoUp}" HorizontalAlignment="Stretch">
<local:SettingsBlockControl.Icon>
<FontIcon Glyph="" />
</local:SettingsBlockControl.Icon>
<ToggleSwitch
AutomationProperties.Name="{helpers:ResourceString Name=DoubleClickBlankSpaceToGoUp}"
IsOn="{x:Bind ViewModel.DoubleClickToGoUp, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
</local:SettingsBlockControl>
<!-- Scroll to parent folder when navigating up -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=ScrollToPreviousFolderWhenNavigatingUp}" HorizontalAlignment="Stretch">
<local:SettingsBlockControl.Icon>
<FontIcon Glyph="" />
</local:SettingsBlockControl.Icon>
<ToggleSwitch
AutomationProperties.Name="{helpers:ResourceString Name=ScrollToPreviousFolderWhenNavigatingUp}"
IsOn="{x:Bind ViewModel.ScrollToPreviousFolderWhenNavigatingUp, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
</local:SettingsBlockControl>
<!-- Calculate folder sizes -->
<local:SettingsBlockControl
Title="{helpers:ResourceString Name=CalculateFolderSizes}"
HorizontalAlignment="Stretch"
IsExpanded="True">
<local:SettingsBlockControl.Icon>
<FontIcon Glyph="" />
</local:SettingsBlockControl.Icon>
<ToggleSwitch
AutomationProperties.Name="{helpers:ResourceString Name=CalculateFolderSizes}"
IsOn="{x:Bind ViewModel.CalculateFolderSizes, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
<local:SettingsBlockControl.ExpandableContent>
<InfoBar
CornerRadius="0,0,2,2"
IsClosable="False"
IsIconVisible="True"
IsOpen="True"
Message="{helpers:ResourceString Name=ShowFolderSizesWarning}"
Severity="Warning" />
</local:SettingsBlockControl.ExpandableContent>
</local:SettingsBlockControl>
</StackPanel>
</Grid>
</Page>