Skip to content

Commit 3370aa6

Browse files
committed
Folders Page
1 parent fa0341b commit 3370aa6

File tree

1 file changed

+103
-110
lines changed

1 file changed

+103
-110
lines changed

src/Files.App/Views/Settings/FoldersPage.xaml

Lines changed: 103 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
66
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
77
xmlns:helpers="using:Files.App.Helpers"
8-
xmlns:local="using:Files.App.UserControls.Settings"
98
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
109
xmlns:uc="using:Files.App.UserControls"
1110
xmlns:vm="using:Files.App.ViewModels.Settings"
11+
xmlns:wctcontrols="using:CommunityToolkit.WinUI.Controls"
1212
mc:Ignorable="d">
1313

1414
<Page.Resources>
@@ -40,79 +40,77 @@
4040
Text="{helpers:ResourceString Name=Display}" />
4141

4242
<!-- Hidden Items -->
43-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=HiddenItems}" HorizontalAlignment="Stretch">
44-
<local:SettingsBlockControl.Icon>
43+
<wctcontrols:SettingsExpander Header="{helpers:ResourceString Name=HiddenItems}">
44+
<wctcontrols:SettingsExpander.HeaderIcon>
4545
<FontIcon Glyph="&#xED1A;" />
46-
</local:SettingsBlockControl.Icon>
47-
<local:SettingsBlockControl.ExpandableContent>
48-
<StackPanel>
49-
<!-- Hidden Files -->
50-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=SettingsFilesAndFoldersShowHiddenItems}" HorizontalAlignment="Stretch">
51-
<ToggleSwitch
52-
AutomationProperties.Name="{helpers:ResourceString Name=SettingsFilesAndFoldersShowHiddenItems}"
53-
IsOn="{x:Bind ViewModel.ShowHiddenItems, Mode=TwoWay}"
54-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
55-
</local:SettingsBlockControl>
56-
57-
<!-- Dots Files -->
58-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowDotFiles}" HorizontalAlignment="Stretch">
59-
<ToggleSwitch
60-
AutomationProperties.Name="{helpers:ResourceString Name=ShowDotFiles}"
61-
IsOn="{x:Bind ViewModel.ShowDotFiles, Mode=TwoWay}"
62-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
63-
</local:SettingsBlockControl>
64-
65-
<!-- System Files -->
66-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowProtectedSystemFiles}" HorizontalAlignment="Stretch">
67-
<ToggleSwitch
68-
AutomationProperties.Name="{helpers:ResourceString Name=ShowProtectedSystemFiles}"
69-
IsOn="{x:Bind ViewModel.ShowProtectedSystemFiles, Mode=TwoWay}"
70-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
71-
</local:SettingsBlockControl>
72-
73-
<!-- Alternate Data Streams -->
74-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowAlternateStreams}" HorizontalAlignment="Stretch">
75-
<ToggleSwitch
76-
AutomationProperties.Name="{helpers:ResourceString Name=ShowAlternateStreams}"
77-
IsOn="{x:Bind ViewModel.AreAlternateStreamsVisible, Mode=TwoWay}"
78-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
79-
</local:SettingsBlockControl>
80-
</StackPanel>
81-
</local:SettingsBlockControl.ExpandableContent>
82-
</local:SettingsBlockControl>
46+
</wctcontrols:SettingsExpander.HeaderIcon>
47+
<wctcontrols:SettingsExpander.Items>
48+
<!-- Hidden Files -->
49+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SettingsFilesAndFoldersShowHiddenItems}">
50+
<ToggleSwitch
51+
AutomationProperties.Name="{helpers:ResourceString Name=SettingsFilesAndFoldersShowHiddenItems}"
52+
IsOn="{x:Bind ViewModel.ShowHiddenItems, Mode=TwoWay}"
53+
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
54+
</wctcontrols:SettingsCard>
55+
56+
<!-- Dots Files -->
57+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowDotFiles}">
58+
<ToggleSwitch
59+
AutomationProperties.Name="{helpers:ResourceString Name=ShowDotFiles}"
60+
IsOn="{x:Bind ViewModel.ShowDotFiles, Mode=TwoWay}"
61+
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
62+
</wctcontrols:SettingsCard>
63+
64+
<!-- System Files -->
65+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowProtectedSystemFiles}">
66+
<ToggleSwitch
67+
AutomationProperties.Name="{helpers:ResourceString Name=ShowProtectedSystemFiles}"
68+
IsOn="{x:Bind ViewModel.ShowProtectedSystemFiles, Mode=TwoWay}"
69+
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
70+
</wctcontrols:SettingsCard>
71+
72+
<!-- Alternate Data Streams -->
73+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowAlternateStreams}">
74+
<ToggleSwitch
75+
AutomationProperties.Name="{helpers:ResourceString Name=ShowAlternateStreams}"
76+
IsOn="{x:Bind ViewModel.AreAlternateStreamsVisible, Mode=TwoWay}"
77+
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
78+
</wctcontrols:SettingsCard>
79+
</wctcontrols:SettingsExpander.Items>
80+
</wctcontrols:SettingsExpander>
8381

