diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2015-06-10 09:40:30 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2015-06-10 09:40:31 +0200 |
| commit | 578341c3e4410b803b65a739f950b103f3f0a95c (patch) | |
| tree | f7e90e6b204b58db5ea8fa14bba5d7e53668c744 /src/GraphicObjects/GenericStack.cs | |
| parent | 18e9dca6ea12f3f01a28c08f4b596268d0322a4f (diff) | |
- expandables
- events resolution stacking
- Inlined template
- xmlserialization debugging
Diffstat (limited to 'src/GraphicObjects/GenericStack.cs')
| -rw-r--r-- | src/GraphicObjects/GenericStack.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs index 63a70ad3..0b37f07b 100644 --- a/src/GraphicObjects/GenericStack.cs +++ b/src/GraphicObjects/GenericStack.cs @@ -66,14 +66,14 @@ namespace go Size tmp = new Size ();
if (Orientation == Orientation.Horizontal) {
- foreach (GraphicObject c in Children) {
+ foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {
tmp.Width += c.Slot.Width + Spacing;
tmp.Height = Math.Max (tmp.Height, c.Slot.Bottom);
}
if (tmp.Width > 0)
tmp.Width -= Spacing;
} else {
- foreach (GraphicObject c in Children) {
+ foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {
tmp.Width = Math.Max (tmp.Width, c.Slot.Right);
tmp.Height += c.Slot.Height + Spacing;
}
@@ -90,13 +90,13 @@ namespace go {
int d = 0;
if (Orientation == Orientation.Horizontal) {
- foreach (GraphicObject c in Children) {
+ foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {
c.Slot.X = d;
d += c.Slot.Width + Spacing;
c.RegisterForLayouting ((int)LayoutingType.Y);
}
} else {
- foreach (GraphicObject c in Children) {
+ foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {
c.Slot.Y = d;
d += c.Slot.Height + Spacing;
c.RegisterForLayouting ((int)LayoutingType.X);
@@ -119,11 +119,11 @@ namespace go //this child will occupy remaining space
if (Orientation == Orientation.Horizontal) {
if (Width >= 0) {
- GraphicObject[] gobjs = Children.Where (c => c.Width == 0).ToArray();
+ GraphicObject[] gobjs = Children.Where (c => c.Width == 0 && c.Visible).ToArray();
if (gobjs.Length > 1)
throw new Exception ("Only one child in stack may have size to stretched");
else if (gobjs.Length == 1) {
- int sz = Children.Except (gobjs).Sum (g => g.Slot.Width);
+ int sz = Children.Where(ch=>ch.Visible).Except (gobjs).Sum (g => g.Slot.Width);
if (sz < Slot.Width) {
gobjs [0].Slot.Width = Slot.Width - sz - Spacing;
int idx = Children.IndexOf (gobjs [0]);
@@ -139,11 +139,11 @@ namespace go }
} else {
if (Height >= 0) {
- GraphicObject[] gobjs = Children.Where (c => c.Height == 0).ToArray();
+ GraphicObject[] gobjs = Children.Where(ch=>ch.Visible).Where (c => c.Height == 0).ToArray();
if (gobjs.Length > 1)
throw new Exception ("Only one child in stack may have size to stretched");
else if (gobjs.Length == 1) {
- int sz = Children.Except (gobjs).Sum (g => g.Slot.Height);
+ int sz = Children.Where(ch=>ch.Visible).Except (gobjs).Sum (g => g.Slot.Height);
if (sz < Slot.Height) {
gobjs [0].Slot.Height = Slot.Height - sz;
int idx = Children.IndexOf (gobjs [0]);
|