Codemaid
This commit is contained in:
@@ -4,8 +4,6 @@ using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Controls.Shapes;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Media.Imaging;
|
||||
using Kromek.UI.Avalonia.Controls;
|
||||
using System;
|
||||
|
||||
namespace Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
@@ -157,7 +155,6 @@ public class PersonPicture : TemplatedControl
|
||||
|
||||
if (change.Property == ProfilePictureProperty)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -297,6 +294,7 @@ public class PersonPicture : TemplatedControl
|
||||
PseudoClasses.Set(":NoBadge", true);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateBadgeNumber()
|
||||
{
|
||||
if (badgingEllipse == null || badgeNumberTextBlock == null)
|
||||
@@ -322,6 +320,7 @@ public class PersonPicture : TemplatedControl
|
||||
badgeNumberTextBlock.Text = "99+";
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateDisplayName()
|
||||
{
|
||||
displayNameInitials = PersonPictureInitialsGenerator.InitialsFromDisplayName(DisplayName);
|
||||
@@ -376,4 +375,4 @@ public class PersonPicture : TemplatedControl
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,4 +6,4 @@ internal enum PersonPictureCharacterType
|
||||
Standard = 1,
|
||||
Symbolic = 2,
|
||||
Glyph = 3
|
||||
}
|
||||
}
|
||||
@@ -22,18 +22,21 @@ internal class PersonPictureInitialsGenerator
|
||||
case PersonPictureCharacterType.Glyph:
|
||||
result = PersonPictureCharacterType.Glyph;
|
||||
break;
|
||||
|
||||
case PersonPictureCharacterType.Symbolic:
|
||||
if (result != PersonPictureCharacterType.Glyph)
|
||||
{
|
||||
result = PersonPictureCharacterType.Symbolic;
|
||||
}
|
||||
break;
|
||||
|
||||
case PersonPictureCharacterType.Standard:
|
||||
if ((result != PersonPictureCharacterType.Glyph) && (result != PersonPictureCharacterType.Symbolic))
|
||||
{
|
||||
result = PersonPictureCharacterType.Standard;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -44,7 +47,6 @@ internal class PersonPictureInitialsGenerator
|
||||
|
||||
public static PersonPictureCharacterType GetCharacterType(char character)
|
||||
{
|
||||
|
||||
// IPA Extensions
|
||||
if ((character >= 0x0250) && (character <= 0x02AF))
|
||||
{
|
||||
@@ -147,7 +149,7 @@ internal class PersonPictureInitialsGenerator
|
||||
{
|
||||
return PersonPictureCharacterType.Symbolic;
|
||||
}
|
||||
// CJK Unified Ideographs Extension
|
||||
// CJK Unified Ideographs Extension
|
||||
if ((character >= 0x3400) && (character <= 0x4DBF))
|
||||
{
|
||||
return PersonPictureCharacterType.Symbolic;
|
||||
@@ -317,6 +319,7 @@ internal class PersonPictureInitialsGenerator
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetFirstFullCharacter(string str)
|
||||
{
|
||||
int start = 0;
|
||||
@@ -385,6 +388,7 @@ internal class PersonPictureInitialsGenerator
|
||||
|
||||
return value.Substring(startIndex, length);
|
||||
}
|
||||
|
||||
private static string[] Split(string source, char delim, int maxIterations = 25)
|
||||
{
|
||||
return source.Split(new[] { delim }, maxIterations);
|
||||
@@ -412,4 +416,4 @@ internal class PersonPictureInitialsGenerator
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ public class PersonPictureTemplateSettings : AvaloniaObject
|
||||
private static readonly StyledProperty<ImageBrush?> ActualImageBrushProperty =
|
||||
AvaloniaProperty.Register<PersonPictureTemplateSettings, ImageBrush?>(nameof(ActualImageBrush));
|
||||
|
||||
|
||||
private static readonly StyledProperty<string> ActualInitialsProperty =
|
||||
AvaloniaProperty.Register<PersonPictureTemplateSettings, string>(nameof(ActualInitials));
|
||||
|
||||
@@ -23,4 +22,4 @@ public class PersonPictureTemplateSettings : AvaloniaObject
|
||||
get => GetValue(ActualInitialsProperty);
|
||||
set => SetValue(ActualInitialsProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user