8482
<!-- File Extensions -->
85-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=SettingsFilesAndFoldersShowFileExtensions}" HorizontalAlignment="Stretch">
86-
<local:SettingsBlockControl.Icon>
83+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SettingsFilesAndFoldersShowFileExtensions}">
84+
<wctcontrols:SettingsCard.HeaderIcon>
8785
<FontIcon Glyph="&#xE8F9;" />
88-
</local:SettingsBlockControl.Icon>
86+
</wctcontrols:SettingsCard.HeaderIcon>
8987
<ToggleSwitch
9088
AutomationProperties.Name="{helpers:ResourceString Name=SettingsFilesAndFoldersShowFileExtensions}"
9189
IsOn="{x:Bind ViewModel.ShowFileExtensions, Mode=TwoWay}"
9290
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
93-
</local:SettingsBlockControl>
91+
</wctcontrols:SettingsCard>
9492

9593
<!-- Show Thumbnails -->
96-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=SettingsFilesAndFoldersShowThumbnails}" HorizontalAlignment="Stretch">
97-
<local:SettingsBlockControl.Icon>
94+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SettingsFilesAndFoldersShowThumbnails}">
95+
<wctcontrols:SettingsCard.HeaderIcon>
9896
<FontIcon Glyph="&#xE91B;" />
99-
</local:SettingsBlockControl.Icon>
97+
</wctcontrols:SettingsCard.HeaderIcon>
10098
<ToggleSwitch
10199
AutomationProperties.Name="{helpers:ResourceString Name=SettingsFilesAndFoldersShowThumbnails}"
102100
IsOn="{x:Bind ViewModel.ShowThumbnails, Mode=TwoWay}"
103101
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
104-
</local:SettingsBlockControl>
102+
</wctcontrols:SettingsCard>
105103

106104
<!-- Show Checkboxes When Selecting Items -->
107-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowCheckboxesWhenSelectingItems}" HorizontalAlignment="Stretch">
108-
<local:SettingsBlockControl.Icon>
105+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowCheckboxesWhenSelectingItems}">
106+
<wctcontrols:SettingsCard.HeaderIcon>
109107
<FontIcon Glyph="&#xE73A;" />
110-
</local:SettingsBlockControl.Icon>
108+
</wctcontrols:SettingsCard.HeaderIcon>
111109
<ToggleSwitch
112110
AutomationProperties.Name="{helpers:ResourceString Name=ShowCheckboxesWhenSelectingItems}"
113111
IsOn="{x:Bind ViewModel.ShowCheckboxesWhenSelectingItems, Mode=TwoWay}"
114112
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
115-
</local:SettingsBlockControl>
113+
</wctcontrols:SettingsCard>
116114

117115
<!-- Behaviors -->
118116
<TextBlock
@@ -122,120 +120,115 @@
122120
Text="{helpers:ResourceString Name=Behaviors}" />
123121

