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) }