aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/GenericStack.cs
diff options
context:
space:
mode:
authorj-p <jp.bruyere@live.be>2016-04-14 13:35:33 +0000
committerj-p <jp.bruyere@live.be>2016-04-14 13:35:33 +0000
commita01e514c4aacd93a2541416466716d0454ad1e2c (patch)
treefb25b23d25757abccf6b4a677e70d95ed3340644 /src/GraphicObjects/GenericStack.cs
parent45fb721a432caec62068994ee9a56a4b843bcc03 (diff)
parent7c5032b5c6d4b5d7d8f56576995a441baa9e4faa (diff)
Merge pull request #6 from jpbruyere/ProportionalUI
Proportional ui
Diffstat (limited to 'src/GraphicObjects/GenericStack.cs')
-rw-r--r--src/GraphicObjects/GenericStack.cs21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs
index 6dec8453..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;
@@ -218,18 +218,17 @@ namespace Crow
{
base.OnChildLayoutChanges (sender, arg);
- GraphicObject g = sender as GraphicObject;
switch (arg.LayoutType) {
case LayoutingType.Width:
if (Orientation == Orientation.Horizontal) {
- if (this.Bounds.Width < 0)
+ if (Width == Measure.Fit)
this.RegisterForLayouting (LayoutingType.Width);
this.RegisterForLayouting (LayoutingType.ArrangeChildren);
}
break;
case LayoutingType.Height:
if (Orientation == Orientation.Vertical) {
- if (this.Bounds.Height < 0)
+ if (Height == Measure.Fit)
this.RegisterForLayouting (LayoutingType.Height);
this.RegisterForLayouting (LayoutingType.ArrangeChildren);
}