Entries and groups icons are now handled with int

Static mapping is changed to a converter
This commit is contained in:
BONNEVILLE Geoffroy
2018-06-14 10:20:00 +02:00
parent cc65c56042
commit 8a5db88225
7 changed files with 28 additions and 29 deletions

View File

@@ -1,9 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Windows.UI.Xaml.Controls;
using ModernKeePass.Interfaces;
using ModernKeePass.Mappings;
using ModernKeePass.Services;
using ModernKeePassLib;
using ModernKeePassLib.Cryptography.PasswordGenerator;
@@ -79,14 +77,12 @@ namespace ModernKeePass.ViewModels
set { SetEntryValue(PwDefs.NotesField, value); }
}
public Symbol IconSymbol
public int IconId
{
get
{
if (_pwEntry == null) return Symbol.Add;
if (HasExpired) return Symbol.Priority;
var result = PwIconToSegoeMapping.GetSymbolFromIcon(_pwEntry.IconId);
return result == Symbol.More ? Symbol.Permissions : result;
if (_pwEntry?.IconId != null) return (int) _pwEntry?.IconId;
return -1;
}
}