Browse Source

Fixed wrong member name on undo delete

flabbet 1 year ago
parent
commit
81e20fcddb

+ 2 - 1
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/StructureNode.cs

@@ -13,6 +13,7 @@ namespace PixiEditor.ChangeableDocument.Changeables.Graph.Nodes;
 
 
 public abstract class StructureNode : Node, IReadOnlyStructureNode, IBackgroundInput
 public abstract class StructureNode : Node, IReadOnlyStructureNode, IBackgroundInput
 {
 {
+    public const string DefaultMemberName = "DEFAULT_MEMBER_NAME";
     public InputProperty<Texture?> Background { get; }
     public InputProperty<Texture?> Background { get; }
     public InputProperty<float> Opacity { get; }
     public InputProperty<float> Opacity { get; }
     public InputProperty<bool> IsVisible { get; }
     public InputProperty<bool> IsVisible { get; }
@@ -26,7 +27,7 @@ public abstract class StructureNode : Node, IReadOnlyStructureNode, IBackgroundI
 
 
     public OutputProperty<Texture?> FilterlessOutput { get; }
     public OutputProperty<Texture?> FilterlessOutput { get; }
 
 
-    public string MemberName { get; set; } = "New Element"; // would be good to add localization here, it is set if node is created via node graph
+    public string MemberName { get; set; } = DefaultMemberName;
     
     
     public string DisplayName => MemberName;
     public string DisplayName => MemberName;
 
 

+ 2 - 1
src/PixiEditor/Data/Localization/Languages/en.json

@@ -715,5 +715,6 @@
   "STARS_EXAMPLE": "Stars",
   "STARS_EXAMPLE": "Stars",
   "ADD_EMPTY_FRAME": "Add empty frame",
   "ADD_EMPTY_FRAME": "Add empty frame",
   "DUPLICATE_FRAME": "Duplicate frame",
   "DUPLICATE_FRAME": "Duplicate frame",
-  "DELETE_FRAME": "Remove frame"
+  "DELETE_FRAME": "Remove frame",
+  "DEFAULT_MEMBER_NAME": "New Element"
 }
 }

+ 1 - 1
src/PixiEditor/Views/Layers/FolderControl.axaml

@@ -103,7 +103,7 @@
                                 x:Name="editableTextBlock"
                                 x:Name="editableTextBlock"
                                 d:Text="New Folder" FontSize="14"
                                 d:Text="New Folder" FontSize="14"
                                 VerticalAlignment="Center"
                                 VerticalAlignment="Center"
-                                Text="{Binding Folder.NodeNameBindable, ElementName=folderControl, Mode=TwoWay}" />
+                                ui:Translator.Key="{Binding Folder.NodeNameBindable, ElementName=folderControl, Mode=TwoWay}" />
                             
                             
                             <StackPanel Orientation="Horizontal">
                             <StackPanel Orientation="Horizontal">
                                 <TextBlock d:Text="100" Foreground="White" FontSize="11">
                                 <TextBlock d:Text="100" Foreground="White" FontSize="11">

+ 1 - 1
src/PixiEditor/Views/Layers/LayerControl.axaml

@@ -113,7 +113,7 @@
                             x:Name="editableTextBlock"
                             x:Name="editableTextBlock"
                             VerticalAlignment="Center"
                             VerticalAlignment="Center"
                             d:Text="New Layer" FontSize="14"
                             d:Text="New Layer" FontSize="14"
-                            Text="{Binding Layer.NodeNameBindable, ElementName=uc, Mode=TwoWay}" />
+                            ui:Translator.Key="{Binding Layer.NodeNameBindable, ElementName=uc, Mode=TwoWay}" />
 
 
                         <StackPanel Orientation="Horizontal">
                         <StackPanel Orientation="Horizontal">
                             <TextBlock d:Text="100" Foreground="White" FontSize="11">
                             <TextBlock d:Text="100" Foreground="White" FontSize="11">