aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-03-04 12:33:20 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-03-04 12:33:20 +0100
commitdbe64f1bcf768c02ca62314559b5657197b7453c (patch)
treeb19cebfca67929a6253ad3af5a677a14900e0aff /src/GraphicObjects
parent27a85f2d4e9987ac1809199e280e17a36d68c783 (diff)
clear Slot when parent change in go, docker wip
Diffstat (limited to 'src/GraphicObjects')
-rw-r--r--src/GraphicObjects/DockStack.cs14
-rw-r--r--src/GraphicObjects/DockWindow.cs2
-rw-r--r--src/GraphicObjects/Docker.cs10
-rw-r--r--src/GraphicObjects/GenericStack.cs4
-rw-r--r--src/GraphicObjects/GraphicObject.cs1
5 files changed, 18 insertions, 13 deletions
diff --git a/src/GraphicObjects/DockStack.cs b/src/GraphicObjects/DockStack.cs
index 29ebe0ec..4800c0aa 100644
--- a/src/GraphicObjects/DockStack.cs
+++ b/src/GraphicObjects/DockStack.cs
@@ -184,15 +184,21 @@ namespace Crow
return;
DockStack dsp = Parent as DockStack;
if (dsp == null) {
- SubStack = null;
RemoveChild (0);
+ if (SubStack is DockStack) {
+ Docker dk = Parent as Docker;
+ dk.RemoveChild (this);
+ dk.InsertChild (0, SubStack);
+ dk.SubStack = SubStack as DockStack;
+ }
+ SubStack = null;
return;
}
GraphicObject g = Children [0];
RemoveChild (g);
int i = dsp.Children.IndexOf (this);
dsp.RemoveChild (this);
- dsp.AddChild (g);
+ dsp.InsertChild (i, g);
dsp.SubStack = g;
// if (SubStack is DockStack) {
//
@@ -267,7 +273,7 @@ namespace Crow
activeStack.AddChild (activeStack.SubStack);
} else {
activeStack.InsertChild (0, dw);
- activeStack.InsertChild (0, splitter);
+ activeStack.InsertChild (1, splitter);
}
break;
case Alignment.Right:
@@ -291,7 +297,7 @@ namespace Crow
return;
instStack = IFace.CreateITorFromIMLFragment (@"<DockStack/>");
instSplit = IFace.CreateITorFromIMLFragment (@"<Splitter/>");
- instSpacer = IFace.CreateITorFromIMLFragment (@"<GraphicObject Background='Jet' IsEnabled='false'/>");
+ instSpacer = IFace.CreateITorFromIMLFragment (@"<GraphicObject Background='DarkCyan' IsEnabled='false'/>");
}
}
diff --git a/src/GraphicObjects/DockWindow.cs b/src/GraphicObjects/DockWindow.cs
index 4c71c92d..7924588e 100644
--- a/src/GraphicObjects/DockWindow.cs
+++ b/src/GraphicObjects/DockWindow.cs
@@ -35,7 +35,7 @@ namespace Crow
}
#endregion
- int undockThreshold = 10;
+ int undockThreshold = 4;
bool isDocked = false;
Alignment docking = Alignment.Center;
diff --git a/src/GraphicObjects/Docker.cs b/src/GraphicObjects/Docker.cs
index dfd386aa..f61269d3 100644
--- a/src/GraphicObjects/Docker.cs
+++ b/src/GraphicObjects/Docker.cs
@@ -43,7 +43,7 @@ namespace Crow
#endregion
//GenericStack rootStack = null;
- DockStack stack = null;
+ public DockStack SubStack = null;
int dockingThreshold;
List<DockWindow> windows = new List<DockWindow>();
@@ -77,10 +77,10 @@ namespace Crow
DockWindow dw = IFace.DragAndDropOperation.DragSource as DockWindow;
if (!dw.IsDocked)
dw.MoveAndResize (e.XDelta, e.YDelta);
- if (stack == null) {
- stack = new DockStack (IFace);
- InsertChild (0, stack);
- stack.LogicalParent = this;
+ if (SubStack == null) {
+ SubStack = new DockStack (IFace);
+ InsertChild (0, SubStack);
+ SubStack.LogicalParent = this;
}
}
base.onMouseMove (sender, e);
diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs
index 2df681e4..0dbaedd1 100644
--- a/src/GraphicObjects/GenericStack.cs
+++ b/src/GraphicObjects/GenericStack.cs
@@ -235,6 +235,7 @@ namespace Crow
base.RemoveChild (child);
if (child == stretchedGO) {
stretchedGO = null;
+ RegisterForLayouting (LayoutingType.Sizing);
return;
}
if (Orientation == Orientation.Horizontal) {
@@ -244,9 +245,6 @@ namespace Crow
contentSize.Height -= child.LastSlots.Height;
adjustStretchedGo (LayoutingType.Height);
}
-
-
-// RegisterForLayouting (LayoutingType.ArrangeChildren);
}
}
}
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs
index db49832e..a70f04a1 100644
--- a/src/GraphicObjects/GraphicObject.cs
+++ b/src/GraphicObjects/GraphicObject.cs
@@ -340,6 +340,7 @@ namespace Crow
parentRWLock.EnterWriteLock();
parent = value;
+ Slot = default(Rectangle);
parentRWLock.ExitWriteLock();
onParentChanged (this, e);