mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
Entries and groups icons are now handled with int
Static mapping is changed to a converter
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -3,11 +3,8 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using ModernKeePass.Common;
|
||||
using ModernKeePass.Interfaces;
|
||||
using ModernKeePass.Mappings;
|
||||
using ModernKeePass.Services;
|
||||
using ModernKeePassLib;
|
||||
|
||||
@@ -71,14 +68,14 @@ namespace ModernKeePass.ViewModels
|
||||
set { _pwGroup.Name = value; }
|
||||
}
|
||||
|
||||
public Symbol IconSymbol
|
||||
public int IconId
|
||||
{
|
||||
get
|
||||
{
|
||||
var result = PwIconToSegoeMapping.GetSymbolFromIcon(_pwGroup.IconId);
|
||||
return result == Symbol.More ? Symbol.Folder : result;
|
||||
if (_pwGroup?.IconId != null) return (int) _pwGroup?.IconId;
|
||||
return -1;
|
||||
}
|
||||
set { _pwGroup.IconId = PwIconToSegoeMapping.GetIconFromSymbol(value); }
|
||||
set { _pwGroup.IconId = (PwIcon)value; }
|
||||
}
|
||||
|
||||
public bool IsEditMode
|
||||
|
Reference in New Issue
Block a user