Ability to set composer default font (#287)
* Added ability to set Composer font * Added missing translations and refactoring * Remove unused methods * Small fixes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Wino.Core.Domain;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
@@ -9,23 +10,40 @@ namespace Wino.Mail.ViewModels
|
||||
{
|
||||
public IPreferencesService PreferencesService { get; }
|
||||
|
||||
private List<MailOperation> availableHoverActions = new List<MailOperation>
|
||||
private int selectedMarkAsOptionIndex;
|
||||
|
||||
public int SelectedMarkAsOptionIndex
|
||||
{
|
||||
get => selectedMarkAsOptionIndex;
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref selectedMarkAsOptionIndex, value))
|
||||
{
|
||||
if (value >= 0)
|
||||
{
|
||||
PreferencesService.MarkAsPreference = (MailMarkAsOption)Enum.GetValues(typeof(MailMarkAsOption)).GetValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private readonly List<MailOperation> availableHoverActions =
|
||||
[
|
||||
MailOperation.Archive,
|
||||
MailOperation.SoftDelete,
|
||||
MailOperation.SetFlag,
|
||||
MailOperation.MarkAsRead,
|
||||
MailOperation.MoveToJunk
|
||||
};
|
||||
];
|
||||
|
||||
public List<string> AvailableHoverActionsTranslations { get; set; } = new List<string>()
|
||||
{
|
||||
public List<string> AvailableHoverActionsTranslations { get; set; } =
|
||||
[
|
||||
Translator.HoverActionOption_Archive,
|
||||
Translator.HoverActionOption_Delete,
|
||||
Translator.HoverActionOption_ToggleFlag,
|
||||
Translator.HoverActionOption_ToggleRead,
|
||||
Translator.HoverActionOption_MoveJunk
|
||||
};
|
||||
];
|
||||
|
||||
#region Properties
|
||||
|
||||
@@ -82,6 +100,8 @@ namespace Wino.Mail.ViewModels
|
||||
leftHoverActionIndex = availableHoverActions.IndexOf(PreferencesService.LeftHoverAction);
|
||||
centerHoverActionIndex = availableHoverActions.IndexOf(PreferencesService.CenterHoverAction);
|
||||
rightHoverActionIndex = availableHoverActions.IndexOf(PreferencesService.RightHoverAction);
|
||||
|
||||
SelectedMarkAsOptionIndex = Array.IndexOf(Enum.GetValues(typeof(MailMarkAsOption)), PreferencesService.MarkAsPreference);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user