Skip to content

Commit bf38b4b

Browse files
committed
Setting pages
1 parent 28a14e6 commit bf38b4b

File tree

8 files changed

+738
-787
lines changed

8 files changed

+738
-787
lines changed

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

Lines changed: 123 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
88
xmlns:dataitems="using:Files.App.Data.Items"
99
xmlns:helpers="using:Files.App.Helpers"
10-
xmlns:local="using:Files.App.UserControls.Settings"
1110
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
1211
xmlns:vm="using:Files.App.ViewModels.Settings"
12+
xmlns:wctcontrols="using:CommunityToolkit.WinUI.Controls"
1313
mc:Ignorable="d">
1414

1515
<Page.DataContext>
@@ -30,13 +30,13 @@
3030
Text="{helpers:ResourceString Name=About}" />
3131

3232
<!-- App Info -->
33-
<local:SettingsBlockControl
34-
Title="{x:Bind ViewModel.AppName}"
33+
<wctcontrols:SettingsCard
3534
HorizontalAlignment="Stretch"
36-
Description="{x:Bind ViewModel.Version}">
37-
<local:SettingsBlockControl.Icon>
35+
Description="{x:Bind ViewModel.Version}"
36+
Header="{x:Bind ViewModel.AppName}">
37+
<wctcontrols:SettingsCard.HeaderIcon>
3838
<FontIcon Glyph="&#xE946;" />
39-
</local:SettingsBlockControl.Icon>
39+
</wctcontrols:SettingsCard.HeaderIcon>
4040
<Button x:Name="CopyVersionInfo" Content="{helpers:ResourceString Name=Copy}">
4141
<Button.Flyout>
4242
<MenuFlyout>
@@ -46,22 +46,21 @@
4646
</MenuFlyout>
4747
</Button.Flyout>
4848
</Button>
49-
</local:SettingsBlockControl>
49+
</wctcontrols:SettingsCard>
5050

5151
<!-- GitHub Sponsor -->
52-
<local:SettingsBlockControl
53-
Title="{helpers:ResourceString Name=SponsorUsOnGitHub}"
54-
ButtonCommand="{x:Bind ViewModel.SupportUsCommand}"
55-
IsClickable="True">
56-
<local:SettingsBlockControl.Icon>
52+
<wctcontrols:SettingsCard
53+
Command="{x:Bind ViewModel.SupportUsCommand}"
54+
Header="{helpers:ResourceString Name=SponsorUsOnGitHub}"
55+
IsClickEnabled="True">
56+
<wctcontrols:SettingsCard.HeaderIcon>
5757
<FontIcon Glyph="&#xEB51;" />
58-
</local:SettingsBlockControl.Icon>
58+
</wctcontrols:SettingsCard.HeaderIcon>
5959

60-
<FontIcon
61-
FontSize="14"
62-
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
63-
Glyph="&#xE8A7;" />
64-
</local:SettingsBlockControl>
60+
<wctcontrols:SettingsCard.ActionIcon>
61+
<FontIcon Glyph="&#xE8A7;" />
62+
</wctcontrols:SettingsCard.ActionIcon>
63+
</wctcontrols:SettingsCard>
6564

6665

6766
<!-- Help and support -->
@@ -72,86 +71,79 @@
7271
Text="{helpers:ResourceString Name=HelpAndSupport}" />
7372

7473
<!-- Documentation -->
75-
<local:SettingsBlockControl
76-
Title="{helpers:ResourceString Name=Documentation}"
74+
<wctcontrols:SettingsCard
7775
HorizontalAlignment="Stretch"
78-
ButtonCommand="{x:Bind ViewModel.OpenDocumentationCommand}"
79-
IsClickable="True">
80-
<local:SettingsBlockControl.Icon>
76+
Command="{x:Bind ViewModel.OpenDocumentationCommand}"
77+
Header="{helpers:ResourceString Name=Documentation}"
78+
IsClickEnabled="True">
79+
<wctcontrols:SettingsCard.HeaderIcon>
8180
<FontIcon Glyph="&#xE736;" />
82-
</local:SettingsBlockControl.Icon>
81+
</wctcontrols:SettingsCard.HeaderIcon>
8382

