mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
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 <mail@eliasnaur.com>
This commit is contained in:
@@ -38,7 +38,7 @@ func Decorations(th *Theme, deco *widget.Decorations, actions system.Action, tit
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Layout a window with its title and action buttons.
|
// 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)
|
rec := op.Record(gtx.Ops)
|
||||||
dims := d.layoutDecorations(gtx)
|
dims := d.layoutDecorations(gtx)
|
||||||
decos := rec.Stop()
|
decos := rec.Stop()
|
||||||
@@ -51,7 +51,7 @@ func (d *DecorationsStyle) Layout(gtx layout.Context) layout.Dimensions {
|
|||||||
return dims
|
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
|
gtx.Constraints.Min.Y = 0
|
||||||
inset := layout.UniformInset(10)
|
inset := layout.UniformInset(10)
|
||||||
return layout.Flex{
|
return layout.Flex{
|
||||||
|
|||||||
Reference in New Issue
Block a user