From 8a9382940a883c2d2cc5611ce58f2abc7ada13c5 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 24 Jun 2022 14:03:17 +0200 Subject: [PATCH] widget/material: make DecorationsStyle method receivers by-value Style values are ephemeral, and pointer methods can't be called in the same expression a style value is constructed. Matches other style types. Signed-off-by: Elias Naur --- widget/material/decorations.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/widget/material/decorations.go b/widget/material/decorations.go index 9e11e964..55211bbe 100644 --- a/widget/material/decorations.go +++ b/widget/material/decorations.go @@ -38,7 +38,7 @@ func Decorations(th *Theme, deco *widget.Decorations, actions system.Action, tit } // Layout a window with its title and action buttons. -func (d *DecorationsStyle) Layout(gtx layout.Context) layout.Dimensions { +func (d DecorationsStyle) Layout(gtx layout.Context) layout.Dimensions { rec := op.Record(gtx.Ops) dims := d.layoutDecorations(gtx) decos := rec.Stop() @@ -51,7 +51,7 @@ func (d *DecorationsStyle) Layout(gtx layout.Context) layout.Dimensions { return dims } -func (d *DecorationsStyle) layoutDecorations(gtx layout.Context) layout.Dimensions { +func (d DecorationsStyle) layoutDecorations(gtx layout.Context) layout.Dimensions { gtx.Constraints.Min.Y = 0 inset := layout.UniformInset(10) return layout.Flex{