124122
<!-- Opening items -->
125-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=OpeningItems}" HorizontalAlignment="Stretch">
126-
<local:SettingsBlockControl.Icon>
123+
<wctcontrols:SettingsExpander Header="{helpers:ResourceString Name=OpeningItems}">
124+
<wctcontrols:SettingsExpander.HeaderIcon>
127125
<FontIcon Glyph="&#xED25;" />
128-
</local:SettingsBlockControl.Icon>
129-
<local:SettingsBlockControl.ExpandableContent>
130-
<StackPanel>
131-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=SettingsOpenItemsWithOneClick}" HorizontalAlignment="Stretch">
132-
<ToggleSwitch
133-
AutomationProperties.Name="{helpers:ResourceString Name=SettingsOpenItemsWithOneClick}"
134-
IsOn="{x:Bind ViewModel.OpenItemsWithOneClick, Mode=TwoWay}"
135-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
136-
</local:SettingsBlockControl>
137-
138-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=OpenFolderWithOneClickColumnsLayout}" HorizontalAlignment="Stretch">
139-
<ToggleSwitch
140-
AutomationProperties.Name="{helpers:ResourceString Name=OpenFolderWithOneClickColumnsLayout}"
141-
IsOn="{x:Bind ViewModel.ColumnLayoutOpenFoldersWithOneClick, Mode=TwoWay}"
142-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
143-
</local:SettingsBlockControl>
144-
145-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=OpenFoldersInNewTab}" HorizontalAlignment="Stretch">
146-
<ToggleSwitch
147-
x:Name="OpenFoldersNewTab"
148-
AutomationProperties.Name="{helpers:ResourceString Name=OpenFoldersInNewTab}"
149-
IsOn="{x:Bind ViewModel.OpenFoldersNewTab, Mode=TwoWay}"
150-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
151-
</local:SettingsBlockControl>
152-
</StackPanel>
153-
</local:SettingsBlockControl.ExpandableContent>
154-
</local:SettingsBlockControl>
126+
</wctcontrols:SettingsExpander.HeaderIcon>
127+
<wctcontrols:SettingsExpander.Items>
128+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SettingsOpenItemsWithOneClick}">
129+
<ToggleSwitch
130+
AutomationProperties.Name="{helpers:ResourceString Name=SettingsOpenItemsWithOneClick}"
131+
IsOn="{x:Bind ViewModel.OpenItemsWithOneClick, Mode=TwoWay}"
132+
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
133+
</wctcontrols:SettingsCard>
134+
135+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=OpenFolderWithOneClickColumnsLayout}">
136+
<ToggleSwitch
137+
AutomationProperties.Name="{helpers:ResourceString Name=OpenFolderWithOneClickColumnsLayout}"
138+
IsOn="{x:Bind ViewModel.ColumnLayoutOpenFoldersWithOneClick, Mode=TwoWay}"
139+
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
140+
</wctcontrols:SettingsCard>
141+
142+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=OpenFoldersInNewTab}">
143+
<ToggleSwitch
144+
x:Name="OpenFoldersNewTab"
145+
AutomationProperties.Name="{helpers:ResourceString Name=OpenFoldersInNewTab}"
146+
IsOn="{x:Bind ViewModel.OpenFoldersNewTab, Mode=TwoWay}"
147+
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
148+
</wctcontrols:SettingsCard>
149+
</wctcontrols:SettingsExpander.Items>
150+
</wctcontrols:SettingsExpander>
155151

156152
<!-- Confirm Delete -->
157-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowConfirmationWhenDeletingItems}" HorizontalAlignment="Stretch">
158-
<local:SettingsBlockControl.Icon>
153+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowConfirmationWhenDeletingItems}">
154+
<wctcontrols:SettingsCard.HeaderIcon>
159155
<FontIcon Glyph="&#xE74D;" />
160-
</local:SettingsBlockControl.Icon>
156+
</wctcontrols:SettingsCard.HeaderIcon>
161157

162158
<uc:ComboBoxEx AutomationProperties.Name="{helpers:ResourceString Name=ShowConfirmationWhenDeletingItems}" SelectedIndex="{x:Bind ViewModel.SelectedDeleteConfirmationPolicyIndex, Mode=TwoWay}">
163159
<ComboBoxItem Content="{helpers:ResourceString Name=Always}" />
164160
<ComboBoxItem Content="{helpers:ResourceString Name=PermanentDeletionOnly}" />
165161
<ComboBoxItem Content="{helpers:ResourceString Name=Never}" />
166162
</uc:ComboBoxEx>
167-
</local:SettingsBlockControl>
163+
</wctcontrols:SettingsCard>
168164

169165
<!-- File Extension Warning -->
170-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowFileExtensionWarning}" HorizontalAlignment="Stretch">
171-
<local:SettingsBlockControl.Icon>
166+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowFileExtensionWarning}">
167+
<wctcontrols:SettingsCard.HeaderIcon>
172168
<FontIcon Glyph="&#xE8AC;" />
173-
</local:SettingsBlockControl.Icon>
169+
</wctcontrols:SettingsCard.HeaderIcon>
174170

175171
<ToggleSwitch
176172
AutomationProperties.Name="{helpers:ResourceString Name=ShowFileExtensionWarning}"
177173
IsOn="{x:Bind ViewModel.ShowFileExtensionWarning, Mode=TwoWay}"
178174
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
179-
</local:SettingsBlockControl>
175+
</wctcontrols:SettingsCard>
180176

