New Settings UI

This commit is contained in:
RMBGAME
2021-10-16 11:38:23 +08:00
parent 2f8aec25f6
commit fd3145a804
10 changed files with 423 additions and 326 deletions
@@ -19,8 +19,10 @@
<CornerRadius x:Key="NavigationViewContentGridCornerRadius">0,0,0,0</CornerRadius>
<Thickness x:Key="NavigationViewContentGridBorderThickness">0,0,0,0</Thickness>
</Styles.Resources>
<StyleInclude Source="/Application/UI/Styles/Window.xaml" />
<StyleInclude Source="/Application/UI/Styles/DrawingSvg.xaml" />
<StyleInclude Source="/Application/UI/Styles/Window.xaml" />
<StyleInclude Source="/Application/UI/Styles/Settings.xaml" />
<StyleInclude Source="/Application/UI/Styles/Controls/FontSizes.xaml" />
<StyleInclude Source="/Application/UI/Styles/Controls/Separator.xaml" />
<StyleInclude Source="/Application/UI/Styles/Controls/TabControl.xaml" />
@@ -0,0 +1,176 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Design.PreviewWith>
<Border Padding="20">
<StackPanel Classes="Settings">
<Border Classes="Item">
<StackPanel Spacing="10" VerticalAlignment="Center">
<WrapPanel>
<TextBlock Text="当前 ArchiSteamFarm 版本 : " VerticalAlignment="Center"></TextBlock>
<TextBlock Text="V5.0.1.0" VerticalAlignment="Center"></TextBlock>
</WrapPanel>
<!--<TextBlock Text="最新 ArchiSteamFarm 版本 : " VerticalAlignment="Center"></TextBlock>
<TextBlock Text="{ReflectionBinding Source={x:Static ms:ASFSettings.ArchiSteamFarmExePath},Path=Value,Mode=OneWay}" VerticalAlignment="Center"></TextBlock>-->
</StackPanel>
</Border>
<Separator Classes="Separator"/>
<Border Classes="Item">
<DockPanel>
<TextBlock Text="程序启动时自动运行ASF"/>
<ToggleSwitch />
</DockPanel>
</Border>
<Border Classes="Item">
<DockPanel>
<TextBlock Text="启用IPC"/>
<ToggleSwitch />
</DockPanel>
</Border>
<Border Classes="Item">
<DockPanel>
<TextBlock Text="IPC服务访问密码"/>
<TextBox PasswordChar="●"
Classes="revealPasswordButton">
</TextBox>
</DockPanel>
</Border>
<Separator Classes="Separator"/>
<Border Classes="Item">
<DockPanel>
<TextBlock Text="存储空间"/>
<Button Content="查看目录" />
</DockPanel>
</Border>
</StackPanel>
</Border>
</Design.PreviewWith>
<Style Selector="StackPanel.Settings">
<Setter Property="Spacing" Value="5" />
<Setter Property="Margin" Value="10 0" />
</Style>
<Style Selector="StackPanel.Settings Separator.Separator">
<Setter Property="Height" Value="0.88" />
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightBaseLowBrush}" />
<Setter Property="Opacity" Value="0.5" />
<Setter Property="Margin" Value="0 20" />
</Style>
<Style Selector="Border.Item:pointerover">
<Setter Property="Background" Value="{DynamicResource ControlStrokeColorSecondaryBrush}" />
</Style>
<Style Selector="Border.Item">
<Setter Property="Height" Value="65" />
<Setter Property="Padding" Value="15" />
<Setter Property="Background" Value="{DynamicResource CardBackgroundFillColorDefaultBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource CardStrokeColorDefaultBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
</Style>
<Style Selector="Border.Item:pointerover">
<Setter Property="Background" Value="{DynamicResource ControlStrokeColorSecondaryBrush}" />
</Style>
<Style Selector="StackPanel.Settings Expander ToggleButton.ExpanderToggleButton /template/ ContentPresenter#ContentPresenter">
<Setter Property="Height" Value="65" />
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
<Style Selector="StackPanel.Settings TextBlock">
<Setter Property="FontSize" Value="{StaticResource FontSizeH7}"/>
<Setter Property="Foreground" Value="{DynamicResource HighlightForegroundBrushKey}" />
</Style>
<Style Selector="StackPanel.Settings TextBlock.title">
<Setter Property="FontSize" Value="{StaticResource FontSizeH7}"/>
<Setter Property="Foreground" Value="{DynamicResource HighlightForegroundBrushKey}" />
<Setter Property="(TextBlock.FontWeight)" Value="Bold" />
</Style>
<Style Selector="StackPanel.Settings TextBlock.prompt">
<Setter Property="FontSize" Value="{StaticResource FontSizeH8}" />
<Setter Property="Foreground" Value="{DynamicResource InactiveForegroundBrushKey}" />
<Setter Property="VerticalAlignment" Value="Center" />
<!--<Setter Property="Margin" Value="10 0" />-->
<Setter Property="TextWrapping" Value="Wrap" />
</Style>
<Style Selector="StackPanel.Settings DockPanel > TextBlock">
<Setter Property="Margin" Value="0 0 20 0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="(DockPanel.Dock)" Value="Left" />
</Style>
<Style Selector="StackPanel.Settings DockPanel > Button">
<Setter Property="Padding" Value="25 3" />
<Setter Property="Height" Value="30" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="HorizontalContentAlignment" Value="Right" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="(DockPanel.Dock)" Value="Right" />
</Style>
<Style Selector="StackPanel.Settings DockPanel > ToggleSwitch">
<Setter Property="Margin" Value="0 0 -12 0" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="OnContent" Value="{x:Null}" />
<Setter Property="OffContent" Value="{x:Null}" />
</Style>
<Style Selector="StackPanel.Settings DockPanel > TextBox">
<Setter Property="Width" Value="280" />
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="(DockPanel.Dock)" Value="Right" />
</Style>
<Style Selector="StackPanel.Settings DockPanel > ComboBox">
<Setter Property="Width" Value="280" />
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="(DockPanel.Dock)" Value="Right" />
</Style>
<Style Selector="StackPanel.Settings DockPanel > Slider">
<Setter Property="Width" Value="280" />
<Setter Property="Margin" Value="0 -15 0 0" />
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="(DockPanel.Dock)" Value="Right" />
</Style>
<Style Selector="StackPanel.Settings DockPanel > WrapPanel">
<Setter Property="Margin" Value="0 0 20 0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="(DockPanel.Dock)" Value="Left" />
</Style>
<Style Selector="StackPanel.Settings DockPanel StackPanel.right">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="(DockPanel.Dock)" Value="Right" />
</Style>
<Style Selector="StackPanel.Settings DockPanel Control.right">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="(DockPanel.Dock)" Value="Right" />
</Style>
<Style Selector="StackPanel.Settings DockPanel Control.left">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="(DockPanel.Dock)" Value="Left" />
</Style>
</Styles>
@@ -17,40 +17,8 @@
x:DataType="vm:ArchiSteamFarmPlusPageViewModel"
x:CompileBindings="True"
x:Class="System.Application.UI.Views.Pages.ASF_GlobalConfigPage">
<StackPanel Spacing="20" Margin="10 0">
<StackPanel.Styles>
<Style Selector="TextBlock">
<Setter Property="FontSize" Value="{StaticResource FontSizeH7}"/>
<Setter Property="Foreground" Value="{DynamicResource HighlightForegroundBrushKey}" />
</Style>
<Style Selector="DockPanel > TextBlock">
<Setter Property="Margin" Value="0 0 20 0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="(DockPanel.Dock)" Value="Left" />
</Style>
<Style Selector="DockPanel > ToggleSwitch">
<Setter Property="Margin" Value="0 0 -12 0" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="OnContent" Value="{x:Null}" />
<Setter Property="OffContent" Value="{x:Null}" />
</Style>
</StackPanel.Styles>
<Border>
<Border.Styles>
<Style Selector="Border">
<Setter Property="MinHeight" Value="50" />
<Setter Property="Padding" Value="15" />
<Setter Property="Background" Value="{DynamicResource CardBackgroundFillColorDefaultBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource CardStrokeColorDefaultBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
</Style>
<Style Selector="Border:pointerover">
<Setter Property="Background" Value="{DynamicResource ControlStrokeColorSecondaryBrush}" />
</Style>
</Border.Styles>
<StackPanel Classes="Settings">
<Border Classes="Item">
<StackPanel Spacing="10" VerticalAlignment="Center">
<WrapPanel>
<TextBlock Text="当前 ArchiSteamFarm 版本 : " VerticalAlignment="Center"></TextBlock>
@@ -61,32 +29,31 @@
</StackPanel>
</Border>
<Separator Classes="Separator"/>
<Separator Classes="Separator"></Separator>
<Border Classes="Item">
<DockPanel>
<TextBlock Text="程序启动时自动运行ASF"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:ASFSettings.AutoRunArchiSteamFarm},Path=Value,Mode=TwoWay}" />
</DockPanel>
</Border>
<DockPanel>
<TextBlock Text="程序启动时自动运行ASF"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:ASFSettings.AutoRunArchiSteamFarm},Path=Value,Mode=TwoWay}" />
</DockPanel>
<Border Classes="Item">
<DockPanel>
<TextBlock Text="启用IPC"/>
<ToggleSwitch />
</DockPanel>
</Border>
<DockPanel>
<TextBlock Text="ASF自动更新"/>
<ToggleSwitch />
</DockPanel>
<Border Classes="Item">
<DockPanel>
<TextBlock Text="IPC服务访问密码"/>
<TextBox PasswordChar="●"
Classes="revealPasswordButton">
</TextBox>
</DockPanel>
</Border>
<DockPanel>
<TextBlock Text="启用IPC"/>
<ToggleSwitch />
</DockPanel>
<StackPanel Orientation="Vertical" Spacing="10">
<TextBlock Text="IPC服务访问密码"/>
<TextBox Watermark="设置IPC服务密码"
PasswordChar="*"
Classes="revealPasswordButton">
</TextBox>
</StackPanel>
<Separator Classes="Separator"></Separator>
<Separator Classes="Separator"/>
</StackPanel>
</UserControl>
@@ -26,61 +26,6 @@
Padding="10"
Classes="paper"
Background="{DynamicResource ThemeBrushKey}">
<!--<DockPanel>
<StackPanel Orientation="Horizontal"
Spacing="10"
HorizontalAlignment="Left"
VerticalAlignment="Center">
-->
<!--<TextBlock Text="{ReflectionBinding Path=Res.CommunityFix_ProxyMode,Mode=OneWay,Source={x:Static resx:R.Current}}" Margin="0 5"
Foreground="{DynamicResource HighlightForegroundBrushKey}"></TextBlock>-->
<!--
<RadioButton Content="{ReflectionBinding Path=Res.CommunityFix_ProxyMode_Hosts,Mode=OneWay,Source={x:Static resx:R.Current}}" ToolTip.Tip="{ReflectionBinding Path=Res.CommunityFix_ProxyMode_HostsTip,Mode=OneWay,Source={x:Static resx:R.Current}}" IsChecked="{Binding Source={x:Static ms:ProxySettings.EnableWindowsProxy},Path=!Value, Mode=TwoWay}"></RadioButton>
<RadioButton Content="{ReflectionBinding Path=Res.CommunityFix_ProxyMode_WinSystem,Mode=OneWay,Source={x:Static resx:R.Current}}" ToolTip.Tip="{ReflectionBinding Path=Res.CommunityFix_ProxyMode_WinSystemTip,Mode=OneWay,Source={x:Static resx:R.Current}}" IsChecked="{Binding Source={x:Static ms:ProxySettings.EnableWindowsProxy},Path=Value, Mode=TwoWay}"></RadioButton>
<Button Background="Transparent"
Command="{Binding ProxySettingsCommand}"
ToolTip.Tip="{ReflectionBinding Path=Res.CommunityFix_ProxySettings,Mode=OneWay,Source={x:Static resx:R.Current}}">
<StackPanel Orientation="Horizontal" Spacing="5">
<PathIcon Data="{StaticResource SettingsDrawing}"/>
<TextBlock Text="{ReflectionBinding Path=Res.CommunityFix_ProxySettings,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
</StackPanel>
</Button>
<Menu Classes="BindMenu">
<MenuItem Items="{Binding MenuItems}"
Classes="BindItem"
IsVisible="{Binding !MenuItems,Converter={StaticResource IsNullConverter}}">
<MenuItem.Header>
<PathIcon Data="{StaticResource MoreDrawing}" Width="14"></PathIcon>
</MenuItem.Header>
</MenuItem>
</Menu>
</StackPanel>
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Right"
VerticalAlignment="Center">
<TextBlock Text="{ReflectionBinding Path=Res.CommunityFix_EnableScriptService,Mode=OneWay,Source={x:Static resx:R.Current}}"
VerticalAlignment="Center"/>
<ToggleSwitch Classes="onlyToggleSwitch"
VerticalAlignment="Center"
IsChecked="{Binding Source={x:Static service:ProxyService.Current},Path=IsEnableScript}"
Margin="10 -5 15 0"/>
<Button Classes="action"
Content="{ReflectionBinding Path=Res.CommunityFix_StartProxy,Mode=OneWay,Source={x:Static resx:R.Current}}"
FontSize="16"
MinWidth="50"
Width="200"
MinHeight="40"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Command="{Binding StartProxyButton_Click}"
CommandParameter="True"></Button>
-->
<!--<ToggleSwitch Content="{ReflectionBinding Path=Res.CommunityFix_StartProxy,Mode=OneWay,Source={x:Static resx:R.Current}}" IsChecked="{Binding Source={x:Static service:ProxyService.Current},Path=ProxyStatus}"></ToggleSwitch>-->
<!--
</StackPanel>
</DockPanel>-->
<ui:CommandBar DefaultLabelPosition="Right">
<ui:CommandBar.PrimaryCommands>
<!--<ui:CommandBarButton
@@ -194,7 +139,6 @@
</ui:CommandBarButton>
</ui:CommandBar.SecondaryCommands>
</ui:CommandBar>
</Border>
<Border Grid.Column="0"
@@ -13,34 +13,7 @@
Background="{DynamicResource ThemeBrushKey}">
<Border.Styles>
<Style Selector="ScrollViewer.tabscroll">
<Setter Property="Padding" Value="20 0 20 20"/>
</Style>
<Style Selector="TextBlock">
<Setter Property="FontSize" Value="{StaticResource FontSizeH7}"/>
<Setter Property="Foreground" Value="{DynamicResource HighlightForegroundBrushKey}" />
</Style>
<Style Selector="TextBlock.prompt">
<Setter Property="FontSize" Value="12" />
<!--<Setter Property="Foreground" Value="{DynamicResource InactiveForegroundBrushKey}" />-->
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="10 0" />
</Style>
<Style Selector="DockPanel > WrapPanel">
<Setter Property="Margin" Value="0 0 20 0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="(DockPanel.Dock)" Value="Left" />
</Style>
<Style Selector="DockPanel > TextBlock">
<Setter Property="Margin" Value="0 0 20 0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="(DockPanel.Dock)" Value="Left" />
</Style>
<Style Selector="DockPanel > ToggleSwitch">
<Setter Property="Margin" Value="0 0 -12 0" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="OnContent" Value="{x:Null}" />
<Setter Property="OffContent" Value="{x:Null}" />
<Setter Property="Padding" Value="0 0 0 20"/>
</Style>
</Border.Styles>
<TabControl Classes="flat">
@@ -9,92 +9,111 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="System.Application.UI.Views.Pages.Settings_General">
<ScrollViewer Classes="tabscroll">
<StackPanel Orientation="Vertical"
HorizontalAlignment="Stretch"
Spacing="20">
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_General_StartAutoRun,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.WindowsStartupAutoRun},Path=Value, Mode=TwoWay}"/>
</DockPanel>
<StackPanel Classes="Settings">
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_General_RuningMinimize,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.IsStartupAppMinimized},Path=Value, Mode=TwoWay}"/>
</DockPanel>
<Border Classes="Item">
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_General_StartAutoRun,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.WindowsStartupAutoRun},Path=Value, Mode=TwoWay}"/>
</DockPanel>
</Border>
<Border Classes="Item">
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_General_RuningMinimize,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.IsStartupAppMinimized},Path=Value, Mode=TwoWay}"/>
</DockPanel>
</Border>
<Separator Classes="Separator"/>
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_General_AutoCheckUpdate,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.IsAutoCheckUpdate},Path=Value, Mode=TwoWay}"/>
</DockPanel>
<StackPanel Orientation="Vertical" Spacing="10" IsVisible="{ReflectionBinding Source={x:Static sys:DesktopBridge.IsRunningAsUwp}, Mode=OneTime, Converter={x:Static BoolConverters.Not}}}">
<TextBlock Text="{ReflectionBinding Path=Res.Settings_General_UpdateChannel,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ComboBox x:Name="Themes"
Items="{Binding UpdateChannels}"
SelectedItem="{Binding Source={x:Static ms:GeneralSettings.UpdateChannel},Path=Value, Mode=TwoWay}"
HorizontalAlignment="Stretch">
</ComboBox>
</StackPanel>
<Border Classes="Item">
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_General_AutoCheckUpdate,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.IsAutoCheckUpdate},Path=Value, Mode=TwoWay}"/>
</DockPanel>
</Border>
<Border Classes="Item"
IsVisible="{ReflectionBinding Source={x:Static sys:DesktopBridge.IsRunningAsUwp}, Mode=OneTime, Converter={x:Static BoolConverters.Not}}}">
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_General_UpdateChannel,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ComboBox x:Name="Themes"
Items="{Binding UpdateChannels}"
SelectedItem="{Binding Source={x:Static ms:GeneralSettings.UpdateChannel},Path=Value, Mode=TwoWay}">
</ComboBox>
</DockPanel>
</Border>
<Separator Classes="Separator"/>
<DockPanel IsVisible="{x:Static sys:OperatingSystem2.IsMacOS}">
<WrapPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_General_UseGPURendering,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<TextBlock Classes="prompt"
Text="{ReflectionBinding Path=Res.Settings_RestartEffective,Mode=OneWay,Source={x:Static resx:R.Current}}"></TextBlock>
</WrapPanel>
<Border Classes="Item"
IsVisible="{x:Static sys:OperatingSystem2.IsMacOS}">
<DockPanel>
<StackPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_General_UseGPURendering,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<TextBlock Classes="prompt"
Text="{ReflectionBinding Path=Res.Settings_RestartEffective,Mode=OneWay,Source={x:Static resx:R.Current}}"></TextBlock>
</StackPanel>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.UseGPURendering},Path=Value, Mode=TwoWay}"/>
</DockPanel>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.UseGPURendering},Path=Value, Mode=TwoWay}"/>
</DockPanel>
</Border>
<DockPanel IsVisible="{x:Static sys:OperatingSystem2.IsWindows}">
<WrapPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_General_UseOpenGL,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<TextBlock Classes="prompt"
Text="{ReflectionBinding Path=Res.Settings_RestartEffective,Mode=OneWay,Source={x:Static resx:R.Current}}"></TextBlock>
</WrapPanel>
<Border Classes="Item"
IsVisible="{x:Static sys:OperatingSystem2.IsWindows}">
<DockPanel>
<StackPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_General_UseOpenGL,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<TextBlock Classes="prompt"
Text="{ReflectionBinding Path=Res.Settings_RestartEffective,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
</StackPanel>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.UseOpenGL},Path=Value, Mode=TwoWay}"/>
</DockPanel>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.UseOpenGL},Path=Value, Mode=TwoWay}"/>
</DockPanel>
</Border>
<Separator Classes="Separator" IsVisible="{ReflectionBinding Source={x:Static sys:OperatingSystem2.IsLinux}, Mode=OneTime, Converter={x:Static BoolConverters.Not}}" />
<StackPanel Orientation="Vertical" Spacing="10">
<TextBlock Text="{ReflectionBinding Path=Res.Settings_General_StorageSpace,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<Expander>
<Expander.Header>
<DockPanel HorizontalAlignment="Stretch">
<TextBlock Text="{ReflectionBinding Path=Res.Settings_General_StorageSpace,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<Button Content="{ReflectionBinding Path=Res.Settings_General_BrowseCustomFolder,Mode=OneWay,Source={x:Static resx:R.Current},Converter={StaticResource StringFormatConverter},ConverterParameter=App}"
Command="{ReflectionBinding OpenFolder}"/>
</DockPanel>
</Expander.Header>
<StackPanel
Orientation="Horizontal"
Spacing="10">
<Button Content="{ReflectionBinding Path=Res.Settings_General_BrowseCustomFolder,Mode=OneWay,Source={x:Static resx:R.Current},Converter={StaticResource StringFormatConverter},ConverterParameter=AppData}"
Command="{ReflectionBinding OpenFolder}"
CommandParameter="AppData"/>
<Button Content="{ReflectionBinding Path=Res.Settings_General_BrowseCustomFolder,Mode=OneWay,Source={x:Static resx:R.Current},Converter={StaticResource StringFormatConverter},ConverterParameter=Cache}"
Command="{ReflectionBinding OpenFolder}"
CommandParameter="Cache"/>
<Button Content="{ReflectionBinding Path=Res.Settings_General_BrowseCustomFolder,Mode=OneWay,Source={x:Static resx:R.Current},Converter={StaticResource StringFormatConverter},ConverterParameter=Logs}"
Command="{ReflectionBinding OpenFolder}"
CommandParameter="Logs"/>
<StackPanel Orientation="Vertical" Spacing="10">
<StackPanel
Orientation="Horizontal"
Spacing="10">
<Button Content="{ReflectionBinding Path=Res.Settings_General_BrowseCustomFolder,Mode=OneWay,Source={x:Static resx:R.Current},Converter={StaticResource StringFormatConverter},ConverterParameter=AppData}"
Command="{ReflectionBinding OpenFolder}"
CommandParameter="AppData"/>
<Button Content="{ReflectionBinding Path=Res.Settings_General_BrowseCustomFolder,Mode=OneWay,Source={x:Static resx:R.Current},Converter={StaticResource StringFormatConverter},ConverterParameter=Cache}"
Command="{ReflectionBinding OpenFolder}"
CommandParameter="Cache"/>
<Button Content="{ReflectionBinding Path=Res.Settings_General_BrowseCustomFolder,Mode=OneWay,Source={x:Static resx:R.Current},Converter={StaticResource StringFormatConverter},ConverterParameter=Logs}"
Command="{ReflectionBinding OpenFolder}"
CommandParameter="Logs"/>
</StackPanel>
<WrapPanel>
<TextBlock x:Name="CacheSize" VerticalAlignment="Center"/>
<!--<Button VerticalContentAlignment="Center"
VerticalAlignment="Center"
Margin="10 0 0 0"
Content="{ReflectionBinding Path=Res.Settings_General_ClearCache,Mode=OneWay,Source={x:Static resx:R.Current}}"/>-->
</WrapPanel>
<WrapPanel>
<TextBlock x:Name="LogSize" VerticalAlignment="Center"/>
<!--<Button VerticalContentAlignment="Center"
VerticalAlignment="Center"
Margin="10 0 0 0"
Content="{ReflectionBinding Path=Res.Settings_General_ClearCache,Mode=OneWay,Source={x:Static resx:R.Current}}"/>-->
</WrapPanel>
</StackPanel>
<WrapPanel>
<TextBlock x:Name="CacheSize" VerticalAlignment="Center"/>
<!--<Button VerticalContentAlignment="Center"
VerticalAlignment="Center"
Margin="10 0 0 0"
Content="{ReflectionBinding Path=Res.Settings_General_ClearCache,Mode=OneWay,Source={x:Static resx:R.Current}}"/>-->
</WrapPanel>
<WrapPanel>
<TextBlock x:Name="LogSize" VerticalAlignment="Center"/>
<!--<Button VerticalContentAlignment="Center"
VerticalAlignment="Center"
Margin="10 0 0 0"
Content="{ReflectionBinding Path=Res.Settings_General_ClearCache,Mode=OneWay,Source={x:Static resx:R.Current}}"/>-->
</WrapPanel>
</StackPanel>
</Expander>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -8,40 +8,46 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="System.Application.UI.Views.Pages.Settings_Steam">
<ScrollViewer Classes="tabscroll">
<StackPanel Orientation="Vertical"
HorizontalAlignment="Stretch"
Spacing="20">
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Steam_AutoRunSteam,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:SteamSettings.IsAutoRunSteam},Path=Value, Mode=TwoWay}"/>
</DockPanel>
<StackPanel Classes="Settings">
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Steam_RuningMinimize,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:SteamSettings.IsRunSteamMinimized},Path=Value, Mode=TwoWay}"/>
</DockPanel>
<Border Classes="Item">
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Steam_AutoRunSteam,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:SteamSettings.IsAutoRunSteam},Path=Value, Mode=TwoWay}"/>
</DockPanel>
</Border>
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Steam_NotCheckUpdate,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:SteamSettings.IsRunSteamNoCheckUpdate},Path=Value, Mode=TwoWay}"/>
</DockPanel>
<Border Classes="Item">
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Steam_RuningMinimize,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:SteamSettings.IsRunSteamMinimized},Path=Value, Mode=TwoWay}"/>
</DockPanel>
</Border>
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Steam_CheckSteamRuningNotification,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:SteamSettings.IsEnableSteamLaunchNotification},Path=Value, Mode=TwoWay}"/>
</DockPanel>
<Border Classes="Item">
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Steam_NotCheckUpdate,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:SteamSettings.IsRunSteamNoCheckUpdate},Path=Value, Mode=TwoWay}"/>
</DockPanel>
</Border>
<Border Classes="Item">
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Steam_CheckSteamRuningNotification,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:SteamSettings.IsEnableSteamLaunchNotification},Path=Value, Mode=TwoWay}"/>
</DockPanel>
</Border>
<Separator Classes="Separator"/>
<StackPanel Spacing="10">
<!--<TextBlock Text= "{ReflectionBinding Path=Res.Settings_Steam_SteamStratParameter,Mode=OneWay,Source={x:Static resx:R.Current}}" />-->
<TextBox Watermark="{ReflectionBinding Path=Res.Settings_Steam_SteamStratParameter,Mode=OneWay,Source={x:Static resx:R.Current}}"
UseFloatingWatermark="True"
Text="{ReflectionBinding Source={x:Static ms:SteamSettings.SteamStratParameter},Path=Value, Mode=TwoWay}"
MinHeight="150"
AcceptsReturn="True"
TextWrapping="Wrap"></TextBox>
</StackPanel>
<Border Classes="Item">
<DockPanel>
<TextBlock Text= "{ReflectionBinding Path=Res.Settings_Steam_SteamStratParameter,Mode=OneWay,Source={x:Static resx:R.Current}}" />
<TextBox Classes="clearButton"
Text="{ReflectionBinding Source={x:Static ms:SteamSettings.SteamStratParameter},Path=Value, Mode=TwoWay}"
TextWrapping="Wrap"/>
</DockPanel>
</Border>
<Separator Classes="Separator"/>
</StackPanel>
@@ -14,66 +14,76 @@
<converters:ColorStringToBrush x:Key="ColorStringToBrush" />
</UserControl.Resources>
<ScrollViewer Classes="tabscroll">
<StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" Spacing="20">
<StackPanel Classes="Settings">
<Border Classes="Item">
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_ThemeAccent,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<StackPanel Orientation="Horizontal"
Classes="right"
Spacing="10">
<RadioButton Content="{ReflectionBinding Path=Res.Settings_UI_SystemDefault,Mode=OneWay,Source={x:Static resx:R.Current}}"
IsChecked="{ReflectionBinding Source={x:Static ms:UISettings.GetUserThemeAccent},Path=Value, Mode=TwoWay}"/>
<RadioButton x:Name="AccentCustom"
Content="{ReflectionBinding Path=Res.Settings_UI_Custom,Mode=OneWay,Source={x:Static resx:R.Current}}"
IsChecked="{ReflectionBinding Source={x:Static ms:UISettings.GetUserThemeAccent},Path=!Value, Mode=OneWay}"/>
<ui:ColorPickerButton IsVisible="{ReflectionBinding #AccentCustom.IsChecked}"
IsEnabled="{ReflectionBinding #AccentCustom.IsChecked}"
VerticalAlignment="Center"
Color="{ReflectionBinding Source={x:Static ms:UISettings.ThemeAccent},Converter={StaticResource ColorStringToBrush},Path=Value, Mode=TwoWay}"/>
</StackPanel>
</DockPanel>
</Border>
<StackPanel Orientation="Vertical">
<TextBlock Text="{ReflectionBinding Path=Res.Settings_ThemeAccent,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<StackPanel Orientation="Horizontal" Spacing="10">
<RadioButton Content="{ReflectionBinding Path=Res.Settings_UI_SystemDefault,Mode=OneWay,Source={x:Static resx:R.Current}}"
IsChecked="{ReflectionBinding Source={x:Static ms:UISettings.GetUserThemeAccent},Path=Value, Mode=TwoWay}"/>
<RadioButton x:Name="AccentCustom"
Content="{ReflectionBinding Path=Res.Settings_UI_Custom,Mode=OneWay,Source={x:Static resx:R.Current}}"
IsChecked="{ReflectionBinding Source={x:Static ms:UISettings.GetUserThemeAccent},Path=!Value, Mode=OneWay}"/>
<ui:ColorPickerButton IsVisible="{ReflectionBinding #AccentCustom.IsChecked}"
IsEnabled="{ReflectionBinding #AccentCustom.IsChecked}"
Color="{ReflectionBinding Source={x:Static ms:UISettings.ThemeAccent},Converter={StaticResource ColorStringToBrush},Path=Value, Mode=TwoWay}"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Spacing="10" Margin="0 -10 0 0">
<WrapPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Theme,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<TextBlock Classes="prompt"
Text="{ReflectionBinding Path=Res.Settings_RestartEffective,Mode=OneWay,Source={x:Static resx:R.Current}}"></TextBlock>
</WrapPanel>
<ComboBox x:Name="Themes"
SelectedIndex="{Binding Source={x:Static ms:UISettings.Theme},Path=Value, Mode=TwoWay}"
HorizontalAlignment="Stretch">
<ComboBoxItem Content="{ReflectionBinding Path=Res.Settings_UI_SystemDefault,Mode=OneWay,Source={x:Static resx:R.Current}}"></ComboBoxItem>
<ComboBoxItem Content="{ReflectionBinding Path=Res.Settings_UI_Light,Mode=OneWay,Source={x:Static resx:R.Current}}"></ComboBoxItem>
<ComboBoxItem Content="{ReflectionBinding Path=Res.Settings_UI_Dark,Mode=OneWay,Source={x:Static resx:R.Current}}"></ComboBoxItem>
</ComboBox>
</StackPanel>
<Border Classes="Item">
<DockPanel>
<StackPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Theme,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<TextBlock Classes="prompt"
Text="{ReflectionBinding Path=Res.Settings_RestartEffective,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
</StackPanel>
<ComboBox x:Name="Themes"
SelectedIndex="{Binding Source={x:Static ms:UISettings.Theme},Path=Value, Mode=TwoWay}">
<ComboBoxItem Content="{ReflectionBinding Path=Res.Settings_UI_SystemDefault,Mode=OneWay,Source={x:Static resx:R.Current}}"></ComboBoxItem>
<ComboBoxItem Content="{ReflectionBinding Path=Res.Settings_UI_Light,Mode=OneWay,Source={x:Static resx:R.Current}}"></ComboBoxItem>
<ComboBoxItem Content="{ReflectionBinding Path=Res.Settings_UI_Dark,Mode=OneWay,Source={x:Static resx:R.Current}}"></ComboBoxItem>
</ComboBox>
</DockPanel>
</Border>
<StackPanel Orientation="Vertical" Spacing="10">
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Language,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ComboBox HorizontalAlignment="Stretch" SelectedItem="{Binding SelectLanguage, Mode=TwoWay}" Items="{Binding Mode=OneWay,Source={x:Static resx:R.Languages}}" >
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Value,Mode=OneWay}"></TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</StackPanel>
<Border Classes="Item">
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Language,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ComboBox SelectedItem="{Binding SelectLanguage, Mode=TwoWay}"
Items="{Binding Mode=OneWay,Source={x:Static resx:R.Languages}}" >
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Value,Mode=OneWay}"></TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</DockPanel>
</Border>
<Separator Classes="Separator"/>
<StackPanel Orientation="Vertical" Spacing="10">
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Fonts,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ComboBox
Items="{Binding Mode=OneWay,Source={x:Static resx:R.Fonts}}"
SelectedItem="{Binding SelectFont}"
HorizontalAlignment="Stretch"
AutoScrollToSelectedItem="True"
MaxDropDownHeight="300">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Key,Mode=OneWay}"
FontFamily="{Binding Value,Mode=OneWay,Converter={StaticResource NameToFontFamilyConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</StackPanel>
<Border Classes="Item">
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Fonts,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ComboBox
Items="{Binding Mode=OneWay,Source={x:Static resx:R.Fonts}}"
SelectedItem="{Binding SelectFont}"
AutoScrollToSelectedItem="True"
MaxDropDownHeight="300">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Key,Mode=OneWay}"
FontFamily="{Binding Value,Mode=OneWay,Converter={StaticResource NameToFontFamilyConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</DockPanel>
</Border>
<!--<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_UI_EnableFilletUI,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
@@ -89,27 +99,33 @@
</DockPanel>
</StackPanel>-->
<StackPanel Orientation="Vertical" IsEnabled="{ReflectionBinding Source={x:Static ms:UISettings.EnableDesktopBackground},Path=!Value, Mode=OneWay}">
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_UI_CustomBackgroundImage,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:UISettings.EnableCustomBackgroundImage},Path=Value, Mode=TwoWay}"/>
</DockPanel>
<StackPanel Orientation="Horizontal" Spacing="10">
<Image Source="{ReflectionBinding Source={x:Static ms:UISettings.BackgroundImagePath},Path=Value, Mode=OneWay,Converter={StaticResource BitmapAssetValueConverter}}"
Stretch="UniformToFill"
Width="250"
Height="150"/>
<Button Content="{ReflectionBinding Path=Res.Settings_UI_SelectImage,Mode=OneWay,Source={x:Static resx:R.Current}}"
Command="{Binding SelectImage_Click}"></Button>
<Button Content="{ReflectionBinding Path=Res.Reset,Mode=OneWay,Source={x:Static resx:R.Current}}"
Command="{Binding ResetImage_Click}"></Button>
<Expander>
<Expander.Header>
<DockPanel HorizontalAlignment="Stretch">
<TextBlock Text="{ReflectionBinding Path=Res.Settings_UI_CustomBackgroundImage,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:UISettings.EnableCustomBackgroundImage},Path=Value, Mode=TwoWay}"/>
</DockPanel>
</Expander.Header>
<StackPanel Orientation="Vertical" IsEnabled="{ReflectionBinding Source={x:Static ms:UISettings.EnableDesktopBackground},Path=!Value, Mode=OneWay}">
<StackPanel Orientation="Horizontal" Spacing="10">
<Image Source="{ReflectionBinding Source={x:Static ms:UISettings.BackgroundImagePath},Path=Value, Mode=OneWay,Converter={StaticResource BitmapAssetValueConverter}}"
Stretch="UniformToFill"
Width="250"
Height="150"/>
<Button Content="{ReflectionBinding Path=Res.Settings_UI_SelectImage,Mode=OneWay,Source={x:Static resx:R.Current}}"
Command="{Binding SelectImage_Click}"></Button>
<Button Content="{ReflectionBinding Path=Res.Reset,Mode=OneWay,Source={x:Static resx:R.Current}}"
Command="{Binding ResetImage_Click}"></Button>
</StackPanel>
</StackPanel>
</StackPanel>
</Expander>
<StackPanel Orientation="Vertical" Spacing="8">
<TextBlock Text="{ReflectionBinding Path=Res.Settings_UI_AcrylicTransparency,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<Slider Value="{ReflectionBinding Value,Source={x:Static ms:UISettings.AcrylicOpacity},Mode=TwoWay}" Minimum="0" Maximum="1.0"></Slider>
</StackPanel>
<Border Classes="Item">
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_UI_AcrylicTransparency,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<Slider Value="{ReflectionBinding Value,Source={x:Static ms:UISettings.AcrylicOpacity},Mode=TwoWay}" Minimum="0" Maximum="1.0"/>
</DockPanel>
</Border>
<Separator Classes="Separator"/>
</StackPanel>
@@ -51,9 +51,6 @@
<ItemGroup>
<None Remove="Application\UI\Assets\Fonts\WenQuanYiMicroHei-01.ttf" />
<None Remove="Application\UI\Assets\movecross.png" />
<None Remove="Application\UI\Styles\Controls\DateTimePicker.xaml" />
<None Remove="Application\UI\Styles\Controls\ToggleSwitch.xaml" />
<None Remove="Application\UI\Styles\Controls\Window.xaml" />
</ItemGroup>
<ItemGroup>
@@ -88,16 +88,13 @@ namespace System.Application.UI.ViewModels
IOPath.DirName_AppData => IOPath.AppDataDirectory,
IOPath.DirName_Cache => IOPath.CacheDirectory,
IApplication.LogDirName => IApplication.LogDirPath,
_ => null,
_ => IOPath.BaseDirectory,
};
if (path != null)
{
var hasKey = clickTimeRecord.TryGetValue(path, out var dt);
var now = DateTime.Now;
if (hasKey && (now - dt).TotalSeconds <= clickInterval) return;
IPlatformService.Instance.OpenFolder(path);
if (!clickTimeRecord.TryAdd(path, now)) clickTimeRecord[path] = now;
}
var hasKey = clickTimeRecord.TryGetValue(path, out var dt);
var now = DateTime.Now;
if (hasKey && (now - dt).TotalSeconds <= clickInterval) return;
IPlatformService.Instance.OpenFolder(path);
if (!clickTimeRecord.TryAdd(path, now)) clickTimeRecord[path] = now;
}
public void SetBackgroundImagePath(string? imagePath)