84-
<FontIcon
85-
FontSize="14"
86-
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
87-
Glyph="&#xE8A7;" />
88-
</local:SettingsBlockControl>
83+
<wctcontrols:SettingsCard.ActionIcon>
84+
<FontIcon Glyph="&#xE8A7;" />
85+
</wctcontrols:SettingsCard.ActionIcon>
86+
</wctcontrols:SettingsCard>
8987

9088
<!-- Questions & discussions -->
91-
<local:SettingsBlockControl
92-
Title="{helpers:ResourceString Name=QuestionsAndDiscussions}"
89+
<wctcontrols:SettingsCard
9390
HorizontalAlignment="Stretch"
94-
ButtonCommand="{x:Bind ViewModel.OpenDiscordCommand}"
95-
IsClickable="True">
96-
<local:SettingsBlockControl.Icon>
91+
Command="{x:Bind ViewModel.OpenDiscordCommand}"
92+
Header="{helpers:ResourceString Name=QuestionsAndDiscussions}"
93+
IsClickEnabled="True">
94+
<wctcontrols:SettingsCard.HeaderIcon>
9795
<FontIcon Glyph="&#xE8F2;" />
98-
</local:SettingsBlockControl.Icon>
96+
</wctcontrols:SettingsCard.HeaderIcon>
9997

100-
<FontIcon
101-
FontSize="14"
102-
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
103-
Glyph="&#xE8A7;" />
104-
</local:SettingsBlockControl>
98+
<wctcontrols:SettingsCard.ActionIcon>
99+
<FontIcon Glyph="&#xE8A7;" />
100+
</wctcontrols:SettingsCard.ActionIcon>
101+
</wctcontrols:SettingsCard>
105102

106103
<!-- Feedback -->
107-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=Feedback}" HorizontalAlignment="Stretch">
108-
<local:SettingsBlockControl.Icon>
104+
<wctcontrols:SettingsExpander HorizontalAlignment="Stretch" Header="{helpers:ResourceString Name=Feedback}">
105+
<wctcontrols:SettingsExpander.HeaderIcon>
109106
<FontIcon Glyph="&#xED15;" />
110-
</local:SettingsBlockControl.Icon>
111-
<local:SettingsBlockControl.ExpandableContent>
112-
<StackPanel>
113-
<!-- Submit feature request -->
114-
<local:SettingsBlockControl
115-
Title="{helpers:ResourceString Name=SubmitFeatureRequest}"
116-
HorizontalAlignment="Stretch"
117-
ButtonCommand="{x:Bind ViewModel.SubmitFeatureRequestCommand}"
118-
IsClickable="True">
119-
<FontIcon
120-
FontSize="14"
121-
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
122-
Glyph="&#xE8A7;" />
123-
</local:SettingsBlockControl>
124-
125-
<!-- Submit bug report -->
126-
<local:SettingsBlockControl
127-
Title="{helpers:ResourceString Name=SubmitBugReport}"
128-
HorizontalAlignment="Stretch"
129-
ButtonCommand="{x:Bind ViewModel.SubmitBugReportCommand}"
130-
IsClickable="True">
131-
<FontIcon
132-
FontSize="14"
133-
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
134-
Glyph="&#xE8A7;" />
135-
</local:SettingsBlockControl>
136-
</StackPanel>
137-
</local:SettingsBlockControl.ExpandableContent>
138-
</local:SettingsBlockControl>
107+
</wctcontrols:SettingsExpander.HeaderIcon>
108+
<wctcontrols:SettingsExpander.Items>
109+
<!-- Submit feature request -->
110+
<wctcontrols:SettingsCard
111+
HorizontalAlignment="Stretch"
112+
Command="{x:Bind ViewModel.SubmitFeatureRequestCommand}"
113+
Header="{helpers:ResourceString Name=SubmitFeatureRequest}"
114+
IsClickEnabled="True">
115+
<wctcontrols:SettingsCard.ActionIcon>
116+
<FontIcon Glyph="&#xE8A7;" />
117+
</wctcontrols:SettingsCard.ActionIcon>
118+
</wctcontrols:SettingsCard>
119+
120+
<!-- Submit bug report -->
121+
<wctcontrols:SettingsCard
122+
HorizontalAlignment="Stretch"
123+
Command="{x:Bind ViewModel.SubmitBugReportCommand}"
124+
Header="{helpers:ResourceString Name=SubmitBugReport}"
125+
IsClickEnabled="True">
126+
<wctcontrols:SettingsCard.ActionIcon>
127+
<FontIcon Glyph="&#xE8A7;" />
128+
</wctcontrols:SettingsCard.ActionIcon>
129+
</wctcontrols:SettingsCard>
130+
</wctcontrols:SettingsExpander.Items>
131+
</wctcontrols:SettingsExpander>
139132