181177
<!-- Select On Hover -->
182-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=SelectFilesAndFoldersOnHover}" HorizontalAlignment="Stretch">
183-
<local:SettingsBlockControl.Icon>
178+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SelectFilesAndFoldersOnHover}">
179+
<wctcontrols:SettingsCard.HeaderIcon>
184180
<FontIcon Glyph="&#xE8B3;" />
185-
</local:SettingsBlockControl.Icon>
181+
</wctcontrols:SettingsCard.HeaderIcon>
186182

187183
<ToggleSwitch
188184
AutomationProperties.Name="{helpers:ResourceString Name=SelectFilesAndFoldersOnHover}"
189185
IsOn="{x:Bind ViewModel.SelectFilesOnHover, Mode=TwoWay}"
190186
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
191-
</local:SettingsBlockControl>
187+
</wctcontrols:SettingsCard>
192188

193189
<!-- Double click to go up -->
194-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=DoubleClickBlankSpaceToGoUp}" HorizontalAlignment="Stretch">
195-
<local:SettingsBlockControl.Icon>
190+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=DoubleClickBlankSpaceToGoUp}">
191+
<wctcontrols:SettingsCard.HeaderIcon>
196192
<FontIcon Glyph="&#xE8B0;" />
197-
</local:SettingsBlockControl.Icon>
193+
</wctcontrols:SettingsCard.HeaderIcon>
198194

199195
<ToggleSwitch
200196
AutomationProperties.Name="{helpers:ResourceString Name=DoubleClickBlankSpaceToGoUp}"
201197
IsOn="{x:Bind ViewModel.DoubleClickToGoUp, Mode=TwoWay}"
202198
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
203-
</local:SettingsBlockControl>
199+
</wctcontrols:SettingsCard>
204200

205201
<!-- Scroll to parent folder when navigating up -->
206-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=ScrollToPreviousFolderWhenNavigatingUp}" HorizontalAlignment="Stretch">
207-
<local:SettingsBlockControl.Icon>
202+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ScrollToPreviousFolderWhenNavigatingUp}">
203+
<wctcontrols:SettingsCard.HeaderIcon>
208204
<FontIcon Glyph="&#xECE7;" />
209-
</local:SettingsBlockControl.Icon>
205+
</wctcontrols:SettingsCard.HeaderIcon>
210206

211207
<ToggleSwitch
212208
AutomationProperties.Name="{helpers:ResourceString Name=ScrollToPreviousFolderWhenNavigatingUp}"
213209
IsOn="{x:Bind ViewModel.ScrollToPreviousFolderWhenNavigatingUp, Mode=TwoWay}"
214210
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
215-
</local:SettingsBlockControl>
211+
</wctcontrols:SettingsCard>
216212

217213
<!-- Calculate folder sizes -->
218-
<local:SettingsBlockControl
219-
Title="{helpers:ResourceString Name=CalculateFolderSizes}"
220-
HorizontalAlignment="Stretch"
221-
IsExpanded="True">
222-
<local:SettingsBlockControl.Icon>
214+
<wctcontrols:SettingsExpander Header="{helpers:ResourceString Name=CalculateFolderSizes}" IsExpanded="True">
215+
<wctcontrols:SettingsExpander.HeaderIcon>
223216
<FontIcon Glyph="&#xEE40;" />
224-
</local:SettingsBlockControl.Icon>
217+
</wctcontrols:SettingsExpander.HeaderIcon>
225218
<ToggleSwitch
226219
AutomationProperties.Name="{helpers:ResourceString Name=CalculateFolderSizes}"
227220
IsOn="{x:Bind ViewModel.CalculateFolderSizes, Mode=TwoWay}"
228221
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
229-
<local:SettingsBlockControl.ExpandableContent>
222+
<wctcontrols:SettingsExpander.Items>
230223
<InfoBar
231224
CornerRadius="0,0,2,2"
232225
IsClosable="False"
233226
IsIconVisible="True"
234227
IsOpen="True"
235228
Message="{helpers:ResourceString Name=ShowFolderSizesWarning}"
236229
Severity="Warning" />
237-
</local:SettingsBlockControl.ExpandableContent>
238-
</local:SettingsBlockControl>
230+
</wctcontrols:SettingsExpander.Items>
231+
</wctcontrols:SettingsExpander>
239232
</StackPanel>
240233
</Grid>
241234
</Page>

0 commit comments

Comments
 (0)