From: jpbruyere Date: Sun, 28 Feb 2016 18:05:50 +0000 (+0100) Subject: combo minimum size X-Git-Tag: v0.4~106 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=cb1d5e6ce6c9f61bef0e9b2c0db23cdc7d101920;p=jp%2Fcrow.git combo minimum size --- diff --git a/Templates/ComboBox.goml b/Templates/ComboBox.goml index e512ef2c..94dbc26b 100755 --- a/Templates/ComboBox.goml +++ b/Templates/ComboBox.goml @@ -13,12 +13,14 @@ - + + Height="-1" Width="{../../WidthPolicy}" Name="List" Margin="0" VerticalAlignment="Top"/> diff --git a/Tests/Interfaces/testCombobox.goml b/Tests/Interfaces/testCombobox.goml index 8e0b16ad..a4b74c82 100755 --- a/Tests/Interfaces/testCombobox.goml +++ b/Tests/Interfaces/testCombobox.goml @@ -1,5 +1,5 @@  - \ No newline at end of file diff --git a/src/GraphicObjects/ComboBox.cs b/src/GraphicObjects/ComboBox.cs index 4f948e5b..019d8c9c 100644 --- a/src/GraphicObjects/ComboBox.cs +++ b/src/GraphicObjects/ComboBox.cs @@ -1,4 +1,5 @@ using System; +using System.Xml.Serialization; namespace Crow { @@ -9,5 +10,22 @@ namespace Crow #region CTOR public ComboBox() : base(){ } #endregion + + Size minimumPopupSize = "100;100"; + [XmlIgnore]public Size MinimumPopupSize{ + get { return minimumPopupSize; } + set { + minimumPopupSize = value; + NotifyValueChanged ("MinimumPopupSize", minimumPopupSize); + } + } + + public override void OnLayoutChanges (LayoutingType layoutType) + { + base.OnLayoutChanges (layoutType); + + if (layoutType == LayoutingType.Width) + MinimumPopupSize = new Size (this.Slot.Width, minimumPopupSize.Height); + } } }