mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
widget,widget/material: use constraints for setting up hit area
Before this change, the widget.Button.Layout method assumed the caller had set up the pointer hit area before. Further, the very common rectangular hit areas needed both an AreaOp and a widget.Button.Layout call. Make widget.Button less subtle and more useful by setting up a pointer hit area given by the incoming minimum constraints. Drop a pointer.AreaOp made redundant by the change. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -116,7 +116,6 @@ func (b ButtonLayoutStyle) Layout(gtx *layout.Context, button *widget.Button, w
|
||||
})
|
||||
}),
|
||||
layout.Expanded(func() {
|
||||
pointer.Rect(image.Rectangle{Max: gtx.Constraints.Min()}).Add(gtx.Ops)
|
||||
button.Layout(gtx)
|
||||
}),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user