- 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>
54 lines
1.6 KiB
QML
54 lines
1.6 KiB
QML
import QtQuick
|
|
import Sloposk
|
|
|
|
Window {
|
|
id: root
|
|
|
|
required property LayoutModel layoutModel
|
|
required property KeyboardController controller
|
|
property var placement: null // FloatingWindow, set from C++
|
|
|
|
// Transparent room above the keyboard for long-press popups on the top row.
|
|
readonly property real popupMargin: 90
|
|
// Outside this, input passes through to whatever is below the window.
|
|
readonly property rect inputRegion: keyboard.alternates.open
|
|
? Qt.rect(0, 0, width, height)
|
|
: Qt.rect(panel.x, panel.y, panel.width, panel.height)
|
|
|
|
width: 1000
|
|
height: 340 + popupMargin
|
|
minimumWidth: 480
|
|
minimumHeight: 180 + popupMargin
|
|
visible: false
|
|
color: "transparent"
|
|
|
|
onInputRegionChanged: placement?.setInputRegion(inputRegion)
|
|
onPlacementChanged: placement?.setInputRegion(inputRegion)
|
|
|
|
Rectangle {
|
|
id: panel
|
|
anchors { fill: parent; topMargin: root.popupMargin }
|
|
radius: Theme.windowRadius
|
|
color: Theme.background
|
|
|
|
Keyboard {
|
|
id: keyboard
|
|
anchors { left: parent.left; right: parent.right; top: parent.top; bottom: handle.top }
|
|
anchors.margins: 2
|
|
model: root.layoutModel
|
|
controller: root.controller
|
|
}
|
|
|
|
DragHandle {
|
|
id: handle
|
|
anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
|
|
onMoved: (dx, dy) => root.placement?.moveBy(dx, dy)
|
|
}
|
|
|
|
ResizeHandle {
|
|
anchors { right: parent.right; bottom: parent.bottom }
|
|
onResized: (dw, dh) => root.placement?.resizeBy(dw, dh)
|
|
}
|
|
}
|
|
}
|