mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +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
|
||||
|
||||
// Process a double-click.
|
||||
if evt.NumClicks == 2 {
|
||||
// Process multi-clicks.
|
||||
switch {
|
||||
case evt.NumClicks == 2:
|
||||
e.moveWord(-1, selectionClear)
|
||||
e.moveWord(1, selectionExtend)
|
||||
e.dragging = false
|
||||
case evt.NumClicks >= 3:
|
||||
e.moveStart(selectionClear)
|
||||
e.moveEnd(selectionExtend)
|
||||
e.dragging = false
|
||||
}
|
||||
}
|
||||
case pointer.Event:
|
||||
|
||||
Reference in New Issue
Block a user