mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
widget: fix handling of disabled context in Draggable
While here, add an example on how to use the Draggable widget. Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
@@ -26,6 +26,9 @@ type Draggable struct {
|
||||
}
|
||||
|
||||
func (d *Draggable) Layout(gtx layout.Context, w, drag layout.Widget) layout.Dimensions {
|
||||
if gtx.Queue == nil {
|
||||
return w(gtx)
|
||||
}
|
||||
pos := d.pos
|
||||
for _, ev := range d.drag.Events(gtx.Metric, gtx.Queue, gesture.Both) {
|
||||
switch ev.Type {
|
||||
|
||||
Reference in New Issue
Block a user