mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
widget: implement triple click line selection in Editor
Fixes: https://todo.sr.ht/~eliasnaur/gio/455 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+7
-2
@@ -296,11 +296,16 @@ func (e *Editor) processPointer(gtx layout.Context) {
|
|||||||
}
|
}
|
||||||
e.dragging = true
|
e.dragging = true
|
||||||
|
|
||||||
// Process a double-click.
|
// Process multi-clicks.
|
||||||
if evt.NumClicks == 2 {
|
switch {
|
||||||
|
case evt.NumClicks == 2:
|
||||||
e.moveWord(-1, selectionClear)
|
e.moveWord(-1, selectionClear)
|
||||||
e.moveWord(1, selectionExtend)
|
e.moveWord(1, selectionExtend)
|
||||||
e.dragging = false
|
e.dragging = false
|
||||||
|
case evt.NumClicks >= 3:
|
||||||
|
e.moveStart(selectionClear)
|
||||||
|
e.moveEnd(selectionExtend)
|
||||||
|
e.dragging = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case pointer.Event:
|
case pointer.Event:
|
||||||
|
|||||||
Reference in New Issue
Block a user