diff --git a/DiscordChatExporter.Gui/App.xaml b/DiscordChatExporter.Gui/App.xaml index e2f65d17..34461e5d 100644 --- a/DiscordChatExporter.Gui/App.xaml +++ b/DiscordChatExporter.Gui/App.xaml @@ -75,17 +75,6 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DiscordChatExporter.Gui/ViewModels/Dialogs/ExportSetupViewModel.cs b/DiscordChatExporter.Gui/ViewModels/Dialogs/ExportSetupViewModel.cs index d45f12eb..2071b880 100644 --- a/DiscordChatExporter.Gui/ViewModels/Dialogs/ExportSetupViewModel.cs +++ b/DiscordChatExporter.Gui/ViewModels/Dialogs/ExportSetupViewModel.cs @@ -62,14 +62,7 @@ public class ExportSetupViewModel : DialogScreen public bool ShouldDownloadMedia { get; set; } - // Whether to show the "advanced options" by default when the dialog opens. - // 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 bool IsAdvancedSectionDisplayed { get; set; } public ExportSetupViewModel(DialogManager dialogManager, SettingsService settingsService) { @@ -81,8 +74,19 @@ public class ExportSetupViewModel : DialogScreen PartitionLimitValue = _settingsService.LastPartitionLimitValue; MessageFilterValue = _settingsService.LastMessageFilterValue; 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() { // Persist preferences diff --git a/DiscordChatExporter.Gui/Views/Dialogs/ExportSetupView.xaml b/DiscordChatExporter.Gui/Views/Dialogs/ExportSetupView.xaml index 70a8e349..9a5d624e 100644 --- a/DiscordChatExporter.Gui/Views/Dialogs/ExportSetupView.xaml +++ b/DiscordChatExporter.Gui/Views/Dialogs/ExportSetupView.xaml @@ -1,20 +1,26 @@  - + Width="380" + d:DataContext="{d:DesignInstance Type=dialogs:ExportSetupViewModel}" + Style="{DynamicResource MaterialDesignRoot}" + mc:Ignorable="d"> + + + + + + + - + @@ -23,8 +29,8 @@ + Width="32" + Height="32"> @@ -32,11 +38,12 @@ @@ -44,12 +51,12 @@ @@ -60,108 +67,126 @@ - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + - - + + - - - - - - + + - - - - + + + + + + + + + + + + + + - + @@ -169,31 +194,38 @@ - + Command="{s:Action ToggleAdvancedSection}" + IsDefault="True" + ToolTip="Toggle advanced options"> + + + +