140133
<!-- Open Log File Location -->
141-
<local:SettingsBlockControl
142-
Title="{helpers:ResourceString Name=OpenLogLocation}"
134+
<wctcontrols:SettingsCard
143135
HorizontalAlignment="Stretch"
144-
ButtonCommand="{x:Bind ViewModel.OpenLogLocationCommand}"
145-
IsClickable="True">
146-
<local:SettingsBlockControl.Icon>
136+
Command="{x:Bind ViewModel.OpenLogLocationCommand}"
137+
Header="{helpers:ResourceString Name=OpenLogLocation}"
138+
IsClickEnabled="True">
139+
<wctcontrols:SettingsCard.HeaderIcon>
147140
<FontIcon Glyph="&#xE838;" />
148-
</local:SettingsBlockControl.Icon>
141+
</wctcontrols:SettingsCard.HeaderIcon>
149142

150-
<FontIcon
151-
FontSize="14"
152-
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
153-
Glyph="&#xE8A7;" />
154-
</local:SettingsBlockControl>
143+
<wctcontrols:SettingsCard.ActionIcon>
144+
<FontIcon Glyph="&#xE8A7;" />
145+
</wctcontrols:SettingsCard.ActionIcon>
146+
</wctcontrols:SettingsCard>
155147

156148

157149
<!-- Open Source -->
@@ -162,81 +154,80 @@
162154
Text="{helpers:ResourceString Name=OpenSource}" />
163155

164156
<!-- Translate -->
165-
<local:SettingsBlockControl
166-
Title="{helpers:ResourceString Name=ImproveTranslation}"
157+
<wctcontrols:SettingsCard
167158
HorizontalAlignment="Stretch"
168-
ButtonCommand="{x:Bind ViewModel.OpenCrowdinCommand}"
169-
IsClickable="True">
170-
<local:SettingsBlockControl.Icon>
159+
Command="{x:Bind ViewModel.OpenCrowdinCommand}"
160+
Header="{helpers:ResourceString Name=ImproveTranslation}"
161+
IsClickEnabled="True">
162+
<wctcontrols:SettingsCard.HeaderIcon>
171163
<FontIcon Glyph="&#xF2B7;" />
172-
</local:SettingsBlockControl.Icon>
164+
</wctcontrols:SettingsCard.HeaderIcon>
173165

174-
<FontIcon
175-
FontSize="14"
176-
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
177-
Glyph="&#xE8A7;" />
178-
</local:SettingsBlockControl>
166+
<wctcontrols:SettingsCard.ActionIcon>
167+
<FontIcon Glyph="&#xE8A7;" />
168+
</wctcontrols:SettingsCard.ActionIcon>
169+
</wctcontrols:SettingsCard>
179170

