Skip to content

Commit 718d8af

Browse files
committed
Refactor | PluginLogo
1 parent cd8f2d3 commit 718d8af

File tree

1 file changed

+45
-59
lines changed

1 file changed

+45
-59
lines changed

ShadowViewer/Pages/SettingsPage.xaml

+45-59
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@
99
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
1010
xmlns:helper="using:ShadowViewer.Core.Helpers"
1111
xmlns:i18N="using:ShadowViewer.I18n"
12-
xmlns:icons="using:FluentIcon.WinUI"
1312
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
1413
xmlns:interfaces="using:ShadowViewer.Core.Models.Interfaces"
15-
xmlns:local2="using:ShadowViewer.Controls"
1614
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
17-
xmlns:plugin="using:ShadowViewer.Core.Plugins"
1815
xmlns:shadowConverters="using:ShadowViewer.Converters"
1916
xmlns:ui="using:CommunityToolkit.WinUI"
20-
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
17+
xmlns:fluent="using:FluentIcons.WinUI"
2118
NavigationCacheMode="Required"
2219
mc:Ignorable="d">
2320
<Page.Resources>
@@ -48,33 +45,23 @@
4845
Text="{i18N:Locale Key=Settings}" />
4946
<ScrollViewer Grid.Row="1" Padding="20,5">
5047
<StackPanel HorizontalAlignment="Stretch" Spacing="{StaticResource SettingsCardSpacing}">
51-
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{i18N:Locale Key=MainSetting}" />
52-
<controls:SettingsCard>
53-
<controls:SettingsCard.Header>
54-
<local2:ShadowSettingHeader Description="{i18N:Locale Key=ThemeDescription}" Header="{i18N:Locale Key=Theme}">
55-
<icons:FluentRegularIcon
56-
Width="{StaticResource SettingIconWidth}"
57-
Height="{StaticResource SettingIconHeight}"
58-
FontSize="{StaticResource SettingIconFontSize}"
59-
Symbol="Color24Regular" />
60-
</local2:ShadowSettingHeader>
61-
</controls:SettingsCard.Header>
62-
<ComboBox SelectedIndex="{x:Bind helper:ThemeHelper.RootTheme, Mode=TwoWay, Converter={StaticResource ThemeComboConverter}}">
48+
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
49+
Text="{i18N:Locale Key=MainSetting}" />
50+
<controls:SettingsCard HeaderIcon="{fluent:SymbolIcon Symbol=Communication}"
51+
Description="{i18N:Locale Key=ThemeDescription}"
52+
Header="{i18N:Locale Key=Theme}">
53+
<ComboBox
54+
SelectedIndex="{x:Bind helper:ThemeHelper.RootTheme, Mode=TwoWay, Converter={StaticResource ThemeComboConverter}}">
6355
<ComboBoxItem Content="{i18N:Locale Key=Default}" Tag="Default" />
6456
<ComboBoxItem Content="{i18N:Locale Key=Light}" Tag="Light" />
6557
<ComboBoxItem Content="{i18N:Locale Key=Dark}" Tag="Dark" />
6658
</ComboBox>
6759
</controls:SettingsCard>
68-
<controls:SettingsExpander ItemsSource="{x:Bind ViewModel.SettingsFolders,Mode=OneWay}">
69-
<controls:SettingsExpander.Header>
70-
<local2:ShadowSettingHeader Description="{i18N:Locale Key=FolderDescription}" Header="{i18N:Locale Key=DataFolder}">
71-
<icons:FluentRegularIcon
72-
Width="{StaticResource SettingIconWidth}"
73-
Height="{StaticResource SettingIconHeight}"
74-
FontSize="{StaticResource SettingIconFontSize}"
75-
Symbol="Archive24Regular" />
76-
</local2:ShadowSettingHeader>
77-
</controls:SettingsExpander.Header>
60+
<controls:SettingsExpander HeaderIcon="{fluent:SymbolIcon Symbol=Archive}"
61+
Description="{i18N:Locale Key=FolderDescription}"
62+
Header="{i18N:Locale Key=DataFolder}"
63+
ItemsSource="{x:Bind ViewModel.SettingsFolders,Mode=OneWay}">
64+
7865
<controls:SettingsExpander.ItemTemplate>
7966
<DataTemplate x:DataType="interfaces:ISettingFolder">
8067
<controls:SettingsCard Description="{x:Bind Description}" Header="{x:Bind Name}">
@@ -91,34 +78,22 @@
9178
</DataTemplate>
9279
</controls:SettingsExpander.ItemTemplate>
9380
</controls:SettingsExpander>
94-
<controls:SettingsCard>
95-
<controls:SettingsCard.Header>
96-
<local2:ShadowSettingHeader Description="{i18N:Locale Key=LogPathDescription}" Header="{i18N:Locale Key=LogPath}">
97-
<icons:FluentRegularIcon
98-
Width="{StaticResource SettingIconWidth}"
99-
Height="{StaticResource SettingIconHeight}"
100-
FontSize="{StaticResource SettingIconFontSize}"
101-
Symbol="BookDatabase24Regular" />
102-
</local2:ShadowSettingHeader>
103-
</controls:SettingsCard.Header>
81+
<controls:SettingsCard HeaderIcon="{fluent:SymbolIcon Symbol=BookDatabase}"
82+
Description="{i18N:Locale Key=LogPathDescription}"
83+
Header="{i18N:Locale Key=LogPath}">
84+
10485
<Button Click="LogButton_Click" Content="{i18N:Locale Key=Open}" />
10586
</controls:SettingsCard>
106-
<controls:SettingsCard>
107-
<controls:SettingsCard.Header>
108-
<local2:ShadowSettingHeader Description="{i18N:Locale Key=DebugDescription}" Header="{i18N:Locale Key=Debug}">
109-
<icons:FluentRegularIcon
110-
Width="{StaticResource SettingIconWidth}"
111-
Height="{StaticResource SettingIconHeight}"
112-
FontSize="{StaticResource SettingIconFontSize}"
113-
Symbol="Bug24Regular" />
114-
</local2:ShadowSettingHeader>
115-
</controls:SettingsCard.Header>
87+
<controls:SettingsCard HeaderIcon="{fluent:SymbolIcon Symbol=Bug}"
88+
Description="{i18N:Locale Key=DebugDescription}"
89+
Header="{i18N:Locale Key=Debug}">
90+
11691
<ToggleSwitch IsOn="{x:Bind ViewModel.IsDebug, Mode=TwoWay}" />
11792
</controls:SettingsCard>
118-
93+
11994
<!-- About -->
12095
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{i18N:Locale Key=About}" />
121-
<controls:SettingsExpander
96+
<controls:SettingsExpander IsExpanded="True"
12297
Description="© 2023-2024 kitUIN. All rights reserved."
12398
Header="{i18N:Locale Key=AppTitle}"
12499
HeaderIcon="{ui:BitmapIcon ShowAsMonochrome=False,
@@ -135,7 +110,8 @@
135110
IsClickEnabled="True">
136111
<interactivity:Interaction.Behaviors>
137112
<core:EventTriggerBehavior EventName="Click">
138-
<behaviors:NavigateToUriAction NavigateUri="https://github.com/kitUIN/ShadowViewer/issues/new/choose" />
113+
<behaviors:NavigateToUriAction
114+
NavigateUri="https://github.com/kitUIN/ShadowViewer/issues/new/choose" />
139115
</core:EventTriggerBehavior>
140116
</interactivity:Interaction.Behaviors>
141117
</controls:SettingsCard>
@@ -154,19 +130,29 @@
154130
ContentAlignment="Vertical"
155131
Header="{i18N:Locale Key=Dependencies}">
156132
<StackPanel Orientation="Vertical">
157-
<HyperlinkButton Content="📦Windows App SDK" NavigateUri="https://github.com/microsoft/WindowsAppSDK" />
158-
<HyperlinkButton Content="📦FluentIcon" NavigateUri="https://github.com/KitUIN/FluentIcon" />
159-
<HyperlinkButton Content="⛓️‍💥ShadowPluginLoader" NavigateUri="https://github.com/KitUIN/ShadowPluginLoader" />
160-
<HyperlinkButton Content="📦Windows Community Toolkit" NavigateUri="https://github.com/CommunityToolkit/dotnet" />
161-
<HyperlinkButton Content="🧪Windows Community Toolkit Labs" NavigateUri="https://github.com/CommunityToolkit/Labs-Windows" />
162-
<HyperlinkButton Content="📦SharpCompress" NavigateUri="https://github.com/adamhathcock/sharpcompress" />
133+
<HyperlinkButton Content="📦Windows App SDK"
134+
NavigateUri="https://github.com/microsoft/WindowsAppSDK" />
135+
<HyperlinkButton Content="🔣FluentIcon"
136+
NavigateUri="https://github.com/davidxuang/FluentIcons" />
137+
<HyperlinkButton Content="⛓️‍💥ShadowPluginLoader"
138+
NavigateUri="https://github.com/KitUIN/ShadowPluginLoader" />
139+
<HyperlinkButton Content="📦Windows Community Toolkit"
140+
NavigateUri="https://github.com/CommunityToolkit/dotnet" />
141+
<HyperlinkButton Content="🧪Windows Community Toolkit Labs"
142+
NavigateUri="https://github.com/CommunityToolkit/Labs-Windows" />
143+
<HyperlinkButton Content="📦SharpCompress"
144+
NavigateUri="https://github.com/adamhathcock/sharpcompress" />
163145
<HyperlinkButton Content="📃Serilog" NavigateUri="https://serilog.net" />
164-
<HyperlinkButton Content="📦SQLSugarCore" NavigateUri="https://github.com/DotNetNext/SqlSugar" />
146+
<HyperlinkButton Content="📦SQLSugarCore"
147+
NavigateUri="https://github.com/DotNetNext/SqlSugar" />
165148
<HyperlinkButton Content="📦DryIoc" NavigateUri="https://github.com/dadhi/DryIoc" />
166-
<HyperlinkButton Content="🔩CustomExtensions.WinUI" NavigateUri="https://github.com/dnchattan/winui-extensions" />
167-
<HyperlinkButton Content="📂WinUI Gallery" NavigateUri="https://github.com/microsoft/WinUI-Gallery" />
149+
<HyperlinkButton Content="🔩CustomExtensions.WinUI"
150+
NavigateUri="https://github.com/dnchattan/winui-extensions" />
151+
<HyperlinkButton Content="📂WinUI Gallery"
152+
NavigateUri="https://github.com/microsoft/WinUI-Gallery" />
168153
<HyperlinkButton Content="📂Bili.Uwp" NavigateUri="https://github.com/Richasy/Bili.Uwp" />
169-
<HyperlinkButton Content="📂Windows Community Toolkit Labs[TitleBar]" NavigateUri="https://github.com/CommunityToolkit/Labs-Windows/discussions/454" />
154+
<HyperlinkButton Content="📂Windows Community Toolkit Labs[TitleBar]"
155+
NavigateUri="https://github.com/CommunityToolkit/Labs-Windows/discussions/454" />
170156
</StackPanel>
171157
</controls:SettingsCard>
172158
</controls:SettingsExpander.Items>

0 commit comments

Comments
 (0)