|
7 | 7 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
8 | 8 | xmlns:dataitem="using:Files.App.Data.Items" |
9 | 9 | xmlns:helpers="using:Files.App.Helpers" |
10 | | - xmlns:local="using:Files.App.UserControls.Settings" |
11 | 10 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
12 | | - xmlns:toolkit="using:CommunityToolkit.WinUI.Controls" |
13 | 11 | xmlns:uc="using:Files.App.UserControls" |
14 | 12 | xmlns:vm="using:Files.App.ViewModels.Settings" |
| 13 | + xmlns:wctcontrols="using:CommunityToolkit.WinUI.Controls" |
15 | 14 | xmlns:wctconverters="using:CommunityToolkit.WinUI.Converters" |
16 | 15 | mc:Ignorable="d"> |
17 | 16 |
|
|
100 | 99 | Text="{helpers:ResourceString Name=Appearance}" /> |
101 | 100 |
|
102 | 101 | <!-- Theme --> |
103 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=SettingsAppearanceTheme}" HorizontalAlignment="Stretch"> |
104 | | - <local:SettingsBlockControl.Icon> |
| 102 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=SettingsAppearanceTheme}"> |
| 103 | + <wctcontrols:SettingsCard.HeaderIcon> |
105 | 104 | <FontIcon Glyph="" /> |
106 | | - </local:SettingsBlockControl.Icon> |
| 105 | + </wctcontrols:SettingsCard.HeaderIcon> |
107 | 106 | <uc:ComboBoxEx |
108 | 107 | x:Name="ThemeChooser" |
109 | 108 | AutomationProperties.Name="{helpers:ResourceString Name=SettingsAppearanceTheme}" |
110 | 109 | ItemsSource="{x:Bind ViewModel.Themes, Mode=OneWay}" |
111 | 110 | SelectedIndex="{x:Bind ViewModel.SelectedThemeIndex, Mode=TwoWay}" /> |
112 | | - </local:SettingsBlockControl> |
| 111 | + </wctcontrols:SettingsCard> |
113 | 112 |
|
114 | 113 | <!-- Backdrop Material --> |
115 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=BackdropMaterial}" HorizontalAlignment="Stretch"> |
116 | | - <local:SettingsBlockControl.Icon> |
| 114 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=BackdropMaterial}"> |
| 115 | + <wctcontrols:SettingsCard.HeaderIcon> |
117 | 116 | <FontIcon Glyph="" /> |
118 | | - </local:SettingsBlockControl.Icon> |
| 117 | + </wctcontrols:SettingsCard.HeaderIcon> |
119 | 118 | <uc:ComboBoxEx |
120 | 119 | AutomationProperties.Name="{helpers:ResourceString Name=BackdropMaterial}" |
121 | 120 | ItemsSource="{x:Bind ViewModel.BackdropMaterialTypes.Values}" |
122 | 121 | SelectedItem="{x:Bind ViewModel.SelectedBackdropMaterial, Mode=TwoWay}" /> |
123 | | - </local:SettingsBlockControl> |
| 122 | + </wctcontrols:SettingsCard> |
124 | 123 |
|
125 | 124 | <!-- App Background --> |
126 | | - <local:SettingsBlockControl |
127 | | - Title="{helpers:ResourceString Name=BackgroundColor}" |
| 125 | + <wctcontrols:SettingsExpander |
128 | 126 | HorizontalAlignment="Stretch" |
| 127 | + Header="{helpers:ResourceString Name=BackgroundColor}" |
129 | 128 | IsExpanded="True"> |
130 | | - <local:SettingsBlockControl.Icon> |
| 129 | + <wctcontrols:SettingsExpander.HeaderIcon> |
131 | 130 | <FontIcon Glyph="" /> |
132 | | - </local:SettingsBlockControl.Icon> |
| 131 | + </wctcontrols:SettingsExpander.HeaderIcon> |
133 | 132 | <Button Padding="0" AutomationProperties.Name="{helpers:ResourceString Name=BackgroundColor}"> |
134 | 133 | <StackPanel Orientation="Horizontal"> |
135 | 134 | <Border |
|
150 | 149 | </StackPanel> |
151 | 150 | <Button.Flyout> |
152 | 151 | <Flyout> |
153 | | - <toolkit:ColorPicker |
| 152 | + <wctcontrols:ColorPicker |
154 | 153 | IsAlphaEnabled="True" |
155 | 154 | IsColorSpectrumVisible="False" |
156 | 155 | Color="{x:Bind ViewModel.AppThemeBackgroundColor, Mode=TwoWay}" /> |
157 | 156 | </Flyout> |
158 | 157 | </Button.Flyout> |
159 | 158 | </Button> |
160 | | - <local:SettingsBlockControl.ExpandableContent> |
| 159 | + <wctcontrols:SettingsExpander.Items> |
161 | 160 | <GridView |
162 | 161 | Padding="8" |
163 | 162 | HorizontalAlignment="Stretch" |
164 | 163 | ItemTemplate="{StaticResource AppThemeResourcesItemTemplate}" |
165 | 164 | ItemsSource="{x:Bind ViewModel.AppThemeResources, Mode=OneWay}" |
166 | 165 | SelectedItem="{x:Bind ViewModel.SelectedAppThemeResources, Mode=TwoWay}" /> |
167 | | - </local:SettingsBlockControl.ExpandableContent> |
168 | | - </local:SettingsBlockControl> |
| 166 | + </wctcontrols:SettingsExpander.Items> |
| 167 | + </wctcontrols:SettingsExpander> |
169 | 168 |
|
170 | 169 | <!-- App Background Image --> |
171 | | - <local:SettingsBlockControl |
172 | | - Title="{helpers:ResourceString Name=BackgroundImage}" |
| 170 | + <wctcontrols:SettingsExpander |
173 | 171 | HorizontalAlignment="Stretch" |
174 | 172 | Description="{x:Bind ViewModel.AppThemeBackgroundImageSource, Mode=OneWay}" |
| 173 | + Header="{helpers:ResourceString Name=BackgroundImage}" |
175 | 174 | IsExpanded="False"> |
176 | | - <local:SettingsBlockControl.Icon> |
| 175 | + <wctcontrols:SettingsExpander.HeaderIcon> |
177 | 176 | <FontIcon Glyph="" /> |
178 | | - </local:SettingsBlockControl.Icon> |
| 177 | + </wctcontrols:SettingsExpander.HeaderIcon> |
179 | 178 |
|
180 | 179 | <!-- Browse Button --> |
181 | 180 | <SplitButton |
|
192 | 191 | </SplitButton.Flyout> |
193 | 192 | </SplitButton> |
194 | 193 |
|
195 | | - <local:SettingsBlockControl.ExpandableContent> |
196 | | - <StackPanel> |
197 | | - <!-- Opactiy Slider --> |
198 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=Opacity}" HorizontalAlignment="Stretch"> |
199 | | - <Slider |
200 | | - Width="140" |
201 | | - HorizontalAlignment="Right" |
202 | | - AutomationProperties.Name="{helpers:ResourceString Name=Opacity}" |
203 | | - IsThumbToolTipEnabled="False" |
204 | | - Maximum="1" |
205 | | - Minimum=".1" |
206 | | - StepFrequency=".1" |
207 | | - Value="{x:Bind ViewModel.AppThemeBackgroundImageOpacity, Mode=TwoWay}" /> |
208 | | - </local:SettingsBlockControl> |
| 194 | + <wctcontrols:SettingsExpander.Items> |
| 195 | + <!-- Opactiy Slider --> |
| 196 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=Opacity}"> |
| 197 | + <Slider |
| 198 | + Width="140" |
| 199 | + HorizontalAlignment="Right" |
| 200 | + AutomationProperties.Name="{helpers:ResourceString Name=Opacity}" |
| 201 | + IsThumbToolTipEnabled="False" |
| 202 | + Maximum="1" |
| 203 | + Minimum=".1" |
| 204 | + StepFrequency=".1" |
| 205 | + Value="{x:Bind ViewModel.AppThemeBackgroundImageOpacity, Mode=TwoWay}" /> |
| 206 | + </wctcontrols:SettingsCard> |
209 | 207 |
|
210 | | - <!-- Image Fit --> |
211 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=ImageFit}" HorizontalAlignment="Stretch"> |
212 | | - <uc:ComboBoxEx |
213 | | - MinWidth="140" |
214 | | - AutomationProperties.Name="{helpers:ResourceString Name=ImageFit}" |
215 | | - ItemsSource="{x:Bind ViewModel.ImageStretchTypes.Values}" |
216 | | - SelectedItem="{x:Bind ViewModel.SelectedImageStretchType, Mode=TwoWay}" /> |
217 | | - </local:SettingsBlockControl> |
| 208 | + <!-- Image Fit --> |
| 209 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ImageFit}"> |
| 210 | + <uc:ComboBoxEx |
| 211 | + MinWidth="140" |
| 212 | + AutomationProperties.Name="{helpers:ResourceString Name=ImageFit}" |
| 213 | + ItemsSource="{x:Bind ViewModel.ImageStretchTypes.Values}" |
| 214 | + SelectedItem="{x:Bind ViewModel.SelectedImageStretchType, Mode=TwoWay}" /> |
| 215 | + </wctcontrols:SettingsCard> |
218 | 216 |
|
219 | | - <!-- VerticalAlignment --> |
220 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=VerticalAlignment}" HorizontalAlignment="Stretch"> |
221 | | - <uc:ComboBoxEx |
222 | | - MinWidth="140" |
223 | | - AutomationProperties.Name="{helpers:ResourceString Name=VerticalAlignment}" |
224 | | - ItemsSource="{x:Bind ViewModel.ImageVerticalAlignmentTypes.Values}" |
225 | | - SelectedItem="{x:Bind ViewModel.SelectedImageVerticalAlignmentType, Mode=TwoWay}" /> |
226 | | - </local:SettingsBlockControl> |
| 217 | + <!-- VerticalAlignment --> |
| 218 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=VerticalAlignment}"> |
| 219 | + <uc:ComboBoxEx |
| 220 | + MinWidth="140" |
| 221 | + AutomationProperties.Name="{helpers:ResourceString Name=VerticalAlignment}" |
| 222 | + ItemsSource="{x:Bind ViewModel.ImageVerticalAlignmentTypes.Values}" |
| 223 | + SelectedItem="{x:Bind ViewModel.SelectedImageVerticalAlignmentType, Mode=TwoWay}" /> |
| 224 | + </wctcontrols:SettingsCard> |
227 | 225 |
|
228 | | - <!-- HorizontalAlignment --> |
229 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=HorizontalAlignment}" HorizontalAlignment="Stretch"> |
230 | | - <uc:ComboBoxEx |
231 | | - MinWidth="140" |
232 | | - AutomationProperties.Name="{helpers:ResourceString Name=HorizontalAlignment}" |
233 | | - ItemsSource="{x:Bind ViewModel.ImageHorizontalAlignmentTypes.Values}" |
234 | | - SelectedItem="{x:Bind ViewModel.SelectedImageHorizontalAlignmentType, Mode=TwoWay}" /> |
235 | | - </local:SettingsBlockControl> |
| 226 | + <!-- HorizontalAlignment --> |
| 227 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=HorizontalAlignment}"> |
| 228 | + <uc:ComboBoxEx |
| 229 | + MinWidth="140" |
| 230 | + AutomationProperties.Name="{helpers:ResourceString Name=HorizontalAlignment}" |
| 231 | + ItemsSource="{x:Bind ViewModel.ImageHorizontalAlignmentTypes.Values}" |
| 232 | + SelectedItem="{x:Bind ViewModel.SelectedImageHorizontalAlignmentType, Mode=TwoWay}" /> |
| 233 | + </wctcontrols:SettingsCard> |
236 | 234 |
|
237 | | - </StackPanel> |
238 | | - </local:SettingsBlockControl.ExpandableContent> |
239 | | - </local:SettingsBlockControl> |
| 235 | + </wctcontrols:SettingsExpander.Items> |
| 236 | + </wctcontrols:SettingsExpander> |
240 | 237 |
|
241 | 238 | <!-- Show tab actions --> |
242 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowTabActions}" HorizontalAlignment="Stretch"> |
243 | | - <local:SettingsBlockControl.Icon> |
| 239 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowTabActions}"> |
| 240 | + <wctcontrols:SettingsCard.HeaderIcon> |
244 | 241 | <PathIcon Data="{StaticResource App.Theme.PathIcon.TabActions}" /> |
245 | | - </local:SettingsBlockControl.Icon> |
| 242 | + </wctcontrols:SettingsCard.HeaderIcon> |
246 | 243 | <ToggleSwitch |
247 | 244 | AutomationProperties.AutomationControlType="Custom" |
248 | 245 | AutomationProperties.Name="{helpers:ResourceString Name=ShowTabActions}" |
249 | 246 | IsOn="{x:Bind ViewModel.ShowTabActions, Mode=TwoWay}" |
250 | 247 | Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
251 | | - </local:SettingsBlockControl> |
| 248 | + </wctcontrols:SettingsCard> |
252 | 249 |
|
253 | 250 | <!-- Toolbar --> |
254 | | - <local:SettingsBlockControl |
255 | | - Title="{helpers:ResourceString Name=Toolbars}" |
256 | | - HorizontalAlignment="Stretch" |
257 | | - IsExpanded="False"> |
258 | | - <local:SettingsBlockControl.Icon> |
| 251 | + <wctcontrols:SettingsExpander Header="{helpers:ResourceString Name=Toolbars}"> |
| 252 | + <wctcontrols:SettingsExpander.HeaderIcon> |
259 | 253 | <PathIcon Data="{StaticResource App.Theme.PathIcon.WebAsset}" /> |
260 | | - </local:SettingsBlockControl.Icon> |
| 254 | + </wctcontrols:SettingsExpander.HeaderIcon> |
261 | 255 |
|
262 | | - <local:SettingsBlockControl.ExpandableContent> |
263 | | - <StackPanel> |
264 | | - <!-- Show home button --> |
265 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowHomeButton}" HorizontalAlignment="Stretch"> |
266 | | - <ToggleSwitch |
267 | | - AutomationProperties.AutomationControlType="Custom" |
268 | | - AutomationProperties.Name="{helpers:ResourceString Name=ShowHomeButton}" |
269 | | - IsOn="{x:Bind ViewModel.ShowHomeButton, Mode=TwoWay}" |
270 | | - Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
271 | | - </local:SettingsBlockControl> |
| 256 | + <wctcontrols:SettingsExpander.Items> |
| 257 | + <!-- Show home button --> |
| 258 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowHomeButton}"> |
| 259 | + <ToggleSwitch |
| 260 | + AutomationProperties.AutomationControlType="Custom" |
| 261 | + AutomationProperties.Name="{helpers:ResourceString Name=ShowHomeButton}" |
| 262 | + IsOn="{x:Bind ViewModel.ShowHomeButton, Mode=TwoWay}" |
| 263 | + Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
| 264 | + </wctcontrols:SettingsCard> |
272 | 265 |
|
273 | | - <!-- Show shelf pane toggle button --> |
274 | | - <local:SettingsBlockControl |
275 | | - x:Name="ShowShelfPaneSetting" |
276 | | - Title="{helpers:ResourceString Name=ShowShelfPaneButtonInAddressBar}" |
277 | | - HorizontalAlignment="Stretch" |
278 | | - x:Load="{x:Bind ViewModel.IsAppEnvironmentDev}"> |
279 | | - <ToggleSwitch |
280 | | - AutomationProperties.Name="{helpers:ResourceString Name=ShowShelfPaneButtonInAddressBar}" |
281 | | - IsOn="{x:Bind ViewModel.ShowShelfPaneToggleButton, Mode=TwoWay}" |
282 | | - Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
283 | | - </local:SettingsBlockControl> |
| 266 | + <!-- Show shelf pane toggle button --> |
| 267 | + <wctcontrols:SettingsCard |
| 268 | + x:Name="ShowShelfPaneSetting" |
| 269 | + Visibility="{x:Bind ViewModel.IsAppEnvironmentDev, Mode=OneTime}" |
| 270 | + Header="{helpers:ResourceString Name=ShowShelfPaneButtonInAddressBar}"> |
| 271 | + <ToggleSwitch |
| 272 | + AutomationProperties.Name="{helpers:ResourceString Name=ShowShelfPaneButtonInAddressBar}" |
| 273 | + IsOn="{x:Bind ViewModel.ShowShelfPaneToggleButton, Mode=TwoWay}" |
| 274 | + Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
| 275 | + </wctcontrols:SettingsCard> |
284 | 276 |
|
285 | | - <!-- Show toolbar --> |
286 | | - <local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowToolbar}" HorizontalAlignment="Stretch"> |
287 | | - <ToggleSwitch |
288 | | - AutomationProperties.Name="{helpers:ResourceString Name=ShowToolbar}" |
289 | | - IsOn="{x:Bind ViewModel.ShowToolbar, Mode=TwoWay}" |
290 | | - Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
291 | | - </local:SettingsBlockControl> |
292 | | - </StackPanel> |
293 | | - </local:SettingsBlockControl.ExpandableContent> |
294 | | - </local:SettingsBlockControl> |
| 277 | + <!-- Show toolbar --> |
| 278 | + <wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowToolbar}"> |
| 279 | + <ToggleSwitch |
| 280 | + AutomationProperties.Name="{helpers:ResourceString Name=ShowToolbar}" |
| 281 | + IsOn="{x:Bind ViewModel.ShowToolbar, Mode=TwoWay}" |
| 282 | + Style="{StaticResource RightAlignedToggleSwitchStyle}" /> |
| 283 | + </wctcontrols:SettingsCard> |
| 284 | + </wctcontrols:SettingsExpander.Items> |
| 285 | + </wctcontrols:SettingsExpander> |
295 | 286 | </StackPanel> |
296 | 287 | </Grid> |
297 | 288 | </Page> |
0 commit comments