This commit is contained in:
Burak Kaan Köse
2024-11-09 20:48:48 +01:00
5 changed files with 45 additions and 6 deletions

View File

@@ -36,6 +36,11 @@ namespace Wino.Core.Domain.Entities
/// </summary>
public bool IsSignatureEnabled { get; set; }
/// <summary>
/// Gets or sets whether this account's unread items should be included in taskbar badge.
/// </summary>
public bool IsTaskbarBadgeEnabled { get; set; } = true;
/// <summary>
/// Gets or sets signature for new messages. Null if signature is not needed.
/// </summary>

View File

@@ -513,6 +513,10 @@
"SettingsNoAccountSetupMessage": "You didn't setup any accounts yet.",
"SettingsNotifications_Description": "Turn on or off notifications for this account.",
"SettingsNotifications_Title": "Notifications",
"SettingsNotificationsAndTaskbar_Title": "Notifications & Taskbar",
"SettingsTaskbarBadge_Title": "Taskbar Badge",
"SettingsTaskbarBadge_Description": "Include unread mail count in taskbar icon.",
"SettingsNotificationsAndTaskbar_Description": "Change whether notifications should be displayed and taskbar badge for this account.",
"SettingsPaneLengthReset_Description": "Reset the size of the mail list to original if you have issues with it.",
"SettingsPaneLengthReset_Title": "Reset Mail List Size",
"SettingsPaypal_Description": "Show much more love ❤️ All donations are appreciated.",

View File

@@ -166,6 +166,8 @@ namespace Wino.Core.UWP.Services
foreach (var account in accounts)
{
if (!account.Preferences.IsTaskbarBadgeEnabled) continue;
var accountInbox = await _folderService.GetSpecialFolderByAccountIdAsync(account.Id, SpecialFolderType.Inbox);
if (accountInbox == null)

View File

@@ -39,6 +39,9 @@ namespace Wino.Mail.ViewModels
[ObservableProperty]
private bool isAppendMessageSettinEnabled;
[ObservableProperty]
private bool isTaskbarBadgeEnabled;
public bool IsFocusedInboxSupportedForAccount => Account != null && Account.Preferences.IsFocusedInboxEnabled != null;
@@ -120,6 +123,7 @@ namespace Wino.Mail.ViewModels
IsAppendMessageSettingVisible = Account.ProviderType == MailProviderType.IMAP4;
IsAppendMessageSettinEnabled = Account.Preferences.ShouldAppendMessagesToSentFolder;
IsTaskbarBadgeEnabled = Account.Preferences.IsTaskbarBadgeEnabled;
OnPropertyChanged(nameof(IsFocusedInboxSupportedForAccount));
@@ -154,6 +158,10 @@ namespace Wino.Mail.ViewModels
Account.Preferences.IsSignatureEnabled = IsSignatureEnabled;
await _accountService.UpdateAccountAsync(Account);
break;
case nameof(IsTaskbarBadgeEnabled):
Account.Preferences.IsTaskbarBadgeEnabled = IsTaskbarBadgeEnabled;
await _accountService.UpdateAccountAsync(Account);
break;
}
}
}

View File