180171
<!-- Third Party Licenses -->
181-
<local:SettingsBlockControl Title="{helpers:ResourceString Name=ThirdPartyLibraries}">
182-
<local:SettingsBlockControl.Icon>
172+
<wctcontrols:SettingsExpander Header="{helpers:ResourceString Name=ThirdPartyLibraries}">
173+
<wctcontrols:SettingsExpander.HeaderIcon>
183174
<FontIcon Glyph="&#xE90F;" />
184-
</local:SettingsBlockControl.Icon>
185-
<local:SettingsBlockControl.ExpandableContent>
186-
<ItemsRepeater Margin="54,12,12,12" ItemsSource="{x:Bind ViewModel.OpenSourceLibraries, Mode=OneWay}">
187-
<ItemsRepeater.ItemTemplate>
188-
<DataTemplate x:DataType="dataitems:OpenSourceLibraryItem">
189-
<TextBlock Margin="4,0" VerticalAlignment="Center">
175+
</wctcontrols:SettingsExpander.HeaderIcon>
176+
<wctcontrols:SettingsExpander.Items>
177+
<wctcontrols:SettingsCard>
178+
<ItemsRepeater Margin="0,12,0,12" ItemsSource="{x:Bind ViewModel.OpenSourceLibraries, Mode=OneWay}">
179+
<ItemsRepeater.ItemTemplate>
180+
<DataTemplate x:DataType="dataitems:OpenSourceLibraryItem">
181+
<TextBlock Margin="4,0" VerticalAlignment="Center">
190182
<Hyperlink NavigateUri="{x:Bind Url}" UnderlineStyle="None">
191183
<Run Text="{x:Bind Name}" />
192184
</Hyperlink>
193-
</TextBlock>
194-
</DataTemplate>
195-
</ItemsRepeater.ItemTemplate>
196-
<ItemsRepeater.Layout>
197-
<UniformGridLayout
185+
</TextBlock>
186+
</DataTemplate>
187+
</ItemsRepeater.ItemTemplate>
188+
<ItemsRepeater.Layout>
189+
<UniformGridLayout
198190
ItemsStretch="Fill"
199191
MaximumRowsOrColumns="6"
200192
MinColumnSpacing="8"
201193
MinItemWidth="200"
202194
MinRowSpacing="8"
203195
Orientation="Horizontal" />
204-
</ItemsRepeater.Layout>
205-
</ItemsRepeater>
206-
</local:SettingsBlockControl.ExpandableContent>
207-
</local:SettingsBlockControl>
196+
</ItemsRepeater.Layout>
197+
</ItemsRepeater>
198+
</wctcontrols:SettingsCard>
199+
</wctcontrols:SettingsExpander.Items>
200+
</wctcontrols:SettingsExpander>
208201

209202
<!-- Open GitHub repo -->
210-
<local:SettingsBlockControl
211-
Title="{helpers:ResourceString Name=OpenGitHubRepo}"
203+
<wctcontrols:SettingsCard
212204
HorizontalAlignment="Stretch"
213-
ButtonCommand="{x:Bind ViewModel.OpenGitHubRepoCommand}"
214-
IsClickable="True">
215-
<local:SettingsBlockControl.Icon>
205+
Command="{x:Bind ViewModel.OpenGitHubRepoCommand}"
206+
Header="{helpers:ResourceString Name=OpenGitHubRepo}"
207+
IsClickEnabled="True">
208+
<wctcontrols:SettingsCard.HeaderIcon>
216209
<FontIcon Glyph="&#xE774;" />
217-
</local:SettingsBlockControl.Icon>
210+
</wctcontrols:SettingsCard.HeaderIcon>
218211

219-
<FontIcon
220-
FontSize="14"
221-
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
222-
Glyph="&#xE8A7;" />
223-
</local:SettingsBlockControl>
212+
<wctcontrols:SettingsCard.ActionIcon>
213+
<FontIcon Glyph="&#xE8A7;" />
214+
</wctcontrols:SettingsCard.ActionIcon>
215+
</wctcontrols:SettingsCard>
224216

225217
<!-- Privacy -->
226-
<local:SettingsBlockControl
227-
Title="{helpers:ResourceString Name=Privacy}"
218+
<wctcontrols:SettingsCard
228219
HorizontalAlignment="Stretch"
229-
ButtonCommand="{x:Bind ViewModel.OpenPrivacyPolicyCommand}"
230-
IsClickable="True">
231-
<local:SettingsBlockControl.Icon>
220+
Command="{x:Bind ViewModel.OpenPrivacyPolicyCommand}"
221+
Header="{helpers:ResourceString Name=Privacy}"
222+
IsClickEnabled="True">
223+
<wctcontrols:SettingsCard.HeaderIcon>
232224
<FontIcon Glyph="&#xE72E;" />
233-
</local:SettingsBlockControl.Icon>
225+
</wctcontrols:SettingsCard.HeaderIcon>
234226

235-
<FontIcon
236-
FontSize="14"
237-
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
238-
Glyph="&#xE8A7;" />
239-
</local:SettingsBlockControl>
227+
<wctcontrols:SettingsCard.ActionIcon>
228+
<FontIcon Glyph="&#xE8A7;" />
229+
</wctcontrols:SettingsCard.ActionIcon>
230+
</wctcontrols:SettingsCard>
240231
</StackPanel>
241232
</Grid>
242233
</Page>

0 commit comments

Comments
 (0)