mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 00:45:35 +00:00
io/pointer,io/router: [API] make pass-through a property of AreaOp
We're about to make operation scopes explicit, which would result in both AreaOp and PassOp be scoped. However, PassOp seems to light to have its separate stack, so this change instead makes pass-through a property of an area. We're assuming that clients that want pass-through are also aware of the affected hit area. API change: replace PassOps with the AreaOp.PassThrough field. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -162,7 +162,7 @@ func (s ScrollbarStyle) layout(gtx layout.Context, axis layout.Axis, viewportSta
|
||||
// Stack a normal clickable area on top of the draggable area
|
||||
// to capture non-dragging clicks.
|
||||
saved := op.Save(gtx.Ops)
|
||||
pointer.PassOp{Pass: true}.Add(gtx.Ops)
|
||||
pointerArea.PassThrough = true
|
||||
pointerArea.Add(gtx.Ops)
|
||||
s.Scrollbar.AddTrack(gtx.Ops)
|
||||
saved.Load()
|
||||
@@ -208,8 +208,9 @@ func (s ScrollbarStyle) layout(gtx layout.Context, axis layout.Axis, viewportSta
|
||||
}.Op(gtx.Ops))
|
||||
|
||||
// Add the indicator pointer hit area.
|
||||
pointer.PassOp{Pass: true}.Add(gtx.Ops)
|
||||
pointer.Rect(image.Rectangle{Max: indicatorDims}).Add(gtx.Ops)
|
||||
area := pointer.Rect(image.Rectangle{Max: indicatorDims})
|
||||
area.PassThrough = true
|
||||
area.Add(gtx.Ops)
|
||||
s.Scrollbar.AddIndicator(gtx.Ops)
|
||||
|
||||
return layout.Dimensions{Size: axis.Convert(gtx.Constraints.Min)}
|
||||
|
||||
Reference in New Issue
Block a user