mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
widget: [API] add child widget argument to Clickable.Layout
To make the semantic relation between the clickable area and its content clear, it will be important for the clickable clip operation to cover all of the clickable content. API change: users of widget.Clickable must now pass the clickable content to Layout. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-2
@@ -36,8 +36,8 @@ func (b *Bool) History() []Press {
|
||||
return b.clk.History()
|
||||
}
|
||||
|
||||
func (b *Bool) Layout(gtx layout.Context) layout.Dimensions {
|
||||
dims := b.clk.Layout(gtx)
|
||||
func (b *Bool) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions {
|
||||
dims := b.clk.Layout(gtx, w)
|
||||
for b.clk.Clicked() {
|
||||
b.Value = !b.Value
|
||||
b.changed = true
|
||||
|
||||
Reference in New Issue
Block a user