Gestures: flick, long-press alternates, trackpad, layer slide, rollover
- PointerTracker: per-finger gesture state machine (pure, unit-tested) - AlternatesPicker + AlternatesPopup.qml: long-press choices, finger selects - Space long-press trackpad moves the cursor with arrow keysyms - Slide from .?123 onto a symbol types it and switches back - New finger commits pending taps (iOS rollover) - Flick animation: secondary symbol slides down as the finger moves - Transparent popup margin with an input region that passes clicks through - tst_keyboardsurface: end-to-end gesture tests on the real QML Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
import QtQuick
|
||||
import Sloposk
|
||||
|
||||
// Long-press choices above a key; the one under the finger is highlighted.
|
||||
Item {
|
||||
id: popup
|
||||
|
||||
required property AlternatesPicker picker
|
||||
|
||||
visible: picker.open
|
||||
x: picker.rect.x
|
||||
y: picker.rect.y
|
||||
width: picker.rect.width
|
||||
height: picker.rect.height
|
||||
|
||||
Rectangle {
|
||||
anchors { fill: background; topMargin: 1; bottomMargin: -2 }
|
||||
radius: background.radius
|
||||
color: Theme.keyShadow
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: background
|
||||
anchors.fill: parent
|
||||
radius: Theme.keyRadius + 2
|
||||
color: Theme.characterKey
|
||||
}
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
|
||||
Repeater {
|
||||
model: popup.picker.choices
|
||||
|
||||
delegate: Rectangle {
|
||||
required property string modelData
|
||||
required property int index
|
||||
readonly property bool selected: index === popup.picker.selected
|
||||
|
||||
width: popup.width / popup.picker.choices.length
|
||||
height: popup.height
|
||||
radius: Theme.keyRadius
|
||||
color: selected ? Theme.accent : "transparent"
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: parent.modelData
|
||||
font.pixelSize: parent.height * 0.4
|
||||
color: parent.selected ? Theme.accentText : Theme.text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user