mirror of
https://github.com/greenshot/greenshot
synced 2025-08-22 06:23:24 -07:00
Remove name on emoji + remove empty Variations in Emojis.xml
This commit is contained in:
parent
e4d7283b3b
commit
4e36be535b
3 changed files with 10 additions and 6 deletions
|
@ -177,7 +177,7 @@ namespace Greenshot.Editor.Controls.Emoji
|
||||||
|
|
||||||
qualifiedLut[unqualified] = text;
|
qualifiedLut[unqualified] = text;
|
||||||
|
|
||||||
var emoji = new Emojis.Emoji { Name = name, Text = text};
|
var emoji = new Emojis.Emoji { Text = text};
|
||||||
|
|
||||||
lookupByName[ToColonSyntax(name)] = emoji;
|
lookupByName[ToColonSyntax(name)] = emoji;
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Button Background="Transparent" BorderBrush="Transparent"
|
<Button Background="Transparent" BorderBrush="Transparent"
|
||||||
Margin="0" Click="OnEmojiPicked"
|
Margin="0" Click="OnEmojiPicked"
|
||||||
Width="40" Height="40" ToolTip="{Binding Path=Name}">
|
Width="40" Height="40">
|
||||||
<emoji:EmojiControl Height="24" Emoji="{Binding Path=Text}" />
|
<emoji:EmojiControl Height="24" Emoji="{Binding Path=Text}" />
|
||||||
</Button>
|
</Button>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
<DataTemplate x:Key="CellTemplate">
|
<DataTemplate x:Key="CellTemplate">
|
||||||
<ToggleButton Width="40" Height="40" Margin="0" Padding="2"
|
<ToggleButton Width="40" Height="40" Margin="0" Padding="2"
|
||||||
x:Name="VariationButton" Background="Transparent" BorderBrush="Transparent"
|
x:Name="VariationButton" Background="Transparent" BorderBrush="Transparent"
|
||||||
Click="OnEmojiPicked" Focusable="False" ToolTip="{Binding Path=Name}">
|
Click="OnEmojiPicked" Focusable="False" >
|
||||||
<Grid>
|
<Grid>
|
||||||
<emoji:EmojiControl Height="24" Margin="4" Emoji="{Binding Path=Text}"
|
<emoji:EmojiControl Height="24" Margin="4" Emoji="{Binding Path=Text}"
|
||||||
VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
|
|
|
@ -51,15 +51,19 @@ public class Emojis
|
||||||
|
|
||||||
public class Emoji
|
public class Emoji
|
||||||
{
|
{
|
||||||
[XmlAttribute]
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
[XmlAttribute]
|
[XmlAttribute]
|
||||||
public string Text { get; set; }
|
public string Text { get; set; }
|
||||||
|
|
||||||
[XmlArray]
|
[XmlArray]
|
||||||
public List<Emoji> Variations { get; set; } = new();
|
public List<Emoji> Variations { get; set; } = new();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Xml trick so that the Xml serializer does not output the 'Variations' element when the emoji has no variation
|
||||||
|
/// (see https://learn.microsoft.com/en-us/dotnet/api/system.xml.serialization.xmlserializer#controlling-generated-xml)
|
||||||
|
/// </summary>
|
||||||
|
[XmlIgnore]
|
||||||
|
public bool VariationsSpecified => HasVariations;
|
||||||
|
|
||||||
public bool HasVariations => Variations.Count > 0;
|
public bool HasVariations => Variations.Count > 0;
|
||||||
|
|
||||||
public IEnumerable<Emoji> AllVariations => HasVariations ? new[] { this }.Union(Variations) : Array.Empty<Emoji>();
|
public IEnumerable<Emoji> AllVariations => HasVariations ? new[] { this }.Union(Variations) : Array.Empty<Emoji>();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue