- VisibilityController: show on field focus, dismiss until next focus, manual show/hide/toggle overrides - FloatingWindow: resize from the corner grip, clamp to screen - WindowSettings: geometry per screen, debounced saves - DBusControl: org.sloposk.Keyboard Show/Hide/Toggle for global shortcuts - org.sloposk.keyboard.desktop so System Settings lists it as a virtual keyboard - README with build/run/layout docs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
45 lines
1.1 KiB
QML
45 lines
1.1 KiB
QML
import QtQuick
|
|
|
|
// Corner grip. The window grows from its top-left corner, so window
|
|
// coordinates stay put while resizing: report each step's delta.
|
|
Item {
|
|
id: grip
|
|
|
|
signal resized(real dw, real dh)
|
|
|
|
implicitWidth: 28
|
|
implicitHeight: 28
|
|
|
|
// Two strokes across the corner, each from (w - d, h) to (w, h - d).
|
|
Repeater {
|
|
model: [9, 16]
|
|
Rectangle {
|
|
required property real modelData
|
|
readonly property real inset: 4
|
|
|
|
width: modelData * Math.SQRT2
|
|
height: 2
|
|
radius: 1
|
|
color: Theme.handle
|
|
rotation: -45
|
|
x: grip.width - inset - modelData / 2 - width / 2
|
|
y: grip.height - inset - modelData / 2 - height / 2
|
|
}
|
|
}
|
|
|
|
DragHandler {
|
|
property point last
|
|
|
|
target: null
|
|
cursorShape: Qt.SizeFDiagCursor
|
|
onActiveChanged: last = centroid.scenePressPosition
|
|
onCentroidChanged: {
|
|
if (!active)
|
|
return
|
|
const p = centroid.scenePosition
|
|
grip.resized(p.x - last.x, p.y - last.y)
|
|
last = p
|
|
}
|
|
}
|
|
}
|