144 lines
6.9 KiB
XML
144 lines
6.9 KiB
XML
<UserControl xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:loc="using:GC.Services"
|
|
x:Class="GC.Views.SettingsView">
|
|
|
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
|
<StackPanel Margin="26,24,26,32" Spacing="16" MaxWidth="880" HorizontalAlignment="Left">
|
|
|
|
<StackPanel Spacing="4">
|
|
<TextBlock Classes="h1" Text="{loc:Loc set.title}" />
|
|
<TextBlock Classes="muted" Text="{loc:Loc set.subtitle}" />
|
|
</StackPanel>
|
|
|
|
<!-- 通用 -->
|
|
<Border Classes="card" Padding="20,18">
|
|
<StackPanel Spacing="16">
|
|
<TextBlock Classes="h2" Text="{loc:Loc set.general}" />
|
|
|
|
<Grid ColumnDefinitions="200,*">
|
|
<StackPanel VerticalAlignment="Center" Spacing="2">
|
|
<TextBlock Classes="h3" Text="{loc:Loc set.language}" />
|
|
</StackPanel>
|
|
<ComboBox Grid.Column="1" ItemsSource="{Binding Languages}"
|
|
SelectedItem="{Binding SelectedLanguage}" Width="220" HorizontalAlignment="Left">
|
|
<ComboBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding Label}" />
|
|
</DataTemplate>
|
|
</ComboBox.ItemTemplate>
|
|
</ComboBox>
|
|
</Grid>
|
|
|
|
<Grid ColumnDefinitions="200,*">
|
|
<StackPanel VerticalAlignment="Center" Spacing="2">
|
|
<TextBlock Classes="h3" Text="{loc:Loc set.fps}" />
|
|
<TextBlock Classes="faint" Text="{loc:Loc set.fps.desc}" TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
<ComboBox Grid.Column="1" ItemsSource="{Binding FrameRates}"
|
|
SelectedItem="{Binding SelectedFps}" Width="120" HorizontalAlignment="Left" />
|
|
</Grid>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<!-- 内存 -->
|
|
<Border Classes="card" Padding="20,18">
|
|
<StackPanel Spacing="12">
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
<TextBlock Classes="h2" Text="{loc:Loc set.memory}" />
|
|
<TextBlock Grid.Column="1" Text="{Binding MemoryValueText}" Classes="h3"
|
|
Foreground="{DynamicResource Accent}" VerticalAlignment="Center" />
|
|
</Grid>
|
|
<TextBlock Classes="muted" Text="{loc:Loc set.memory.desc}" TextWrapping="Wrap" />
|
|
<CheckBox Content="{loc:Loc set.memory.auto}" IsChecked="{Binding MemoryAuto}"
|
|
Margin="0,2,0,0" />
|
|
<Slider Minimum="512" Maximum="8192" TickFrequency="256" IsSnapToTickEnabled="False"
|
|
IsEnabled="{Binding !MemoryAuto}"
|
|
Value="{Binding MemoryValue}" Margin="0,4,0,0" />
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
<TextBlock Classes="faint" Text="{loc:Loc set.memory.hint}" TextWrapping="Wrap" />
|
|
<TextBlock Grid.Column="1" Classes="faint" Text="{Binding UsageText}" Margin="16,0,0,0" />
|
|
</Grid>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<!-- 模型源 -->
|
|
<Border Classes="card" Padding="20,18">
|
|
<StackPanel Spacing="10">
|
|
<TextBlock Classes="h2" Text="{loc:Loc set.sources}" />
|
|
<TextBlock Classes="muted" Text="{loc:Loc set.sources.desc}" TextWrapping="Wrap" />
|
|
<ItemsControl ItemsSource="{Binding Sources}" Margin="0,4,0,0">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border Classes="panel" Padding="12,9" Margin="0,0,0,8">
|
|
<Grid ColumnDefinitions="Auto,*,Auto">
|
|
<CheckBox IsChecked="{Binding Enabled}" VerticalAlignment="Center" Margin="0,0,10,0" />
|
|
<StackPanel Grid.Column="1" Spacing="2" VerticalAlignment="Center">
|
|
<TextBlock Text="{Binding Name}" FontSize="12.5" FontWeight="SemiBold" />
|
|
<TextBlock Text="{Binding UrlText}" Classes="faint" TextTrimming="CharacterEllipsis" MaxWidth="520" />
|
|
</StackPanel>
|
|
<Button Grid.Column="2" Classes="ghost small" Content="✕"
|
|
IsVisible="{Binding CanRemove}" Command="{Binding RemoveCommand}" VerticalAlignment="Center" />
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<!-- 自动更新 -->
|
|
<Border Classes="card" Padding="20,18">
|
|
<StackPanel Spacing="12">
|
|
<TextBlock Classes="h2" Text="{loc:Loc update.title}" />
|
|
<TextBlock Classes="muted" Text="{loc:Loc update.desc}" TextWrapping="Wrap" />
|
|
<CheckBox IsChecked="{Binding AutoUpdate}" Content="{loc:Loc update.auto}" />
|
|
<Grid ColumnDefinitions="200,*">
|
|
<TextBlock Classes="h3" Text="{loc:Loc update.source}" VerticalAlignment="Center" />
|
|
<TextBlock Grid.Column="1" Classes="muted" Text="{Binding UpdateSourceText}"
|
|
TextTrimming="CharacterEllipsis" VerticalAlignment="Center" />
|
|
</Grid>
|
|
<Grid ColumnDefinitions="200,*">
|
|
<TextBlock Classes="h3" Text="{loc:Loc update.lastCheck}" />
|
|
<TextBlock Grid.Column="1" Classes="muted" Text="{Binding LastCheckText}" />
|
|
</Grid>
|
|
<Grid ColumnDefinitions="200,*">
|
|
<TextBlock Classes="h3" Text="{loc:Loc update.pending}" />
|
|
<TextBlock Grid.Column="1" Classes="muted" Text="{Binding PendingText}" />
|
|
</Grid>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<!-- 存储 -->
|
|
<Border Classes="card" Padding="20,18">
|
|
<StackPanel Spacing="14">
|
|
<TextBlock Classes="h2" Text="{loc:Loc set.storage}" />
|
|
|
|
<Grid ColumnDefinitions="200,*,Auto">
|
|
<TextBlock Classes="h3" Text="{loc:Loc set.modelDir}" VerticalAlignment="Center" />
|
|
<TextBlock Grid.Column="1" Classes="muted" Text="{Binding ModelRoot}"
|
|
TextTrimming="CharacterEllipsis" VerticalAlignment="Center" Margin="0,0,10,0" />
|
|
<Button Grid.Column="2" Classes="small" Content="{loc:Loc set.openFolder}"
|
|
Command="{Binding OpenModelFolderCommand}" />
|
|
</Grid>
|
|
|
|
<Grid ColumnDefinitions="200,*,Auto">
|
|
<TextBlock Classes="h3" Text="{loc:Loc set.dataDir}" VerticalAlignment="Center" />
|
|
<TextBlock Grid.Column="1" Classes="muted" Text="{Binding DataRoot}"
|
|
TextTrimming="CharacterEllipsis" VerticalAlignment="Center" Margin="0,0,10,0" />
|
|
<Button Grid.Column="2" Classes="small" Content="{loc:Loc set.openFolder}"
|
|
Command="{Binding OpenDataFolderCommand}" />
|
|
</Grid>
|
|
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
<TextBlock Classes="faint" Text="{Binding StatusMessage}" VerticalAlignment="Center" />
|
|
<Button Grid.Column="1" Classes="small" Content="{loc:Loc set.clearCache}"
|
|
Command="{Binding ClearCacheCommand}" />
|
|
</Grid>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</UserControl>
|