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;
|
||||
|
||||
var emoji = new Emojis.Emoji { Name = name, Text = text};
|
||||
var emoji = new Emojis.Emoji { Text = text};
|
||||
|
||||
lookupByName[ToColonSyntax(name)] = emoji;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<DataTemplate>
|
||||
<Button Background="Transparent" BorderBrush="Transparent"
|
||||
Margin="0" Click="OnEmojiPicked"
|
||||
Width="40" Height="40" ToolTip="{Binding Path=Name}">
|
||||
Width="40" Height="40">
|
||||
<emoji:EmojiControl Height="24" Emoji="{Binding Path=Text}" />
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
|
@ -46,7 +46,7 @@
|
|||
<DataTemplate x:Key="CellTemplate">
|
||||
<ToggleButton Width="40" Height="40" Margin="0" Padding="2"
|
||||
x:Name="VariationButton" Background="Transparent" BorderBrush="Transparent"
|
||||
Click="OnEmojiPicked" Focusable="False" ToolTip="{Binding Path=Name}">
|
||||
Click="OnEmojiPicked" Focusable="False" >
|
||||
<Grid>
|
||||
<emoji:EmojiControl Height="24" Margin="4" Emoji="{Binding Path=Text}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
|
|
|
@ -51,14 +51,18 @@ public class Emojis
|
|||
|
||||
public class Emoji
|
||||
{
|
||||
[XmlAttribute]
|
||||
public string Name { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public string Text { get; set; }
|
||||
|
||||
[XmlArray]
|
||||
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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue