瀏覽代碼

Commented Add group from active layers

flabbet 4 年之前
父節點
當前提交
7aa41d569d

+ 3 - 2
PixiEditor/Models/Layers/LayerStructure.cs

@@ -32,7 +32,8 @@ namespace PixiEditor.Models.Layers
             return GetGroupByLayer(layerGuid, Groups);
         }
 
-        public GuidStructureItem AddNewGroup(string groupName, IEnumerable<Layer> layers, Guid activeLayer)
+        // This will allow to add new group with multiple layers and groups at once. Not working well, todo fix
+        /*public GuidStructureItem AddNewGroup(string groupName, IEnumerable<Layer> layers, Guid activeLayer)
         {
             var activeLayerParent = GetGroupByLayer(activeLayer);
 
@@ -68,7 +69,7 @@ namespace PixiEditor.Models.Layers
             }
 
             return group;
-        }
+        }*/
 
         public GuidStructureItem AddNewGroup(string groupName, Guid childLayer)
         {

+ 5 - 5
PixiEditor/ViewModels/SubViewModels/Main/LayersViewModel.cs

@@ -60,11 +60,11 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
 
         public void CreateGroupFromActiveLayers(object parameter)
         {
-            var doc = Owner.BitmapManager.ActiveDocument;
-            if (doc != null)
-            {
-                doc.LayerStructure.AddNewGroup($"{Owner.BitmapManager.ActiveLayer.Name} Group", doc.Layers.Where(x => x.IsActive).Reverse(), Owner.BitmapManager.ActiveDocument.ActiveLayerGuid);
-            }
+            //var doc = Owner.BitmapManager.ActiveDocument;
+            //if (doc != null)
+            //{
+            //    doc.LayerStructure.AddNewGroup($"{Owner.BitmapManager.ActiveLayer.Name} Group", doc.Layers.Where(x => x.IsActive).Reverse(), Owner.BitmapManager.ActiveDocument.ActiveLayerGuid);
+            //}
         }
 
         public bool CanDeleteSelected(object parameter)

+ 0 - 2
PixiEditor/Views/UserControls/LayerStructureItemContainer.xaml

@@ -38,8 +38,6 @@
                                             RelativeSource={RelativeSource AncestorType=ContextMenu}}" 
                            CommandParameter="{Binding PlacementTarget.Tag.ContainerIndex, RelativeSource={RelativeSource AncestorType=ContextMenu}}">
                 </MenuItem>
-                <MenuItem Header="Create group"  Command="{Binding PlacementTarget.Tag.LayerCommandsViewModel.CreateGroupFromActiveLayersCommand, 
-                                            RelativeSource={RelativeSource AncestorType=ContextMenu}}"/>
                 <Separator/>
                 <MenuItem Header="Merge selected"
                                      Command="{Binding PlacementTarget.Tag.LayerCommandsViewModel.MergeSelectedCommand,