From: jpbruyere Date: Thu, 21 Jul 2016 15:02:42 +0000 (+0200) Subject: improve splitter mouse move X-Git-Tag: v0.4~45 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=cf212350e80c880d1409bfb27221957856fc408c;p=jp%2Fcrow.git improve splitter mouse move --- diff --git a/src/GraphicObjects/Splitter.cs b/src/GraphicObjects/Splitter.cs index 527b4084..248863b5 100644 --- a/src/GraphicObjects/Splitter.cs +++ b/src/GraphicObjects/Splitter.cs @@ -82,15 +82,27 @@ namespace Crow int ptrThis = gs.Children.IndexOf (this); if (gs.Orientation == Orientation.Horizontal) { - if (ptrThis >= 0) - gs.Children [ptrThis - 1].Width = Math.Max(gs.Children [ptrThis - 1].Slot.Width + e.XDelta, 1); - if (ptrThis < gs.Children.Count - 1) - gs.Children [ptrThis + 1].Width = Math.Max(gs.Children [ptrThis + 1].Slot.Width - e.XDelta, 1); + if (ptrThis >= 0){ + if (!gs.Children [ptrThis - 1].Width.IsFixed) + gs.Children [ptrThis - 1].Width = gs.Children [ptrThis - 1].Slot.Width; + gs.Children [ptrThis - 1].Width = Math.Max(gs.Children [ptrThis - 1].Width + e.XDelta, 1); + } + if (ptrThis < gs.Children.Count - 1){ + if (!gs.Children [ptrThis + 1].Width.IsFixed) + gs.Children [ptrThis + 1].Width = gs.Children [ptrThis + 1].Slot.Width; + gs.Children [ptrThis + 1].Width = Math.Max(gs.Children [ptrThis + 1].Width - e.XDelta, 1); + } } else { - if (ptrThis >= 0) - gs.Children [ptrThis - 1].Height = Math.Max(gs.Children [ptrThis - 1].Slot.Height + e.YDelta, 1); - if (ptrThis < gs.Children.Count - 1) - gs.Children [ptrThis + 1].Height = Math.Max(gs.Children [ptrThis + 1].Slot.Height - e.YDelta, 1); + if (ptrThis >= 0) { + if (!gs.Children [ptrThis - 1].Height.IsFixed) + gs.Children [ptrThis - 1].Height = gs.Children [ptrThis - 1].Slot.Height; + gs.Children [ptrThis - 1].Height = Math.Max (gs.Children [ptrThis - 1].Height + e.YDelta, 1); + } + if (ptrThis < gs.Children.Count - 1) { + if (!gs.Children [ptrThis + 1].Height.IsFixed) + gs.Children [ptrThis + 1].Height = gs.Children [ptrThis + 1].Slot.Height; + gs.Children [ptrThis + 1].Height = Math.Max (gs.Children [ptrThis + 1].Height - e.YDelta, 1); + } } } public override bool UpdateLayout (LayoutingType layoutType)