mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-20 22:14:35 -04:00
fix(tracker/gioui): knobs/switches capture scrollwheel only active
This commit is contained in:
parent
edc0782f5f
commit
072e4ee208
@ -262,8 +262,13 @@ func (k *KnobWidget) Layout(gtx C) D {
|
|||||||
layout.Stacked(knob),
|
layout.Stacked(knob),
|
||||||
layout.Stacked(label.Layout))
|
layout.Stacked(label.Layout))
|
||||||
}
|
}
|
||||||
|
if !k.Scroll {
|
||||||
|
defer pointer.PassOp{}.Push(gtx.Ops).Pop()
|
||||||
|
}
|
||||||
defer clip.Rect(image.Rectangle{Max: gtx.Constraints.Max}).Push(gtx.Ops).Pop()
|
defer clip.Rect(image.Rectangle{Max: gtx.Constraints.Max}).Push(gtx.Ops).Pop()
|
||||||
event.Op(gtx.Ops, k.State)
|
if k.Scroll {
|
||||||
|
event.Op(gtx.Ops, k.State)
|
||||||
|
}
|
||||||
k.State.drag.Add(gtx.Ops)
|
k.State.drag.Add(gtx.Ops)
|
||||||
if k.Hint != "" {
|
if k.Hint != "" {
|
||||||
c := gtx.Constraints
|
c := gtx.Constraints
|
||||||
@ -362,9 +367,11 @@ func (s *SwitchWidget) Layout(gtx C) D {
|
|||||||
s.State.tipArea.Appear(gtx.Now)
|
s.State.tipArea.Appear(gtx.Now)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
defer clip.Rect(image.Rectangle{Max: gtx.Constraints.Max}).Push(gtx.Ops).Pop()
|
if s.Scroll {
|
||||||
event.Op(gtx.Ops, s.State)
|
defer pointer.PassOp{}.Push(gtx.Ops).Pop()
|
||||||
s.State.drag.Add(gtx.Ops)
|
defer clip.Rect(image.Rectangle{Max: gtx.Constraints.Max}).Push(gtx.Ops).Pop()
|
||||||
|
event.Op(gtx.Ops, s.State)
|
||||||
|
}
|
||||||
return layout.Center.Layout(gtx, s.layoutSwitch)
|
return layout.Center.Layout(gtx, s.layoutSwitch)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user