diff options
author | Alex Corrado <alexc@xamarin.com> | 2013-10-26 01:24:39 +0400 |
---|---|---|
committer | Alex Corrado <alexc@xamarin.com> | 2013-10-26 01:24:39 +0400 |
commit | 5489c7ebc63b1304bc9fe57eb5081a7514a58655 (patch) | |
tree | bd749185721ed0b3eae080019cf89c8cf0fa3ab1 /Xwt.Mac | |
parent | 7e669def2120a9a0c980ab2e8585a9392a3b6e38 (diff) |
[Mac] DialogBackend: don't add padding for the button box if there are no buttons
Diffstat (limited to 'Xwt.Mac')
-rw-r--r-- | Xwt.Mac/Xwt.Mac/DialogBackend.cs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Xwt.Mac/Xwt.Mac/DialogBackend.cs b/Xwt.Mac/Xwt.Mac/DialogBackend.cs index 5b0d860c..1afd1b74 100644 --- a/Xwt.Mac/Xwt.Mac/DialogBackend.cs +++ b/Xwt.Mac/Xwt.Mac/DialogBackend.cs @@ -24,6 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; +using System.Linq; using Xwt.Backends; using System.Collections.Generic; using MonoMac.AppKit; @@ -59,10 +60,13 @@ namespace Xwt.Mac public override void LayoutWindow () { var frame = ContentView.Frame; - var ps = buttonBox.Surface.GetPreferredSize (true); - buttonBoxView.Frame = new System.Drawing.RectangleF ((float)buttonBoxPadding.Left, (float)buttonBoxPadding.Bottom, frame.Width - (float)buttonBoxPadding.HorizontalSpacing, (float)ps.Height); - buttonBox.Surface.Reallocate (); - var boxHeight = (float)ps.Height + (float)buttonBoxPadding.VerticalSpacing; + var boxHeight = 0f; + if (buttonBox.Children.Any ()) { + var ps = buttonBox.Surface.GetPreferredSize (true); + buttonBoxView.Frame = new System.Drawing.RectangleF ((float)buttonBoxPadding.Left, (float)buttonBoxPadding.Bottom, frame.Width - (float)buttonBoxPadding.HorizontalSpacing, (float)ps.Height); + buttonBox.Surface.Reallocate (); + boxHeight = (float)ps.Height + (float)buttonBoxPadding.VerticalSpacing; + } LayoutContent (new System.Drawing.RectangleF (0, boxHeight, frame.Width, frame.Height - boxHeight)); } |