Add configurable thread item sorting

This commit is contained in:
Burak Kaan Köse
2026-04-19 16:25:00 +02:00
parent bfbc3d40b3
commit 496c7735f7
9 changed files with 109 additions and 42 deletions
@@ -42,6 +42,12 @@ public partial class MessageListPageViewModel : MailBaseViewModel
Translator.HoverActionOption_MoveJunk
];
public List<string> ThreadItemSortingOptions { get; } =
[
Translator.SettingsThreadOrder_LastItemFirst,
Translator.SettingsThreadOrder_FirstItemFirst
];
public IMailItemDisplayInformation DemoPreviewMailItemInformation { get; } = new DemoMailItemDisplayInformation();
public MailListDisplayMode SelectedMailSpacingMode => availableMailSpacingOptions[selectedMailSpacingIndex];
@@ -73,6 +79,19 @@ public partial class MessageListPageViewModel : MailBaseViewModel
}
}
private int selectedThreadItemSortingIndex;
public int SelectedThreadItemSortingIndex
{
get => selectedThreadItemSortingIndex;
set
{
if (SetProperty(ref selectedThreadItemSortingIndex, value) && value >= 0)
{
PreferencesService.IsNewestThreadMailFirst = value == 0;
}
}
}
#region Properties
private int leftHoverActionIndex;
public int LeftHoverActionIndex
@@ -128,6 +147,7 @@ public partial class MessageListPageViewModel : MailBaseViewModel
rightHoverActionIndex = availableHoverActions.IndexOf(PreferencesService.RightHoverAction);
selectedMailSpacingIndex = availableMailSpacingOptions.IndexOf(PreferencesService.MailItemDisplayMode);
SelectedMarkAsOptionIndex = Array.IndexOf(Enum.GetValues<MailMarkAsOption>(), PreferencesService.MarkAsPreference);
selectedThreadItemSortingIndex = PreferencesService.IsNewestThreadMailFirst ? 0 : 1;
}
[RelayCommand]