@@ -153,6 +153,32 @@
</controls:SettingsExpander.Items>
</controls:SettingsExpander>
<controls:SettingsExpander Description="{x:Bind domain:Translator.SettingsNotificationsAndTaskbar_Description}" Header="{x:Bind domain:Translator.SettingsNotificationsAndTaskbar_Title}">
<controls:SettingsExpander.HeaderIcon>
<PathIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1 M 8.125 16.25 C 7.871094 16.25 7.630208 16.201172 7.402344 16.103516 C 7.174479 16.005859 6.974283 15.870769 6.801758 15.698242 C 6.629231 15.525717 6.494141 15.325521 6.396484 15.097656 C 6.298828 14.869792 6.25 14.628906 6.25 14.375 L 6.25 5.625 C 6.25 5.371094 6.298828 5.130209 6.396484 4.902344 C 6.494141 4.67448 6.629231 4.474285 6.801758 4.301758 C 6.974283 4.129232 7.174479 3.994141 7.402344 3.896484 C 7.630208 3.798828 7.871094 3.75 8.125 3.75 L 18.125 3.75 C 18.378906 3.75 18.619791 3.798828 18.847656 3.896484 C 19.07552 3.994141 19.275715 4.129232 19.448242 4.301758 C 19.620768 4.474285 19.755859 4.67448 19.853516 4.902344 C 19.951172 5.130209 20 5.371094 20 5.625 L 20 14.375 C 20 14.628906 19.951172 14.869792 19.853516 15.097656 C 19.755859 15.325521 19.620768 15.525717 19.448242 15.698242 C 19.275715 15.870769 19.07552 16.005859 18.847656 16.103516 C 18.619791 16.201172 18.378906 16.25 18.125 16.25 Z M 18.125 15 C 18.29427 15 18.440754 14.938151 18.564453 14.814453 C 18.68815 14.690756 18.75 14.544271 18.75 14.375 L 18.75 5.625 C 18.75 5.455729 18.68815 5.309245 18.564453 5.185547 C 18.440754 5.06185 18.29427 5.000001 18.125 5 L 8.125 5 C 7.955729 5.000001 7.809245 5.06185 7.685547 5.185547 C 7.561849 5.309245 7.5 5.455729 7.5 5.625 L 7.5 14.375 C 7.5 14.544271 7.561849 14.690756 7.685547 14.814453 C 7.809245 14.938151 7.955729 15 8.125 15 Z M 0.625 7.5 C 0.455729 7.5 0.309245 7.438151 0.185547 7.314453 C 0.061849 7.190756 0 7.044271 0 6.875 C 0 6.705729 0.061849 6.559245 0.185547 6.435547 C 0.309245 6.31185 0.455729 6.25 0.625 6.25 L 4.375 6.25 C 4.544271 6.25 4.690755 6.31185 4.814453 6.435547 C 4.938151 6.559245 5 6.705729 5 6.875 C 5 7.044271 4.938151 7.190756 4.814453 7.314453 C 4.690755 7.438151 4.544271 7.5 4.375 7.5 Z M 9.375 7.5 C 9.205729 7.5 9.059244 7.438151 8.935547 7.314453 C 8.811849 7.190756 8.75 7.044271 8.75 6.875 C 8.75 6.705729 8.811849 6.559245 8.935547 6.435547 C 9.059244 6.31185 9.205729 6.25 9.375 6.25 L 16.875 6.25 C 17.04427 6.25 17.190754 6.31185 17.314453 6.435547 C 17.43815 6.559245 17.5 6.705729 17.5 6.875 C 17.5 7.044271 17.43815 7.190756 17.314453 7.314453 C 17.190754 7.438151 17.04427 7.5 16.875 7.5 Z M 1.875 10 C 1.705729 10 1.559245 9.938151 1.435547 9.814453 C 1.311849 9.690756 1.25 9.544271 1.25 9.375 C 1.25 9.205729 1.311849 9.059245 1.435547 8.935547 C 1.559245 8.81185 1.705729 8.75 1.875 8.75 L 4.375 8.75 C 4.544271 8.75 4.690755 8.81185 4.814453 8.935547 C 4.938151 9.059245 5 9.205729 5 9.375 C 5 9.544271 4.938151 9.690756 4.814453 9.814453 C 4.690755 9.938151 4.544271 10 4.375 10 Z M 9.375 10 C 9.205729 10 9.059244 9.938151 8.935547 9.814453 C 8.811849 9.690756 8.75 9.544271 8.75 9.375 C 8.75 9.205729 8.811849 9.059245 8.935547 8.935547 C 9.059244 8.81185 9.205729 8.75 9.375 8.75 L 10.625 8.75 C 10.794271 8.75 10.940755 8.81185 11.064453 8.935547 C 11.18815 9.059245 11.25 9.205729 11.25 9.375 C 11.25 9.544271 11.18815 9.690756 11.064453 9.814453 C 10.940755 9.938151 10.794271 10 10.625 10 Z M 13.75 13.75 C 13.574219 13.75 13.40983 13.717448 13.256836 13.652344 C 13.103841 13.58724 12.972005 13.49935 12.861328 13.388672 C 12.75065 13.277995 12.66276 13.146159 12.597656 12.993164 C 12.532552 12.84017 12.5 12.675781 12.5 12.5 L 12.5 10 C 12.5 9.824219 12.532552 9.661459 12.597656 9.511719 C 12.66276 9.361979 12.752278 9.230144 12.866211 9.116211 C 12.980143 9.002279 13.111979 8.912761 13.261719 8.847656 C 13.411458 8.782553 13.574219 8.75 13.75 8.75 L 16.25 8.75 C 16.41927 8.75 16.580402 8.782553 16.733398 8.847656 C 16.886393 8.912761 17.019855 9.002279 17.133789 9.116211 C 17.247721 9.230144 17.337238 9.363607 17.402344 9.516602 C 17.467447 9.669597 17.5 9.830729 17.5 10 L 17.5 12.5 C 17.5 12.675781 17.467447 12.838542 17.402344 12.988281 C 17.337238 13.138021 17.247721 13.269857 17.133789 13.383789 C 17.019855 13.497722 16.88802 13.58724 16.738281 13.652344 C 16.588541 13.717448 16.425781 13.75 16.25 13.75 Z M 13.75 10 L 13.75 12.5 L 16.25 12.5 L 16.25 10 Z M 3.125 12.5 C 2.955729 12.5 2.809245 12.438151 2.685547 12.314453 C 2.561849 12.190756 2.5 12.044271 2.5 11.875 C 2.5 11.705729 2.561849 11.559245 2.685547 11.435547 C 2.809245 11.31185 2.955729 11.25 3.125 11.25 L 4.375 11.25 C 4.544271 11.25 4.690755 11.31185 4.814453 11.435547 C 4.938151 11.559245 5 11.705729 5 11.875 C 5 12.044271 4.938151 12.190756 4.814453 12.314453 C 4.690755 12.438151 4.544271 12.5 4.375 12.5 Z M 9.375 12.5 C 9.205729 12.5 9.059244 12.438151 8.935547 12.314453 C 8.811849 12.190756 8.75 12.044271 8.75 11.875 C 8.75 11.705729 8.811849 11.559245 8.935547 11.435547 C 9.059244 11.31185 9.205729 11.25 9.375 11.25 L 10.625 11.25 C 10.794271 11.25 10.940755 11.31185 11.064453 11.435547 C 11.18815 11.559245 11.25 11.705729 11.25 11.875 C 11.25 12.044271 11.18815 12.190756 11.064453 12.314453 C 10.940755 12.438151 10.794271 12.5 10.625 12.5 Z " />
</controls:SettingsExpander.HeaderIcon>
<controls:SettingsExpander.Items>
<controls:SettingsCard Description="{x:Bind domain:Translator.SettingsNotifications_Description}" Header="{x:Bind domain:Translator.SettingsNotifications_Title}">
<controls:SettingsCard.HeaderIcon>
<PathIcon Data="F1 M 0 0 L 20 0 L 20 16.25 L 13.75 16.25 L 10 20 L 6.25 16.25 L 0 16.25 Z M 16.25 7.5 L 3.75 7.5 L 3.75 8.75 L 16.25 8.75 Z M 16.25 3.75 L 3.75 3.75 L 3.75 5 L 16.25 5 Z M 11.25 11.25 L 3.75 11.25 L 3.75 12.5 L 11.25 12.5 Z " />
</controls:SettingsCard.HeaderIcon>
<ToggleSwitch IsOn="{x:Bind ViewModel.AreNotificationsEnabled, Mode=TwoWay}" />
</controls:SettingsCard>
<controls:SettingsCard Description="{x:Bind domain:Translator.SettingsTaskbarBadge_Description}" Header="{x:Bind domain:Translator.SettingsTaskbarBadge_Title}">
<controls:SettingsCard.HeaderIcon>
<PathIcon Data="F1 M 3.330078 10 C 3.330078 9.388021 3.409831 8.797201 3.569336 8.227539 C 3.728841 7.657879 3.95345 7.125652 4.243164 6.630859 C 4.532877 6.136068 4.879557 5.68685 5.283203 5.283203 C 5.686849 4.879559 6.136067 4.532879 6.630859 4.243164 C 7.125651 3.953451 7.657877 3.728842 8.227539 3.569336 C 8.7972 3.409832 9.388021 3.330078 10 3.330078 C 10.611979 3.330078 11.202799 3.409832 11.772461 3.569336 C 12.342121 3.728842 12.874348 3.953451 13.369141 4.243164 C 13.863932 4.532879 14.31315 4.879559 14.716797 5.283203 C 15.120441 5.68685 15.467121 6.136068 15.756836 6.630859 C 16.046549 7.125652 16.271158 7.657879 16.430664 8.227539 C 16.590168 8.797201 16.669922 9.388021 16.669922 10 C 16.669922 10.611979 16.590168 11.2028 16.430664 11.772461 C 16.271158 12.342123 16.046549 12.87435 15.756836 13.369141 C 15.467121 13.863933 15.120441 14.313151 14.716797 14.716797 C 14.31315 15.120443 13.863932 15.467123 13.369141 15.756836 C 12.874348 16.046551 12.342121 16.27116 11.772461 16.430664 C 11.202799 16.59017 10.611979 16.669922 10 16.669922 C 9.388021 16.669922 8.7972 16.59017 8.227539 16.430664 C 7.657877 16.27116 7.125651 16.046551 6.630859 15.756836 C 6.136067 15.467123 5.686849 15.120443 5.283203 14.716797 C 4.879557 14.313151 4.532877 13.863933 4.243164 13.369141 C 3.95345 12.87435 3.728841 12.342123 3.569336 11.772461 C 3.409831 11.2028 3.330078 10.611979 3.330078 10 Z " />
</controls:SettingsCard.HeaderIcon>
<ToggleSwitch IsOn="{x:Bind ViewModel.IsTaskbarBadgeEnabled, Mode=TwoWay}" />
</controls:SettingsCard>
</controls:SettingsExpander.Items>
</controls:SettingsExpander>
<!-- TODO -->
<!--<controls:SettingsCard
Header="Special Folders"
@@ -175,12 +201,6 @@
<ToggleSwitch IsOn="{x:Bind ViewModel.IsSignatureEnabled, Mode=TwoWay}" />
</controls:SettingsCard>
<controls:SettingsCard Description="{x:Bind domain:Translator.SettingsNotifications_Description}" Header="{x:Bind domain:Translator.SettingsNotifications_Title}">
<controls:SettingsCard.HeaderIcon>
<PathIcon Data="F1 M 0 0 L 20 0 L 20 16.25 L 13.75 16.25 L 10 20 L 6.25 16.25 L 0 16.25 Z M 16.25 7.5 L 3.75 7.5 L 3.75 8.75 L 16.25 8.75 Z M 16.25 3.75 L 3.75 3.75 L 3.75 5 L 16.25 5 Z M 11.25 11.25 L 3.75 11.25 L 3.75 12.5 L 11.25 12.5 Z " />
</controls:SettingsCard.HeaderIcon>
<ToggleSwitch IsOn="{x:Bind ViewModel.AreNotificationsEnabled, Mode=TwoWay}" />
</controls:SettingsCard>
<controls:SettingsCard
Description="{x:Bind domain:Translator.SettingsFocusedInbox_Description}"