From 1f6729c03705cdb4cd2d49f13586cafe26d0a4c4 Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Mon, 18 May 2020 11:22:18 +0200 Subject: [PATCH] Changed margins on large dialog content. --- largedialog.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/largedialog.go b/largedialog.go index fe82abb..3bb5827 100644 --- a/largedialog.go +++ b/largedialog.go @@ -8,6 +8,8 @@ import ( "opslag.de/schobers/zntg/ui" ) +const titleBarHeight = 64 + type LargeDialog struct { ui.StackPanel @@ -24,7 +26,7 @@ func NewLargeDialog(title string, content ui.Control) *LargeDialog { dialog.titleBar = NewLargeDialogTitleBar(title, func(ctx ui.Context, state interface{}) { dialog.closeRequested.Notify(ctx, state) }) - dialog.content.Content = content + dialog.content.Content = ui.Margins(content, titleBarHeight, 20, titleBarHeight, 0) dialog.Children = []ui.Control{dialog.titleBar, &dialog.content} return dialog @@ -99,6 +101,5 @@ func (b *LargeDialogTitleBar) Arrange(ctx ui.Context, bounds geom.RectangleF32, } func (b *LargeDialogTitleBar) DesiredSize(ctx ui.Context, size geom.PointF32) geom.PointF32 { - const titleHeight = 64 - return geom.PtF32(size.X, titleHeight) + return geom.PtF32(size.X, titleBarHeight) }