mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-31 23:08:23 -04:00
Improve GUI
This commit is contained in:
parent
008bb2f591
commit
4389b4e0bc
6 changed files with 649 additions and 249 deletions
|
@ -75,17 +75,6 @@
|
||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style
|
|
||||||
x:Key="MaterialDesignFlatDarkButton"
|
|
||||||
BasedOn="{StaticResource MaterialDesignFlatButton}"
|
|
||||||
TargetType="{x:Type Button}">
|
|
||||||
<Style.Resources>
|
|
||||||
<SolidColorBrush x:Key="MaterialDesignFlatButtonClick" Color="#4C4C4C" />
|
|
||||||
</Style.Resources>
|
|
||||||
|
|
||||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryHueMidForegroundBrush}" />
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style
|
<Style
|
||||||
x:Key="MaterialDesignFlatActionToggleButton"
|
x:Key="MaterialDesignFlatActionToggleButton"
|
||||||
BasedOn="{StaticResource MaterialDesignActionToggleButton}"
|
BasedOn="{StaticResource MaterialDesignActionToggleButton}"
|
||||||
|
@ -183,6 +172,345 @@
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<!-- Use old MD style for slider, because the new one is too huge -->
|
||||||
|
<Style x:Key="MaterialDesignHorizontalTrackRepeatButton" TargetType="{x:Type RepeatButton}">
|
||||||
|
<Setter Property="OverridesDefaultStyle" Value="true" />
|
||||||
|
<Setter Property="Background" Value="Transparent" />
|
||||||
|
<Setter Property="Focusable" Value="false" />
|
||||||
|
<Setter Property="IsTabStop" Value="false" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="{x:Type RepeatButton}">
|
||||||
|
<Canvas
|
||||||
|
Width="{TemplateBinding Width}"
|
||||||
|
Height="{TemplateBinding Height}"
|
||||||
|
Background="Transparent">
|
||||||
|
<Rectangle
|
||||||
|
x:Name="PART_SelectionRange"
|
||||||
|
Canvas.Top="8"
|
||||||
|
Width="{TemplateBinding ActualWidth}"
|
||||||
|
Height="2.0"
|
||||||
|
Fill="{TemplateBinding Background}" />
|
||||||
|
</Canvas>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="MaterialDesignVerticalTrackRepeatButton" TargetType="{x:Type RepeatButton}">
|
||||||
|
<Setter Property="OverridesDefaultStyle" Value="true" />
|
||||||
|
<Setter Property="Background" Value="Transparent" />
|
||||||
|
<Setter Property="Focusable" Value="false" />
|
||||||
|
<Setter Property="IsTabStop" Value="false" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="{x:Type RepeatButton}">
|
||||||
|
<Canvas
|
||||||
|
Width="{TemplateBinding Width}"
|
||||||
|
Height="{TemplateBinding Height}"
|
||||||
|
Background="Transparent">
|
||||||
|
<Rectangle
|
||||||
|
x:Name="PART_SelectionRange"
|
||||||
|
Canvas.Left="8"
|
||||||
|
Width="2.0"
|
||||||
|
Height="{TemplateBinding ActualHeight}"
|
||||||
|
Fill="{TemplateBinding Background}" />
|
||||||
|
</Canvas>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<ControlTemplate x:Key="MaterialDesignSliderThumb" TargetType="{x:Type Thumb}">
|
||||||
|
<Grid
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
UseLayoutRounding="True">
|
||||||
|
<Ellipse
|
||||||
|
x:Name="shadow"
|
||||||
|
Width="24"
|
||||||
|
Height="24"
|
||||||
|
Margin="-12"
|
||||||
|
Fill="{TemplateBinding Foreground}"
|
||||||
|
Opacity=".0"
|
||||||
|
UseLayoutRounding="True" />
|
||||||
|
<Ellipse
|
||||||
|
x:Name="grip"
|
||||||
|
Width="12"
|
||||||
|
Height="12"
|
||||||
|
Fill="{TemplateBinding Foreground}"
|
||||||
|
RenderTransformOrigin=".5,.5"
|
||||||
|
UseLayoutRounding="True">
|
||||||
|
<Ellipse.RenderTransform>
|
||||||
|
<ScaleTransform ScaleX="1" ScaleY="1" />
|
||||||
|
</Ellipse.RenderTransform>
|
||||||
|
</Ellipse>
|
||||||
|
</Grid>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="true">
|
||||||
|
<Trigger.EnterActions>
|
||||||
|
<BeginStoryboard>
|
||||||
|
<Storyboard>
|
||||||
|
<DoubleAnimation
|
||||||
|
Storyboard.TargetName="shadow"
|
||||||
|
Storyboard.TargetProperty="Opacity"
|
||||||
|
To=".26"
|
||||||
|
Duration="0:0:0.2" />
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</Trigger.EnterActions>
|
||||||
|
<Trigger.ExitActions>
|
||||||
|
<BeginStoryboard>
|
||||||
|
<Storyboard>
|
||||||
|
<DoubleAnimation
|
||||||
|
Storyboard.TargetName="shadow"
|
||||||
|
Storyboard.TargetProperty="Opacity"
|
||||||
|
To=".0"
|
||||||
|
Duration="0:0:0.2" />
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</Trigger.ExitActions>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsDragging" Value="true">
|
||||||
|
<Trigger.EnterActions>
|
||||||
|
<BeginStoryboard>
|
||||||
|
<Storyboard>
|
||||||
|
<Storyboard>
|
||||||
|
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="grip" Storyboard.TargetProperty="RenderTransform.ScaleX">
|
||||||
|
<EasingDoubleKeyFrame KeyTime="0:0:0" Value="1" />
|
||||||
|
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1.5">
|
||||||
|
<EasingDoubleKeyFrame.EasingFunction>
|
||||||
|
<SineEase EasingMode="EaseInOut" />
|
||||||
|
</EasingDoubleKeyFrame.EasingFunction>
|
||||||
|
</EasingDoubleKeyFrame>
|
||||||
|
</DoubleAnimationUsingKeyFrames>
|
||||||
|
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="grip" Storyboard.TargetProperty="RenderTransform.ScaleY">
|
||||||
|
<EasingDoubleKeyFrame KeyTime="0:0:0" Value="1" />
|
||||||
|
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1.5">
|
||||||
|
<EasingDoubleKeyFrame.EasingFunction>
|
||||||
|
<SineEase EasingMode="EaseInOut" />
|
||||||
|
</EasingDoubleKeyFrame.EasingFunction>
|
||||||
|
</EasingDoubleKeyFrame>
|
||||||
|
</DoubleAnimationUsingKeyFrames>
|
||||||
|
</Storyboard>
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</Trigger.EnterActions>
|
||||||
|
<Trigger.ExitActions>
|
||||||
|
<BeginStoryboard>
|
||||||
|
<Storyboard>
|
||||||
|
<Storyboard>
|
||||||
|
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="grip" Storyboard.TargetProperty="RenderTransform.ScaleX">
|
||||||
|
<EasingDoubleKeyFrame KeyTime="0:0:0" Value="1.5" />
|
||||||
|
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1">
|
||||||
|
<EasingDoubleKeyFrame.EasingFunction>
|
||||||
|
<SineEase EasingMode="EaseInOut" />
|
||||||
|
</EasingDoubleKeyFrame.EasingFunction>
|
||||||
|
</EasingDoubleKeyFrame>
|
||||||
|
</DoubleAnimationUsingKeyFrames>
|
||||||
|
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="grip" Storyboard.TargetProperty="RenderTransform.ScaleY">
|
||||||
|
<EasingDoubleKeyFrame KeyTime="0:0:0" Value="1.5" />
|
||||||
|
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1">
|
||||||
|
<EasingDoubleKeyFrame.EasingFunction>
|
||||||
|
<SineEase EasingMode="EaseInOut" />
|
||||||
|
</EasingDoubleKeyFrame.EasingFunction>
|
||||||
|
</EasingDoubleKeyFrame>
|
||||||
|
</DoubleAnimationUsingKeyFrames>
|
||||||
|
</Storyboard>
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</Trigger.ExitActions>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsEnabled" Value="false">
|
||||||
|
<Setter TargetName="grip" Property="Fill" Value="{DynamicResource MaterialDesignCheckBoxDisabled}" />
|
||||||
|
<Setter TargetName="grip" Property="Stroke" Value="{DynamicResource MaterialDesignCheckBoxDisabled}" />
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
|
||||||
|
<ControlTemplate x:Key="MaterialDesignSliderHorizontal" TargetType="{x:Type Slider}">
|
||||||
|
<Border
|
||||||
|
x:Name="border"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
SnapsToDevicePixels="True">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TickBar
|
||||||
|
x:Name="TopTick"
|
||||||
|
Grid.Row="0"
|
||||||
|
Height="4"
|
||||||
|
Margin="0,0,0,2"
|
||||||
|
Fill="{TemplateBinding Foreground}"
|
||||||
|
Placement="Top"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<TickBar
|
||||||
|
x:Name="BottomTick"
|
||||||
|
Grid.Row="2"
|
||||||
|
Height="4"
|
||||||
|
Margin="0,2,0,0"
|
||||||
|
Fill="{TemplateBinding Foreground}"
|
||||||
|
Placement="Bottom"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<Rectangle
|
||||||
|
x:Name="PART_SelectionRange"
|
||||||
|
Grid.Row="1"
|
||||||
|
Height="4.0"
|
||||||
|
Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"
|
||||||
|
Visibility="Hidden" />
|
||||||
|
<Track
|
||||||
|
x:Name="PART_Track"
|
||||||
|
Grid.Row="1"
|
||||||
|
OpacityMask="{x:Null}">
|
||||||
|
<Track.DecreaseRepeatButton>
|
||||||
|
<RepeatButton
|
||||||
|
Background="{TemplateBinding Foreground}"
|
||||||
|
Command="{x:Static Slider.DecreaseLarge}"
|
||||||
|
Style="{StaticResource MaterialDesignHorizontalTrackRepeatButton}" />
|
||||||
|
</Track.DecreaseRepeatButton>
|
||||||
|
<Track.IncreaseRepeatButton>
|
||||||
|
<RepeatButton
|
||||||
|
x:Name="IncreaseRepeatButton"
|
||||||
|
Background="{DynamicResource MaterialDesignCheckBoxOff}"
|
||||||
|
Command="{x:Static Slider.IncreaseLarge}"
|
||||||
|
Style="{StaticResource MaterialDesignHorizontalTrackRepeatButton}" />
|
||||||
|
</Track.IncreaseRepeatButton>
|
||||||
|
<Track.Thumb>
|
||||||
|
<Thumb
|
||||||
|
x:Name="Thumb"
|
||||||
|
Width="12"
|
||||||
|
Height="18"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Focusable="False"
|
||||||
|
OverridesDefaultStyle="True"
|
||||||
|
Template="{StaticResource MaterialDesignSliderThumb}" />
|
||||||
|
</Track.Thumb>
|
||||||
|
</Track>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="TickPlacement" Value="TopLeft">
|
||||||
|
<Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="TickPlacement" Value="BottomRight">
|
||||||
|
<Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="TickPlacement" Value="Both">
|
||||||
|
<Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
|
||||||
|
<Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsSelectionRangeEnabled" Value="true">
|
||||||
|
<Setter TargetName="PART_SelectionRange" Property="Visibility" Value="Visible" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
|
<Setter TargetName="IncreaseRepeatButton" Property="Background" Value="{DynamicResource MaterialDesignCheckBoxDisabled}" />
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
|
||||||
|
<ControlTemplate x:Key="MaterialDesignSliderVertical" TargetType="{x:Type Slider}">
|
||||||
|
<Border
|
||||||
|
x:Name="border"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
SnapsToDevicePixels="True">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="Auto" MinWidth="{TemplateBinding MinWidth}" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TickBar
|
||||||
|
x:Name="TopTick"
|
||||||
|
Grid.Column="0"
|
||||||
|
Width="4"
|
||||||
|
Margin="0,0,2,0"
|
||||||
|
Fill="{TemplateBinding Foreground}"
|
||||||
|
Placement="Left"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<TickBar
|
||||||
|
x:Name="BottomTick"
|
||||||
|
Grid.Column="2"
|
||||||
|
Width="4"
|
||||||
|
Margin="2,0,0,0"
|
||||||
|
Fill="{TemplateBinding Foreground}"
|
||||||
|
Placement="Right"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<Rectangle
|
||||||
|
x:Name="PART_SelectionRange"
|
||||||
|
Grid.Column="1"
|
||||||
|
Height="4.0"
|
||||||
|
Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"
|
||||||
|
Visibility="Hidden" />
|
||||||
|
<Track x:Name="PART_Track" Grid.Column="1">
|
||||||
|
<Track.DecreaseRepeatButton>
|
||||||
|
<RepeatButton
|
||||||
|
Background="{TemplateBinding Foreground}"
|
||||||
|
Command="{x:Static Slider.DecreaseLarge}"
|
||||||
|
Style="{StaticResource MaterialDesignVerticalTrackRepeatButton}" />
|
||||||
|
</Track.DecreaseRepeatButton>
|
||||||
|
<Track.IncreaseRepeatButton>
|
||||||
|
<RepeatButton
|
||||||
|
x:Name="IncreaseRepeatButton"
|
||||||
|
Background="{DynamicResource MaterialDesignCheckBoxOff}"
|
||||||
|
Command="{x:Static Slider.IncreaseLarge}"
|
||||||
|
Style="{StaticResource MaterialDesignVerticalTrackRepeatButton}" />
|
||||||
|
</Track.IncreaseRepeatButton>
|
||||||
|
<Track.Thumb>
|
||||||
|
<Thumb
|
||||||
|
x:Name="Thumb"
|
||||||
|
Width="18"
|
||||||
|
Height="12"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Focusable="False"
|
||||||
|
OverridesDefaultStyle="True"
|
||||||
|
Template="{StaticResource MaterialDesignSliderThumb}" />
|
||||||
|
</Track.Thumb>
|
||||||
|
</Track>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="TickPlacement" Value="TopLeft">
|
||||||
|
<Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="TickPlacement" Value="BottomRight">
|
||||||
|
<Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="TickPlacement" Value="Both">
|
||||||
|
<Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
|
||||||
|
<Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsSelectionRangeEnabled" Value="true">
|
||||||
|
<Setter TargetName="PART_SelectionRange" Property="Visibility" Value="Visible" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
|
<Setter TargetName="IncreaseRepeatButton" Property="Background" Value="{DynamicResource MaterialDesignCheckBoxDisabled}" />
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
|
||||||
|
<Style x:Key="MaterialDesignThinSlider" TargetType="{x:Type Slider}">
|
||||||
|
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
|
||||||
|
<Setter Property="Background" Value="{x:Null}" />
|
||||||
|
<Setter Property="BorderBrush" Value="Transparent" />
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryHueMidBrush}" />
|
||||||
|
<Setter Property="Template" Value="{StaticResource MaterialDesignSliderHorizontal}" />
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="Orientation" Value="Vertical">
|
||||||
|
<Setter Property="Template" Value="{StaticResource MaterialDesignSliderVertical}" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource MaterialDesignCheckBoxDisabled}" />
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
</s:ApplicationLoader>
|
</s:ApplicationLoader>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
</Application>
|
</Application>
|
|
@ -62,14 +62,7 @@ public class ExportSetupViewModel : DialogScreen
|
||||||
|
|
||||||
public bool ShouldDownloadMedia { get; set; }
|
public bool ShouldDownloadMedia { get; set; }
|
||||||
|
|
||||||
// Whether to show the "advanced options" by default when the dialog opens.
|
public bool IsAdvancedSectionDisplayed { get; set; }
|
||||||
// This is active if any of the advanced options are set to non-default values.
|
|
||||||
public bool IsAdvancedSectionDisplayedByDefault =>
|
|
||||||
After != default ||
|
|
||||||
Before != default ||
|
|
||||||
!string.IsNullOrWhiteSpace(PartitionLimitValue) ||
|
|
||||||
!string.IsNullOrWhiteSpace(MessageFilterValue) ||
|
|
||||||
ShouldDownloadMedia != default;
|
|
||||||
|
|
||||||
public ExportSetupViewModel(DialogManager dialogManager, SettingsService settingsService)
|
public ExportSetupViewModel(DialogManager dialogManager, SettingsService settingsService)
|
||||||
{
|
{
|
||||||
|
@ -81,8 +74,19 @@ public class ExportSetupViewModel : DialogScreen
|
||||||
PartitionLimitValue = _settingsService.LastPartitionLimitValue;
|
PartitionLimitValue = _settingsService.LastPartitionLimitValue;
|
||||||
MessageFilterValue = _settingsService.LastMessageFilterValue;
|
MessageFilterValue = _settingsService.LastMessageFilterValue;
|
||||||
ShouldDownloadMedia = _settingsService.LastShouldDownloadMedia;
|
ShouldDownloadMedia = _settingsService.LastShouldDownloadMedia;
|
||||||
|
|
||||||
|
// Show the "advanced options" by default if any
|
||||||
|
// of the advanced options are set to non-default values.
|
||||||
|
IsAdvancedSectionDisplayed =
|
||||||
|
After != default ||
|
||||||
|
Before != default ||
|
||||||
|
!string.IsNullOrWhiteSpace(PartitionLimitValue) ||
|
||||||
|
!string.IsNullOrWhiteSpace(MessageFilterValue) ||
|
||||||
|
ShouldDownloadMedia != default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ToggleAdvancedSection() => IsAdvancedSectionDisplayed = !IsAdvancedSectionDisplayed;
|
||||||
|
|
||||||
public void Confirm()
|
public void Confirm()
|
||||||
{
|
{
|
||||||
// Persist preferences
|
// Persist preferences
|
||||||
|
|
|
@ -1,20 +1,26 @@
|
||||||
<UserControl
|
<UserControl
|
||||||
Style="{DynamicResource MaterialDesignRoot}"
|
|
||||||
Width="380"
|
|
||||||
d:DataContext="{d:DesignInstance Type=dialogs:ExportSetupViewModel}"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
x:Class="DiscordChatExporter.Gui.Views.Dialogs.ExportSetupView"
|
x:Class="DiscordChatExporter.Gui.Views.Dialogs.ExportSetupView"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:converters="clr-namespace:DiscordChatExporter.Gui.Converters"
|
xmlns:converters="clr-namespace:DiscordChatExporter.Gui.Converters"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:dialogs="clr-namespace:DiscordChatExporter.Gui.ViewModels.Dialogs"
|
xmlns:dialogs="clr-namespace:DiscordChatExporter.Gui.ViewModels.Dialogs"
|
||||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:s="https://github.com/canton7/Stylet"
|
xmlns:s="https://github.com/canton7/Stylet"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
Width="380"
|
||||||
<StackPanel>
|
d:DataContext="{d:DesignInstance Type=dialogs:ExportSetupViewModel}"
|
||||||
|
Style="{DynamicResource MaterialDesignRoot}"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Guild/channel info -->
|
<!-- Guild/channel info -->
|
||||||
<Grid Margin="16">
|
<Grid Grid.Row="0" Margin="16">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
|
@ -23,8 +29,8 @@
|
||||||
<!-- Guild icon -->
|
<!-- Guild icon -->
|
||||||
<Ellipse
|
<Ellipse
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Height="32"
|
Width="32"
|
||||||
Width="32">
|
Height="32">
|
||||||
<Ellipse.Fill>
|
<Ellipse.Fill>
|
||||||
<ImageBrush ImageSource="{Binding Guild.IconUrl}" />
|
<ImageBrush ImageSource="{Binding Guild.IconUrl}" />
|
||||||
</Ellipse.Fill>
|
</Ellipse.Fill>
|
||||||
|
@ -32,11 +38,12 @@
|
||||||
|
|
||||||
<!-- Placeholder (for multiple channels) -->
|
<!-- Placeholder (for multiple channels) -->
|
||||||
<TextBlock
|
<TextBlock
|
||||||
FontSize="19"
|
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="8,0,0,0"
|
Margin="8,0,0,0"
|
||||||
TextTrimming="CharacterEllipsis"
|
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
FontSize="19"
|
||||||
|
FontWeight="Light"
|
||||||
|
TextTrimming="CharacterEllipsis"
|
||||||
Visibility="{Binding IsSingleChannel, Converter={x:Static s:BoolToVisibilityConverter.InverseInstance}}">
|
Visibility="{Binding IsSingleChannel, Converter={x:Static s:BoolToVisibilityConverter.InverseInstance}}">
|
||||||
<Run Text="{Binding Channels.Count, Mode=OneWay}" />
|
<Run Text="{Binding Channels.Count, Mode=OneWay}" />
|
||||||
<Run Text="channels selected" />
|
<Run Text="channels selected" />
|
||||||
|
@ -44,12 +51,12 @@
|
||||||
|
|
||||||
<!-- Category and channel name (for single channel) -->
|
<!-- Category and channel name (for single channel) -->
|
||||||
<TextBlock
|
<TextBlock
|
||||||
FontSize="19"
|
|
||||||
FontWeight="Light"
|
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="8,0,0,0"
|
Margin="8,0,0,0"
|
||||||
TextTrimming="CharacterEllipsis"
|
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
FontSize="19"
|
||||||
|
FontWeight="Light"
|
||||||
|
TextTrimming="CharacterEllipsis"
|
||||||
Visibility="{Binding IsSingleChannel, Converter={x:Static s:BoolToVisibilityConverter.Instance}}">
|
Visibility="{Binding IsSingleChannel, Converter={x:Static s:BoolToVisibilityConverter.Instance}}">
|
||||||
<Run Text="{Binding Channels[0].Category.Name, Mode=OneWay}" ToolTip="{Binding Channels[0].Category.Name, Mode=OneWay}" />
|
<Run Text="{Binding Channels[0].Category.Name, Mode=OneWay}" ToolTip="{Binding Channels[0].Category.Name, Mode=OneWay}" />
|
||||||
<Run Text="/" />
|
<Run Text="/" />
|
||||||
|
@ -60,108 +67,126 @@
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<!-- Format -->
|
<Border
|
||||||
<ComboBox
|
Grid.Row="1"
|
||||||
IsReadOnly="True"
|
Padding="0,8"
|
||||||
ItemsSource="{Binding AvailableFormats}"
|
BorderBrush="{DynamicResource MaterialDesignDivider}"
|
||||||
Margin="16,8"
|
BorderThickness="0,1">
|
||||||
SelectedItem="{Binding SelectedFormat}"
|
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
|
||||||
materialDesign:HintAssist.Hint="Format"
|
<StackPanel>
|
||||||
materialDesign:HintAssist.IsFloating="True">
|
<!-- Format -->
|
||||||
<ComboBox.ItemTemplate>
|
<ComboBox
|
||||||
<DataTemplate>
|
Margin="16,8"
|
||||||
<TextBlock Text="{Binding Converter={x:Static converters:ExportFormatToStringConverter.Instance}}" />
|
materialDesign:HintAssist.Hint="Format"
|
||||||
</DataTemplate>
|
materialDesign:HintAssist.IsFloating="True"
|
||||||
</ComboBox.ItemTemplate>
|
IsReadOnly="True"
|
||||||
</ComboBox>
|
ItemsSource="{Binding AvailableFormats}"
|
||||||
|
SelectedItem="{Binding SelectedFormat}"
|
||||||
|
Style="{DynamicResource MaterialDesignOutlinedComboBox}">
|
||||||
|
<ComboBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding Converter={x:Static converters:ExportFormatToStringConverter.Instance}}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</ComboBox.ItemTemplate>
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
<!-- Advanced section -->
|
<!-- Advanced section -->
|
||||||
<StackPanel Visibility="{Binding IsChecked, ElementName=AdvancedSectionToggleButton, Converter={x:Static s:BoolToVisibilityConverter.Instance}}">
|
<StackPanel Visibility="{Binding IsAdvancedSectionDisplayed, Converter={x:Static s:BoolToVisibilityConverter.Instance}}">
|
||||||
<!-- Date limits -->
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<DatePicker
|
|
||||||
DisplayDateEnd="{Binding BeforeDate, Converter={x:Static converters:DateTimeOffsetToDateTimeConverter.Instance}}"
|
|
||||||
Grid.Column="0"
|
|
||||||
Grid.Row="0"
|
|
||||||
Margin="16,8,16,4"
|
|
||||||
SelectedDate="{Binding AfterDate, Converter={x:Static converters:DateTimeOffsetToDateTimeConverter.Instance}}"
|
|
||||||
ToolTip="Only include messages sent after this date"
|
|
||||||
materialDesign:HintAssist.Hint="After (date)"
|
|
||||||
materialDesign:HintAssist.IsFloating="True" />
|
|
||||||
<DatePicker
|
|
||||||
DisplayDateStart="{Binding AfterDate, Converter={x:Static converters:DateTimeOffsetToDateTimeConverter.Instance}}"
|
|
||||||
Grid.Column="1"
|
|
||||||
Grid.Row="0"
|
|
||||||
Margin="16,8,16,4"
|
|
||||||
SelectedDate="{Binding BeforeDate, Converter={x:Static converters:DateTimeOffsetToDateTimeConverter.Instance}}"
|
|
||||||
ToolTip="Only include messages sent before this date"
|
|
||||||
materialDesign:HintAssist.Hint="Before (date)"
|
|
||||||
materialDesign:HintAssist.IsFloating="True" />
|
|
||||||
<materialDesign:TimePicker
|
|
||||||
Grid.Column="0"
|
|
||||||
Grid.Row="1"
|
|
||||||
IsEnabled="{Binding IsAfterDateSet}"
|
|
||||||
Margin="16,4,16,8"
|
|
||||||
SelectedTime="{Binding AfterTime, Converter={x:Static converters:TimeSpanToDateTimeConverter.Instance}}"
|
|
||||||
ToolTip="Only include messages sent after this time"
|
|
||||||
materialDesign:HintAssist.Hint="After (time)"
|
|
||||||
materialDesign:HintAssist.IsFloating="True" />
|
|
||||||
<materialDesign:TimePicker
|
|
||||||
Grid.Column="1"
|
|
||||||
Grid.Row="1"
|
|
||||||
IsEnabled="{Binding IsBeforeDateSet}"
|
|
||||||
Margin="16,4,16,8"
|
|
||||||
SelectedTime="{Binding BeforeTime, Converter={x:Static converters:TimeSpanToDateTimeConverter.Instance}}"
|
|
||||||
ToolTip="Only include messages sent before this time"
|
|
||||||
materialDesign:HintAssist.Hint="Before (time)"
|
|
||||||
materialDesign:HintAssist.IsFloating="True" />
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<!-- Partitioning -->
|
<!-- Date limits -->
|
||||||
<TextBox
|
<Grid>
|
||||||
Margin="16,8"
|
<Grid.ColumnDefinitions>
|
||||||
Text="{Binding PartitionLimitValue}"
|
<ColumnDefinition Width="*" />
|
||||||
ToolTip="Split output into partitions, each limited to this number of messages (e.g. '100') or file size (e.g. '10mb')"
|
<ColumnDefinition Width="*" />
|
||||||
materialDesign:HintAssist.Hint="Partition limit"
|
</Grid.ColumnDefinitions>
|
||||||
materialDesign:HintAssist.IsFloating="True" />
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<DatePicker
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="16,8,16,4"
|
||||||
|
materialDesign:HintAssist.Hint="After (date)"
|
||||||
|
materialDesign:HintAssist.IsFloating="True"
|
||||||
|
DisplayDateEnd="{Binding BeforeDate, Converter={x:Static converters:DateTimeOffsetToDateTimeConverter.Instance}}"
|
||||||
|
SelectedDate="{Binding AfterDate, Converter={x:Static converters:DateTimeOffsetToDateTimeConverter.Instance}}"
|
||||||
|
Style="{DynamicResource MaterialDesignOutlinedDatePicker}"
|
||||||
|
ToolTip="Only include messages sent after this date" />
|
||||||
|
<DatePicker
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="16,8,16,4"
|
||||||
|
materialDesign:HintAssist.Hint="Before (date)"
|
||||||
|
materialDesign:HintAssist.IsFloating="True"
|
||||||
|
DisplayDateStart="{Binding AfterDate, Converter={x:Static converters:DateTimeOffsetToDateTimeConverter.Instance}}"
|
||||||
|
SelectedDate="{Binding BeforeDate, Converter={x:Static converters:DateTimeOffsetToDateTimeConverter.Instance}}"
|
||||||
|
Style="{DynamicResource MaterialDesignOutlinedDatePicker}"
|
||||||
|
ToolTip="Only include messages sent before this date" />
|
||||||
|
<materialDesign:TimePicker
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="16,4,16,8"
|
||||||
|
materialDesign:HintAssist.Hint="After (time)"
|
||||||
|
materialDesign:HintAssist.IsFloating="True"
|
||||||
|
IsEnabled="{Binding IsAfterDateSet}"
|
||||||
|
SelectedTime="{Binding AfterTime, Converter={x:Static converters:TimeSpanToDateTimeConverter.Instance}}"
|
||||||
|
Style="{DynamicResource MaterialDesignOutlinedTimePicker}"
|
||||||
|
ToolTip="Only include messages sent after this time" />
|
||||||
|
<materialDesign:TimePicker
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="16,4,16,8"
|
||||||
|
materialDesign:HintAssist.Hint="Before (time)"
|
||||||
|
materialDesign:HintAssist.IsFloating="True"
|
||||||
|
IsEnabled="{Binding IsBeforeDateSet}"
|
||||||
|
SelectedTime="{Binding BeforeTime, Converter={x:Static converters:TimeSpanToDateTimeConverter.Instance}}"
|
||||||
|
Style="{DynamicResource MaterialDesignOutlinedTimePicker}"
|
||||||
|
ToolTip="Only include messages sent before this time" />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<!-- Filtering -->
|
<!-- Partitioning -->
|
||||||
<TextBox
|
<TextBox
|
||||||
Margin="16,8"
|
Margin="16,8"
|
||||||
Text="{Binding MessageFilterValue}"
|
materialDesign:HintAssist.Hint="Partition limit"
|
||||||
ToolTip="Only include messages that satisfy this filter (e.g. 'from:foo#1234' or 'has:image')."
|
materialDesign:HintAssist.IsFloating="True"
|
||||||
materialDesign:HintAssist.Hint="Message filter"
|
Style="{DynamicResource MaterialDesignOutlinedTextBox}"
|
||||||
materialDesign:HintAssist.IsFloating="True" />
|
Text="{Binding PartitionLimitValue}"
|
||||||
|
ToolTip="Split output into partitions, each limited to this number of messages (e.g. '100') or file size (e.g. '10mb')" />
|
||||||
|
|
||||||
<!-- Download media -->
|
<!-- Filtering -->
|
||||||
<Grid Margin="16,16" ToolTip="Download referenced media content (user avatars, attached files, embedded images, etc)">
|
<TextBox
|
||||||
<Grid.ColumnDefinitions>
|
Margin="16,8"
|
||||||
<ColumnDefinition Width="*" />
|
materialDesign:HintAssist.Hint="Message filter"
|
||||||
<ColumnDefinition Width="Auto" />
|
materialDesign:HintAssist.IsFloating="True"
|
||||||
</Grid.ColumnDefinitions>
|
Style="{DynamicResource MaterialDesignOutlinedTextBox}"
|
||||||
|
Text="{Binding MessageFilterValue}"
|
||||||
|
ToolTip="Only include messages that satisfy this filter (e.g. 'from:foo#1234' or 'has:image')." />
|
||||||
|
|
||||||
<TextBlock
|
<!-- Download media -->
|
||||||
Grid.Column="0"
|
<Grid Margin="16,16" ToolTip="Download referenced media content (user avatars, attached files, embedded images, etc)">
|
||||||
Text="Download media"
|
<Grid.ColumnDefinitions>
|
||||||
VerticalAlignment="Center" />
|
<ColumnDefinition Width="*" />
|
||||||
<ToggleButton
|
<ColumnDefinition Width="Auto" />
|
||||||
Grid.Column="1"
|
</Grid.ColumnDefinitions>
|
||||||
HorizontalAlignment="Right"
|
|
||||||
IsChecked="{Binding ShouldDownloadMedia}"
|
<TextBlock
|
||||||
VerticalAlignment="Center" />
|
Grid.Column="0"
|
||||||
</Grid>
|
VerticalAlignment="Center"
|
||||||
</StackPanel>
|
Text="Download media" />
|
||||||
|
<ToggleButton
|
||||||
|
Grid.Column="1"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
IsChecked="{Binding ShouldDownloadMedia}" />
|
||||||
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Border>
|
||||||
|
|
||||||
<!-- Buttons -->
|
<!-- Buttons -->
|
||||||
<Grid>
|
<Grid Grid.Row="2" Margin="16">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
|
@ -169,31 +194,38 @@
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<ToggleButton
|
<Button
|
||||||
Cursor="Hand"
|
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Height="24"
|
Command="{s:Action ToggleAdvancedSection}"
|
||||||
IsChecked="{Binding IsAdvancedSectionDisplayedByDefault, Mode=OneTime}"
|
IsDefault="True"
|
||||||
Margin="12"
|
ToolTip="Toggle advanced options">
|
||||||
Style="{DynamicResource MaterialDesignHamburgerToggleButton}"
|
<Button.Style>
|
||||||
ToolTip="Toggle advanced options"
|
<Style BasedOn="{StaticResource MaterialDesignOutlinedButton}" TargetType="{x:Type Button}">
|
||||||
Width="24"
|
<Style.Triggers>
|
||||||
x:Name="AdvancedSectionToggleButton" />
|
<DataTrigger Binding="{Binding IsAdvancedSectionDisplayed}" Value="False">
|
||||||
|
<Setter Property="Content" Value="MORE" />
|
||||||
|
</DataTrigger>
|
||||||
|
<DataTrigger Binding="{Binding IsAdvancedSectionDisplayed}" Value="True">
|
||||||
|
<Setter Property="Content" Value="LESS" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</Button.Style>
|
||||||
|
</Button>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
Grid.Column="2"
|
||||||
Command="{s:Action Confirm}"
|
Command="{s:Action Confirm}"
|
||||||
Content="EXPORT"
|
Content="EXPORT"
|
||||||
Grid.Column="2"
|
|
||||||
IsDefault="True"
|
IsDefault="True"
|
||||||
Margin="8"
|
Style="{DynamicResource MaterialDesignOutlinedButton}" />
|
||||||
Style="{DynamicResource MaterialDesignFlatButton}" />
|
|
||||||
<Button
|
<Button
|
||||||
|
Grid.Column="3"
|
||||||
|
Margin="8,0,0,0"
|
||||||
Command="{s:Action Close}"
|
Command="{s:Action Close}"
|
||||||
Content="CANCEL"
|
Content="CANCEL"
|
||||||
Grid.Column="3"
|
|
||||||
IsCancel="True"
|
IsCancel="True"
|
||||||
Margin="8"
|
Style="{DynamicResource MaterialDesignOutlinedButton}" />
|
||||||
Style="{DynamicResource MaterialDesignFlatButton}" />
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
|
@ -8,8 +8,6 @@
|
||||||
xmlns:s="https://github.com/canton7/Stylet"
|
xmlns:s="https://github.com/canton7/Stylet"
|
||||||
MinWidth="500"
|
MinWidth="500"
|
||||||
d:DataContext="{d:DesignInstance Type=dialogs:MessageBoxViewModel}"
|
d:DataContext="{d:DesignInstance Type=dialogs:MessageBoxViewModel}"
|
||||||
d:DesignHeight="450"
|
|
||||||
d:DesignWidth="800"
|
|
||||||
Style="{DynamicResource MaterialDesignRoot}"
|
Style="{DynamicResource MaterialDesignRoot}"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<Grid>
|
<Grid>
|
||||||
|
@ -23,27 +21,35 @@
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Margin="16"
|
Margin="16"
|
||||||
FontSize="17"
|
FontSize="19"
|
||||||
|
FontWeight="Light"
|
||||||
Text="{Binding Title}"
|
Text="{Binding Title}"
|
||||||
TextTrimming="CharacterEllipsis"
|
TextTrimming="CharacterEllipsis"
|
||||||
ToolTip="{Binding Title}" />
|
ToolTip="{Binding Title}" />
|
||||||
|
|
||||||
<!-- Message -->
|
<!-- Message -->
|
||||||
<TextBlock
|
<Border
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="16,0,16,16"
|
Padding="0,8"
|
||||||
Text="{Binding Message}"
|
BorderBrush="{DynamicResource MaterialDesignDivider}"
|
||||||
TextWrapping="Wrap" />
|
BorderThickness="0,1">
|
||||||
|
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
|
||||||
|
<TextBlock
|
||||||
|
Margin="16,0,16,16"
|
||||||
|
Text="{Binding Message}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</ScrollViewer>
|
||||||
|
</Border>
|
||||||
|
|
||||||
<!-- Close -->
|
<!-- Close -->
|
||||||
<Button
|
<Button
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Margin="8"
|
Margin="16"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Stretch"
|
||||||
Command="{s:Action Close}"
|
Command="{s:Action Close}"
|
||||||
Content="CLOSE"
|
Content="CLOSE"
|
||||||
IsCancel="True"
|
IsCancel="True"
|
||||||
IsDefault="True"
|
IsDefault="True"
|
||||||
Style="{DynamicResource MaterialDesignFlatButton}" />
|
Style="{DynamicResource MaterialDesignOutlinedButton}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
|
@ -4,113 +4,143 @@
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:dialogs="clr-namespace:DiscordChatExporter.Gui.ViewModels.Dialogs"
|
xmlns:dialogs="clr-namespace:DiscordChatExporter.Gui.ViewModels.Dialogs"
|
||||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:s="https://github.com/canton7/Stylet"
|
xmlns:s="https://github.com/canton7/Stylet"
|
||||||
Width="310"
|
Width="310"
|
||||||
d:DataContext="{d:DesignInstance Type=dialogs:SettingsViewModel}"
|
d:DataContext="{d:DesignInstance Type=dialogs:SettingsViewModel}"
|
||||||
Style="{DynamicResource MaterialDesignRoot}"
|
Style="{DynamicResource MaterialDesignRoot}"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<StackPanel>
|
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
|
||||||
<TextBlock
|
<StackPanel>
|
||||||
Margin="16"
|
|
||||||
FontSize="17"
|
|
||||||
Text="Settings" />
|
|
||||||
|
|
||||||
<!-- Auto-updates -->
|
|
||||||
<DockPanel
|
|
||||||
Background="Transparent"
|
|
||||||
LastChildFill="False"
|
|
||||||
ToolTip="Perform automatic updates on every launch">
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="16,8"
|
Margin="16,16,16,8"
|
||||||
DockPanel.Dock="Left"
|
FontSize="19"
|
||||||
Text="Auto-updates" />
|
FontWeight="Light"
|
||||||
<ToggleButton
|
Text="Settings" />
|
||||||
Margin="16,8"
|
|
||||||
DockPanel.Dock="Right"
|
|
||||||
IsChecked="{Binding IsAutoUpdateEnabled}" />
|
|
||||||
</DockPanel>
|
|
||||||
|
|
||||||
<!-- Dark mode -->
|
<!-- Auto-updates -->
|
||||||
<DockPanel
|
<DockPanel
|
||||||
Background="Transparent"
|
|
||||||
LastChildFill="False"
|
|
||||||
ToolTip="Use darker colors in the UI">
|
|
||||||
<TextBlock
|
|
||||||
Margin="16,8"
|
Margin="16,8"
|
||||||
DockPanel.Dock="Left"
|
Background="Transparent"
|
||||||
Text="Dark mode" />
|
LastChildFill="False"
|
||||||
<ToggleButton
|
ToolTip="Perform automatic updates on every launch">
|
||||||
x:Name="DarkModeToggleButton"
|
<TextBlock
|
||||||
Margin="16,8"
|
VerticalAlignment="Center"
|
||||||
Checked="DarkModeToggleButton_Checked"
|
DockPanel.Dock="Left"
|
||||||
DockPanel.Dock="Right"
|
Text="Auto-updates" />
|
||||||
IsChecked="{Binding IsDarkModeEnabled}"
|
<ToggleButton
|
||||||
Unchecked="DarkModeToggleButton_Unchecked" />
|
VerticalAlignment="Center"
|
||||||
</DockPanel>
|
DockPanel.Dock="Right"
|
||||||
|
IsChecked="{Binding IsAutoUpdateEnabled}" />
|
||||||
|
</DockPanel>
|
||||||
|
|
||||||
<!-- Persist token -->
|
<!-- Dark mode -->
|
||||||
<DockPanel
|
<DockPanel
|
||||||
Background="Transparent"
|
|
||||||
LastChildFill="False"
|
|
||||||
ToolTip="Persist last used token between sessions">
|
|
||||||
<TextBlock
|
|
||||||
Margin="16,8"
|
Margin="16,8"
|
||||||
DockPanel.Dock="Left"
|
Background="Transparent"
|
||||||
Text="Save token" />
|
LastChildFill="False"
|
||||||
<ToggleButton
|
ToolTip="Use darker colors in the UI">
|
||||||
Margin="16,8"
|
<TextBlock
|
||||||
DockPanel.Dock="Right"
|
VerticalAlignment="Center"
|
||||||
IsChecked="{Binding IsTokenPersisted}" />
|
DockPanel.Dock="Left"
|
||||||
</DockPanel>
|
Text="Dark mode" />
|
||||||
|
<ToggleButton
|
||||||
|
x:Name="DarkModeToggleButton"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Checked="DarkModeToggleButton_Checked"
|
||||||
|
DockPanel.Dock="Right"
|
||||||
|
IsChecked="{Binding IsDarkModeEnabled}"
|
||||||
|
Unchecked="DarkModeToggleButton_Unchecked" />
|
||||||
|
</DockPanel>
|
||||||
|
|
||||||
<!-- Reuse media -->
|
<!-- Persist token -->
|
||||||
<DockPanel
|
<DockPanel
|
||||||
Background="Transparent"
|
|
||||||
LastChildFill="False"
|
|
||||||
ToolTip="Reuse already existing media content to skip redundant downloads">
|
|
||||||
<TextBlock
|
|
||||||
Margin="16,8"
|
Margin="16,8"
|
||||||
DockPanel.Dock="Left"
|
Background="Transparent"
|
||||||
Text="Reuse downloaded media" />
|
LastChildFill="False"
|
||||||
<ToggleButton
|
ToolTip="Save last used token in a file so that it can be persisted between sessions">
|
||||||
|
<TextBlock
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
DockPanel.Dock="Left"
|
||||||
|
Text="Save token" />
|
||||||
|
<ToggleButton
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
DockPanel.Dock="Right"
|
||||||
|
IsChecked="{Binding IsTokenPersisted}" />
|
||||||
|
</DockPanel>
|
||||||
|
|
||||||
|
<!-- Reuse media -->
|
||||||
|
<DockPanel
|
||||||
Margin="16,8"
|
Margin="16,8"
|
||||||
DockPanel.Dock="Right"
|
Background="Transparent"
|
||||||
IsChecked="{Binding ShouldReuseMedia}" />
|
LastChildFill="False"
|
||||||
</DockPanel>
|
ToolTip="Reuse already existing media content to skip redundant downloads">
|
||||||
|
<TextBlock
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
DockPanel.Dock="Left"
|
||||||
|
Text="Reuse downloaded media" />
|
||||||
|
<ToggleButton
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
DockPanel.Dock="Right"
|
||||||
|
IsChecked="{Binding ShouldReuseMedia}" />
|
||||||
|
</DockPanel>
|
||||||
|
|
||||||
<!-- Date format -->
|
<!-- Date format -->
|
||||||
<TextBox
|
<DockPanel
|
||||||
Margin="16,8"
|
Margin="16,8"
|
||||||
materialDesign:HintAssist.Hint="Date format"
|
Background="Transparent"
|
||||||
materialDesign:HintAssist.IsFloating="True"
|
LastChildFill="False"
|
||||||
Text="{Binding DateFormat}"
|
ToolTip="Format used when writing dates (uses .NET date formatting rules)">
|
||||||
ToolTip="Format used when writing dates (uses .NET date formatting rules)" />
|
<TextBlock
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
DockPanel.Dock="Left"
|
||||||
|
Text="Date format" />
|
||||||
|
<TextBox
|
||||||
|
Width="150"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
DockPanel.Dock="Right"
|
||||||
|
Text="{Binding DateFormat}" />
|
||||||
|
</DockPanel>
|
||||||
|
|
||||||
<!-- Parallel limit -->
|
<!-- Parallel limit -->
|
||||||
<StackPanel Background="Transparent" ToolTip="How many channels can be exported at the same time">
|
<DockPanel
|
||||||
<TextBlock Margin="16,8,16,4">
|
Margin="16,8"
|
||||||
<Run Text="Parallel limit:" />
|
Background="Transparent"
|
||||||
<Run Text="{Binding ParallelLimit, Mode=OneWay}" />
|
LastChildFill="False"
|
||||||
</TextBlock>
|
ToolTip="How many channels can be exported at the same time">
|
||||||
<Slider
|
<TextBlock
|
||||||
Margin="16,4,16,8"
|
VerticalAlignment="Center"
|
||||||
IsSnapToTickEnabled="True"
|
DockPanel.Dock="Left"
|
||||||
Maximum="10"
|
Text="Parallel limit"
|
||||||
Minimum="1"
|
TextAlignment="Right" />
|
||||||
TickFrequency="1"
|
<StackPanel
|
||||||
Value="{Binding ParallelLimit}" />
|
VerticalAlignment="Center"
|
||||||
|
DockPanel.Dock="Right"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
Margin="10,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontWeight="SemiBold"
|
||||||
|
Text="{Binding ParallelLimit}" />
|
||||||
|
<Slider
|
||||||
|
Width="150"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Maximum="10"
|
||||||
|
Minimum="1"
|
||||||
|
Style="{DynamicResource MaterialDesignThinSlider}"
|
||||||
|
Value="{Binding ParallelLimit}" />
|
||||||
|
</StackPanel>
|
||||||
|
</DockPanel>
|
||||||
|
|
||||||
|
<!-- Save button -->
|
||||||
|
<Button
|
||||||
|
Margin="16"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Command="{s:Action Close}"
|
||||||
|
Content="SAVE"
|
||||||
|
IsCancel="True"
|
||||||
|
IsDefault="True"
|
||||||
|
Style="{DynamicResource MaterialDesignOutlinedButton}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
<!-- Save button -->
|
|
||||||
<Button
|
|
||||||
Margin="8"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Command="{s:Action Close}"
|
|
||||||
Content="SAVE"
|
|
||||||
IsCancel="True"
|
|
||||||
IsDefault="True"
|
|
||||||
Style="{DynamicResource MaterialDesignFlatButton}" />
|
|
||||||
</StackPanel>
|
|
||||||
</UserControl>
|
</UserControl>
|
|
@ -69,7 +69,7 @@
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="6"
|
Margin="6"
|
||||||
IsChecked="{Binding IsBotToken}"
|
IsChecked="{Binding IsBotToken}"
|
||||||
Style="{StaticResource MaterialDesignFlatActionToggleButton}"
|
Style="{DynamicResource MaterialDesignFlatActionToggleButton}"
|
||||||
ToolTip="Switch between user token and bot token">
|
ToolTip="Switch between user token and bot token">
|
||||||
<ToggleButton.Content>
|
<ToggleButton.Content>
|
||||||
<materialDesign:PackIcon
|
<materialDesign:PackIcon
|
||||||
|
@ -380,7 +380,7 @@
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Command="{s:Action ExportChannels}"
|
Command="{s:Action ExportChannels}"
|
||||||
Style="{StaticResource MaterialDesignFloatingActionAccentButton}"
|
Style="{DynamicResource MaterialDesignFloatingActionAccentButton}"
|
||||||
Visibility="{Binding CanExportChannels, Converter={x:Static s:BoolToVisibilityConverter.Instance}}">
|
Visibility="{Binding CanExportChannels, Converter={x:Static s:BoolToVisibilityConverter.Instance}}">
|
||||||
<materialDesign:PackIcon
|
<materialDesign:PackIcon
|
||||||
Width="32"
|
Width="32"
|
||||||
|
@ -393,4 +393,4 @@
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</materialDesign:DialogHost>
|
</materialDesign:DialogHost>
|
||||||
</Window>
|
</Window>
|
Loading…
Add table
Add a link
Reference in a new issue