Account colors + edit account details. (#592)

* Remove account rename dialog. Implement edit account details page.

* Remove unused folder definition.

* Adressing theming issues and adding reset button. Changing the UI a bit.

* Enable auto indent in initializer. Use service from the application.

* Adding color picker to acc setup dialog. Changing UI of edit acc details page.
This commit is contained in:
Burak Kaan Köse
2025-03-01 01:17:04 +01:00
committed by GitHub
parent 6080646e89
commit 8ecf301eb8
29 changed files with 464 additions and 135 deletions

View File

@@ -13,7 +13,6 @@ using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.Navigation;
using Wino.Messaging.Client.Navigation;
using Wino.Messaging.Server;
using Wino.Messaging.UI;
namespace Wino.Mail.ViewModels;
@@ -23,6 +22,7 @@ public partial class AccountDetailsPageViewModel : MailBaseViewModel
private readonly IAccountService _accountService;
private readonly IWinoServerConnectionManager _serverConnectionManager;
private readonly IFolderService _folderService;
private bool isLoaded = false;
public MailAccount Account { get; set; }
public ObservableCollection<IMailItemFolder> CurrentFolders { get; set; } = [];
@@ -78,20 +78,8 @@ public partial class AccountDetailsPageViewModel : MailBaseViewModel
=> _folderService.ChangeFolderShowUnreadCountStateAsync(folderStructure.Id, isEnabled);
[RelayCommand]
private async Task RenameAccount()
{
if (Account == null)
return;
var updatedAccount = await _dialogService.ShowEditAccountDialogAsync(Account);
if (updatedAccount != null)
{
await _accountService.UpdateAccountAsync(updatedAccount);
ReportUIChange(new AccountUpdatedMessage(updatedAccount));
}
}
private void EditAccountDetails()
=> Messenger.Send(new BreadcrumbNavigationRequested(Translator.SettingsEditAccountDetails_Title, WinoPage.EditAccountDetailsPage, Account));
[RelayCommand]
private async Task DeleteAccount()
@@ -119,6 +107,9 @@ public partial class AccountDetailsPageViewModel : MailBaseViewModel
}
}
public override async void OnNavigatedTo(NavigationMode mode, object parameters)
{
base.OnNavigatedTo(mode, parameters);
@@ -143,6 +134,8 @@ public partial class AccountDetailsPageViewModel : MailBaseViewModel
{
CurrentFolders.Add(folder);
}
isLoaded = true;
}
}
@@ -150,6 +143,8 @@ public partial class AccountDetailsPageViewModel : MailBaseViewModel
{
base.OnPropertyChanged(e);
if (!IsActive || !isLoaded) return;
switch (e.PropertyName)
{
case nameof(IsFocusedInboxEnabled) when IsFocusedInboxSupportedForAccount: