aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/GenericStack.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-08-01 12:45:27 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2016-08-01 12:47:47 +0200
commit7d84ba29057264497818c4c315bec7547cc9afac (patch)
tree4c811c5dac9d5097ddbac74dbe83a2ae4483beb2 /src/GraphicObjects/GenericStack.cs
parentfd5b776826028a0c12a92f11d1daf4065d4c6024 (diff)
Improve update queuing
modifié : src/GraphicObjects/GenericStack.cs modifié : src/GraphicObjects/GraphicObject.cs modifié : src/GraphicObjects/Group.cs modifié : src/GraphicObjects/Label.cs modifié : src/GraphicObjects/ListBox.cs modifié : src/GraphicObjects/TabView.cs modifié : src/Interface.cs modifié : src/StyleReader.cs tests updates modifié : Tests/BasicTests.cs modifié : Tests/Interfaces/Divers/testWindow.goml modifié : Tests/Interfaces/Divers/welcome.crow modifié : Tests/Interfaces/Expandable/0.crow renommé : Tests/Interfaces/Nouveau dossier/test4.1.crow -> Tests/Interfaces/Unsorted/test4.1.crow renommé : Tests/Interfaces/Nouveau dossier/test4.crow -> Tests/Interfaces/Unsorted/test4.crow renommé : Tests/Interfaces/Nouveau dossier/test6.crow -> Tests/Interfaces/Unsorted/test6.crow renommé : Tests/Interfaces/Nouveau dossier/testColorList.crow -> Tests/Interfaces/Unsorted/testColorList.crow renommé : Tests/Interfaces/Nouveau dossier/testDirViewer.crow -> Tests/Interfaces/Unsorted/testDirViewer.crow renommé : Tests/Interfaces/Nouveau dossier/testFileDialog.goml -> Tests/Interfaces/Unsorted/testFileDialog.goml renommé : Tests/Interfaces/Nouveau dossier/testImage.crow -> Tests/Interfaces/Unsorted/testImage.crow renommé : Tests/Interfaces/Nouveau dossier/testLabel.crow -> Tests/Interfaces/Unsorted/testLabel.crow renommé : Tests/Interfaces/Nouveau dossier/testMsgBox.crow -> Tests/Interfaces/Unsorted/testMsgBox.crow renommé : Tests/Interfaces/Nouveau dossier/testOutOfClipUpdate.crow -> Tests/Interfaces/Unsorted/testOutOfClipUpdate.crow renommé : Tests/Interfaces/Nouveau dossier/testRadioButton2.crow -> Tests/Interfaces/Unsorted/testRadioButton2.crow renommé : Tests/Interfaces/Nouveau dossier/testTabView.crow -> Tests/Interfaces/Unsorted/testTabView.crow renommé : Tests/Interfaces/Nouveau dossier/testTreeView.crow -> Tests/Interfaces/Unsorted/testTreeView.crow renommé : Tests/Interfaces/Nouveau dossier/testTypeViewer.goml -> Tests/Interfaces/Unsorted/testTypeViewer.goml modifié : Tests/Tests.csproj
Diffstat (limited to 'src/GraphicObjects/GenericStack.cs')
-rw-r--r--src/GraphicObjects/GenericStack.cs39
1 files changed, 27 insertions, 12 deletions
diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs
index 3ec29fb5..c0cd7747 100644
--- a/src/GraphicObjects/GenericStack.cs
+++ b/src/GraphicObjects/GenericStack.cs
@@ -1,6 +1,7 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Xml.Serialization;
+using System;
namespace Crow
{
@@ -126,15 +127,22 @@ namespace Crow
contentSize.Width += go.Slot.Width - go.LastSlots.Width;
if (stretchedGO != null) {
- stretchedGO.Slot.Width = this.ClientRectangle.Width - contentSize.Width - Spacing * (Children.Count - 1);
- stretchedGO.bmp = null;
+ int newW = Math.Max (
+ this.ClientRectangle.Width - contentSize.Width - Spacing * (Children.Count - 1),
+ stretchedGO.MinimumSize.Width);
+ if (stretchedGO.MaximumSize.Width > 0)
+ newW = Math.Min (newW, stretchedGO.MaximumSize.Width);
+ if (newW != stretchedGO.Slot.Width) {
+ stretchedGO.Slot.Width = newW;
+ stretchedGO.bmp = null;
#if DEBUG_LAYOUTING
Debug.WriteLine ("\tAdjusting Width of " + stretchedGO.ToString());
#endif
- stretchedGO.LayoutChanged -= OnChildLayoutChanges;
- stretchedGO.OnLayoutChanges (LayoutingType.Width);
- stretchedGO.LayoutChanged += OnChildLayoutChanges;
- stretchedGO.LastSlots.Width = stretchedGO.Slot.Width;
+ stretchedGO.LayoutChanged -= OnChildLayoutChanges;
+ stretchedGO.OnLayoutChanges (LayoutingType.Width);
+ stretchedGO.LayoutChanged += OnChildLayoutChanges;
+ stretchedGO.LastSlots.Width = stretchedGO.Slot.Width;
+ }
}
if (Width == Measure.Fit)
@@ -158,15 +166,22 @@ namespace Crow
contentSize.Height += go.Slot.Height - go.LastSlots.Height;
if (stretchedGO != null) {
- stretchedGO.Slot.Height = this.ClientRectangle.Height - contentSize.Height - Spacing * (Children.Count -1);
- stretchedGO.bmp = null;
+ int newH = Math.Max (
+ this.ClientRectangle.Height - contentSize.Height - Spacing * (Children.Count - 1),
+ stretchedGO.MinimumSize.Height);
+ if (stretchedGO.MaximumSize.Height > 0)
+ newH = Math.Min (newH, stretchedGO.MaximumSize.Height);
+ if (newH != stretchedGO.Slot.Height) {
+ stretchedGO.Slot.Height = newH;
+ stretchedGO.bmp = null;
#if DEBUG_LAYOUTING
Debug.WriteLine ("\tAdjusting Width of " + stretchedGO.ToString());
#endif
- stretchedGO.LayoutChanged -= OnChildLayoutChanges;
- stretchedGO.OnLayoutChanges (LayoutingType.Height);
- stretchedGO.LayoutChanged += OnChildLayoutChanges;
- stretchedGO.LastSlots.Height = stretchedGO.Slot.Height;
+ stretchedGO.LayoutChanged -= OnChildLayoutChanges;
+ stretchedGO.OnLayoutChanges (LayoutingType.Height);
+ stretchedGO.LayoutChanged += OnChildLayoutChanges;
+ stretchedGO.LastSlots.Height = stretchedGO.Slot.Height;
+ }
}
if (Height == Measure.Fit)