]> O.S.I.I.S - jp/crow.git/commitdiff
clear Slot when parent change in go, docker wip
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 4 Mar 2018 11:33:20 +0000 (12:33 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 4 Mar 2018 11:33:20 +0000 (12:33 +0100)
Default.style
src/GraphicObjects/DockStack.cs
src/GraphicObjects/DockWindow.cs
src/GraphicObjects/Docker.cs
src/GraphicObjects/GenericStack.cs
src/GraphicObjects/GraphicObject.cs
src/Interface.cs

index 3c260b5c746f55c7aa7c44d5672b6d0b7b0f4b62..70278cc935ce4de91cc1eded11833340d52af215 100644 (file)
@@ -73,8 +73,8 @@ Slider {
 }
 Splitter {
        Focusable = "true";
-       Margin = "1";
-       Background = "White";
+       Margin = "2";
+       Background = "Gray";
 }
 Spinner {
        Foreground = "DimGray";
index 29ebe0ec857df96825792fc853f768454d4f986f..4800c0aaaa9211de8d27c3dd4ee3e884a3c3db5e 100644 (file)
@@ -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'/>");
                }
 
        }
index 4c71c92d3c901ed6462793fbd0de3d58ccba4fec..7924588e1920f4636f413939b6c4fa77b58d37c5 100644 (file)
@@ -35,7 +35,7 @@ namespace Crow
                }
                #endregion
 
-               int undockThreshold = 10;
+               int undockThreshold = 4;
                bool isDocked = false;
                Alignment docking = Alignment.Center;
 
index dfd386aac328dcc3ab98b5f6b41de001585181af..f61269d39916454596ba47d1affcb8a8c45f9c90 100644 (file)
@@ -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);
index 2df681e480e53cc67ebe936b11f602611efbeb82..0dbaedd1e1277b453aa68dd166001827a29e8ae8 100644 (file)
@@ -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);
                }
        }
 }
index db49832e80206cbd8aa4f328604a30a76e3bde5d..a70f04a1e3516bc741d3dd9fddfbcd6ba1adf059 100644 (file)
@@ -340,6 +340,7 @@ namespace Crow
 
                                parentRWLock.EnterWriteLock();
                                parent = value;
+                               Slot = default(Rectangle);
                                parentRWLock.ExitWriteLock();
                                                                        
                                onParentChanged (this, e);
index 4b7807319c0d1ef1b43f856a927a123d0ec7160c..ceeb2aa8216a0e0e05f618e8cfb71ee1029cb6b9 100644 (file)
@@ -469,7 +469,7 @@ namespace Crow
                                {
                                        _hoverWidget.IsHover = true;
                                        #if DEBUG_FOCUS
-                                       Debug.WriteLine("Hover => " + _activeWidget.ToString());
+                                       Debug.WriteLine("Hover => " + _hoverWidget.ToString());
                                        }else
                                        Debug.WriteLine("Hover => null");
                                        #else