From 7ff5f14fe6b875dff57b335c4eeeb42397a07c91 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Thu, 14 Apr 2016 09:36:03 +0200 Subject: proportional ui --- src/GraphicObjects/GenericStack.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/GraphicObjects/GenericStack.cs') diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs index 925f908a..455ed928 100644 --- a/src/GraphicObjects/GenericStack.cs +++ b/src/GraphicObjects/GenericStack.cs @@ -133,10 +133,10 @@ namespace Crow if (Children [i].RegisteredLayoutings.HasFlag (LayoutingType.Width)) return false; cptChildren++; - if (Children [i].Width == 0) { - if (!(stretchedGO == null && Width >= 0)) { + if (Children [i].Width == Measure.Stretched) { + if (!(stretchedGO == null && Width != Measure.Fit)) { //change size policy of other stretched children - Children [i].Width = -1; + Children [i].Width = Measure.Fit; return false; } stretchedGO = Children [i]; @@ -146,7 +146,7 @@ namespace Crow } tmpWidth -= Children [i].Slot.Width + Spacing; } - if (stretchedGO != null && Width >= 0) { + if (stretchedGO != null && Width != Measure.Fit) { tmpWidth += (Spacing - 2 * Margin); if (tmpWidth < MinimumSize.Width) tmpWidth = MinimumSize.Width; @@ -172,9 +172,9 @@ namespace Crow if (Children [i].RegisteredLayoutings.HasFlag (LayoutingType.Height)) return false; cptChildren++; - if (Children [i].Height == 0) { - if (!(stretchedGO == null && Height >= 0)){ - Children [i].Height = -1; + if (Children [i].Height == Measure.Stretched) { + if (!(stretchedGO == null && Height != Measure.Fit)){ + Children [i].Height = Measure.Fit; return false; } stretchedGO = Children [i]; @@ -184,7 +184,7 @@ namespace Crow } tmpHeight -= Children[i].Slot.Height + Spacing; } - if (stretchedGO != null && Height >= 0) { + if (stretchedGO != null && Height != Measure.Fit) { tmpHeight += (Spacing - 2 * Margin); if (tmpHeight < MinimumSize.Height) tmpHeight = MinimumSize.Height; @@ -221,14 +221,14 @@ namespace Crow switch (arg.LayoutType) { case LayoutingType.Width: if (Orientation == Orientation.Horizontal) { - if (Width < 0) + if (Width == Measure.Fit) this.RegisterForLayouting (LayoutingType.Width); this.RegisterForLayouting (LayoutingType.ArrangeChildren); } break; case LayoutingType.Height: if (Orientation == Orientation.Vertical) { - if (Height < 0) + if (Height == Measure.Fit) this.RegisterForLayouting (LayoutingType.Height); this.RegisterForLayouting (LayoutingType.ArrangeChildren); } -- cgit v1.3.1-4-g156e