~eliasnaur/gio

gio/gesture d---------
all: implement staticcheck suggestions

Signed-off-by: Elias Naur <mail@eliasnaur.com>
widget,widget/material: add Float and Slider

Signed-off-by: Gordon Klaus <gordon.klaus@gmail.com>
gesture: always drag scroll on Android

Mice drags scroll on Android by convention. Further, ChromeOS converts
two-finger touchpad scroll gestures to press-drag with Source == Mouse.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
all: make unit.Converter concrete and rename to Metric

An interface for scaling dp and sp is overkill, at least for all
current uses. Make it a concrete struct type, and rename it to the
shorter and more precise Metric.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
gesture: remove Click.State and cancel Click gesture on outside Release

Signed-off-by: Elias Naur <mail@eliasnaur.com>
widget,gesture: fade out cancelled inkwells

While here, adjust inkwell sizes to match gtx.Constraints.Min.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
gesture,widget: drop press markers on gesture cancel

Signed-off-by: Elias Naur <mail@eliasnaur.com>
io/pointer,io/router,gesture: add pointer.Foremost priority

Replace the pointer.Scroll special case with a new priority that
indicates the foremost handler, checked in gesture.Scroll.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
io/pointer: add Drag event type

This eliminates needless redraws for handlers that care about drag events and not move events, like gesture.Scroll.

Signed-off-by: Gordon Klaus <gordon.klaus@gmail.com>
io/pointer: add InputOp.Types to specify which types of events to receive

Signed-off-by: Gordon Klaus <gordon.klaus@gmail.com>
io/pointer,gesture,app/internal/window: add pointer.Scroll event type

Signed-off-by: Gordon Klaus <gordon.klaus@gmail.com>
io/router: simplify pointer event routing

- Drop pointer.Event.Hit in favour of Enter/Leave events.
- Track enter/leaves for each pointer.ID (updates #122). Add test.
- Resolve grabs once.
- Get rid of scratch slice.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
all: rename io/event.Key to Tag

Key had an unfortunate association with keyboard input.

This is an API change. The following rewrites were run to fixup
Gio code:

        $ gofmt -r 'pointer.InputOp{Key:a} -> pointer.InputOp{Tag:a}' -w .
        $ gofmt -r 'pointer.InputOp{Key:a, Grab:b} -> pointer.InputOp{Tag:a, Grab:b}' -w .
        $ gofmt -r 'key.InputOp{Key:a} -> key.InputOp{Tag:a}' -w .
        $ gofmt -r 'key.InputOp{Key:a, Focus:b} -> key.InputOp{Tag:a, Focus:b}' -w .
        $ gofmt -r 'event.Key -> event.Tag' -w .

Signed-off-by: Elias Naur <mail@eliasnaur.com>
Revert "gesture: only report TypePress for Click gestures if pointer is grabbed"

This reverts commit 062e2bc54b109c3ed6b2fa295c4a63aaedcda95d.

Reason: delays the press too much for the common case of an embedding List.
gesture: only report TypePress for Click gestures if pointer is grabbed

Signed-off-by: Elias Naur <mail@eliasnaur.com>
gesture: use Enter/Leave events instead of Moves

Signed-off-by: Elias Naur <mail@eliasnaur.com>
gesture: support multiple click actions

Double click or tap actions are common in user interfaces and this
commit adds support for it in the gesture package.
ClickEvent has now a new field NumClicks that contains the number of
successive clicks that occurred within 200ms.

Fixes gio#101

Signed-off-by: Pierre.Curto <pierre.curto@gmail.com>
gesture: fix typo

Signed-off-by: Elias Naur <mail@eliasnaur.com>
gesture,internal/fling: fix rounding

The code tried to extract a rounded whole number of pixels while preserving the
fraction. However, it failed to converge for the value 0.5, rounded to 1,
leaving -0.5, rounded to -1, leaving 0.5 and so on.

Drop the cleverness and truncate the values instead.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
several: add modifiers to mouse events and clicks

macOS only, for the os-specific bits.

Signed-off-by: Larry Clapp <larry@theclapp.org>
io/pointer,gesture: report right and middle mouse button events

Updates gio#60

Signed-off-by: Elias Naur <mail@eliasnaur.com>
Next