You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DiscordChatExporter/DiscordChatExporter.Gui/Views/Dialogs/SettingsView.axaml

133 lines
6.0 KiB

<UserControl
x:Class="DiscordChatExporter.Gui.Views.Dialogs.SettingsView"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:DiscordChatExporter.Gui.Converters"
xmlns:dialogs="clr-namespace:DiscordChatExporter.Gui.ViewModels.Dialogs"
Width="380">
<Design.DataContext>
<dialogs:SettingsViewModel />
</Design.DataContext>
<Grid RowDefinitions="Auto,*,Auto">
<TextBlock
Grid.Row="0"
Margin="16"
FontSize="19"
FontWeight="Light"
Text="Settings" />
<Border
Grid.Row="1"
Padding="0,8"
BorderBrush="{DynamicResource MaterialDividerBrush}"
BorderThickness="0,1">
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<StackPanel Orientation="Vertical">
<!-- Auto-updates -->
<DockPanel
Margin="16,8"
IsVisible="{OnPlatform False,
Windows=True}"
LastChildFill="False"
ToolTip.Tip="Perform automatic updates on every launch">
<TextBlock DockPanel.Dock="Left" Text="Auto-update" />
<ToggleSwitch DockPanel.Dock="Right" IsChecked="{Binding IsAutoUpdateEnabled}" />
</DockPanel>
<!-- Dark mode -->
<DockPanel
Margin="16,8"
LastChildFill="False"
ToolTip.Tip="Use darker colors in the UI">
<TextBlock DockPanel.Dock="Left" Text="Dark mode" />
<ToggleSwitch
x:Name="DarkModeToggleSwitch"
DockPanel.Dock="Right"
IsChecked="{Binding IsDarkModeEnabled}"
IsCheckedChanged="DarkModeToggleSwitch_OnIsCheckedChanged" />
</DockPanel>
<!-- Persist token -->
<DockPanel
Margin="16,8"
LastChildFill="False"
ToolTip.Tip="Save the last used token to a file so that it can be persisted between sessions">
<TextBlock DockPanel.Dock="Left" Text="Persist token" />
<ToggleSwitch DockPanel.Dock="Right" IsChecked="{Binding IsTokenPersisted}" />
</DockPanel>
<!-- Thread inclusion mode -->
<DockPanel
Margin="16,8"
LastChildFill="False"
ToolTip.Tip="Which types of threads to show in the channel list">
<TextBlock DockPanel.Dock="Left" Text="Show threads" />
<ComboBox
Width="150"
DockPanel.Dock="Right"
ItemsSource="{Binding AvailableThreadInclusions}"
SelectedItem="{Binding ThreadInclusionMode}" />
</DockPanel>
<!-- Locale -->
<DockPanel
Margin="16,8"
LastChildFill="False"
ToolTip.Tip="Locale to use when formatting dates and numbers">
<TextBlock DockPanel.Dock="Left" Text="Locale" />
<ComboBox
Width="150"
DockPanel.Dock="Right"
ItemsSource="{Binding AvailableLocales}"
SelectedItem="{Binding Locale}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={x:Static converters:LocaleToDisplayNameStringConverter.Instance}}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</DockPanel>
<!-- UTC normalization -->
<DockPanel
Margin="16,8"
LastChildFill="False"
ToolTip.Tip="Normalize all timestamps to UTC+0">
<TextBlock DockPanel.Dock="Left" Text="Normalize to UTC" />
<ToggleSwitch DockPanel.Dock="Right" IsChecked="{Binding IsUtcNormalizationEnabled}" />
</DockPanel>
<!-- Parallel limit -->
<DockPanel
Margin="16,8"
LastChildFill="False"
ToolTip.Tip="How many channels can be exported at the same time">
<TextBlock DockPanel.Dock="Left" Text="Parallel limit" />
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
<TextBlock Margin="10,0" Text="{Binding ParallelLimit}" />
<Slider
Width="150"
IsSnapToTickEnabled="True"
Maximum="10"
Minimum="1"
TickFrequency="1"
Value="{Binding ParallelLimit}" />
</StackPanel>
</DockPanel>
</StackPanel>
</ScrollViewer>
</Border>
<!-- Close button -->
<Button
Grid.Row="2"
Margin="16"
HorizontalAlignment="Stretch"
Command="{Binding CloseCommand}"
Content="CLOSE"
IsCancel="True"
IsDefault="True"
Theme="{DynamicResource MaterialOutlineButton}" />
</Grid>
</UserControl>