mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-02 16:06:19 +00:00
widget/material: use cosntraints for setting pointer hit areas
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -114,7 +114,9 @@ func (b ButtonLayoutStyle) Layout(gtx *layout.Context, button *widget.Button, w
|
||||
w()
|
||||
})
|
||||
})
|
||||
pointer.Rect(image.Rectangle{Max: gtx.Dimensions.Size}).Add(gtx.Ops)
|
||||
}),
|
||||
layout.Expanded(func() {
|
||||
pointer.Rect(image.Rectangle{Max: gtx.Constraints.Min()}).Add(gtx.Ops)
|
||||
button.Layout(gtx)
|
||||
}),
|
||||
)
|
||||
@@ -146,7 +148,9 @@ func (b IconButtonStyle) Layout(gtx *layout.Context, button *widget.Button) {
|
||||
Size: image.Point{X: size, Y: size},
|
||||
}
|
||||
})
|
||||
pointer.Ellipse(image.Rectangle{Max: gtx.Dimensions.Size}).Add(gtx.Ops)
|
||||
}),
|
||||
layout.Expanded(func() {
|
||||
pointer.Ellipse(image.Rectangle{Max: gtx.Constraints.Min()}).Add(gtx.Ops)
|
||||
button.Layout(gtx)
|
||||
}),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user