|
@@ -563,21 +563,21 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
|
|
|
text='', ct_type=1, wnd=ctrl)
|
|
|
else:
|
|
|
# prepend to individual layer or non-expanded group
|
|
|
- parent = self.GetItemParent(self.layer_selected)
|
|
|
- layer = self.InsertItem(parentId=parent, input=self.GetPrevSibling(self.layer_selected),
|
|
|
- text='', ct_type=1, wnd=ctrl)
|
|
|
- #if lgroup is False:
|
|
|
- # # last child of root
|
|
|
- # layer = self.AppendItem(parentId=self.root,
|
|
|
- # text='', ct_type=1, wnd=ctrl)
|
|
|
- #elif lgroup is None or lgroup is True:
|
|
|
- # # insert item as last child
|
|
|
- # parent = self.GetItemParent(self.layer_selected)
|
|
|
- # # layer = self.InsertItem(parentId=parent, input=self.GetPrevSibling(self.layer_selected),
|
|
|
- # # text='', ct_type=1, wnd=ctrl)
|
|
|
- # layer = self.AppendItem(parentId=parent,
|
|
|
- # text='', ct_type=1, wnd=ctrl)
|
|
|
-
|
|
|
+ if lgroup is False:
|
|
|
+ # -> last child of root (loading from workspace)
|
|
|
+ layer = self.AppendItem(parentId=self.root,
|
|
|
+ text='', ct_type=1, wnd=ctrl)
|
|
|
+ elif lgroup is True:
|
|
|
+ # -> last child of group (loading from workspace)
|
|
|
+ parent = self.GetItemParent(self.layer_selected)
|
|
|
+ layer = self.AppendItem(parentId=parent,
|
|
|
+ text='', ct_type=1, wnd=ctrl)
|
|
|
+ elif lgroup is None:
|
|
|
+ # -> previous sibling of selected layer
|
|
|
+ parent = self.GetItemParent(self.layer_selected)
|
|
|
+ layer = self.InsertItem(parentId=parent,
|
|
|
+ input=self.GetPrevSibling(self.layer_selected),
|
|
|
+ text='', ct_type=1, wnd=ctrl)
|
|
|
else: # add first layer to the layer tree (first child of root)
|
|
|
layer = self.PrependItem(parent=self.root, text='', ct_type=1, wnd=ctrl)
|
|
|
|