Improve GUI

This commit is contained in:
Tyrrrz
2021-12-14 01:26:59 +02:00
parent 008bb2f591
commit 4389b4e0bc
6 changed files with 649 additions and 249 deletions

View File

@@ -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