With "Shrink to Button" on, the dismiss key shrinks the window to just itself: a see-through button that can be dragged anywhere. Tapping it grows the keyboard back around it, kept on screen. KWin moves and resizes the window through a one-off script, as Wayland clients can't place themselves. Also moves the window back on screen whenever it appears (KWin remembers where the button was), and releases the mouse after a window manager move or resize, which used to eat the next press on the grab bar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
32 lines
835 B
QML
32 lines
835 B
QML
import QtQuick
|
|
import Sloposk
|
|
|
|
KeyboardSurface {
|
|
id: surface
|
|
|
|
// Window-relative rect of the first key of `type`; empty if there is none.
|
|
function keyRect(type) {
|
|
for (let i = 0; i < keys.count; ++i) {
|
|
const key = keys.itemAt(i);
|
|
if (key?.keyType === type)
|
|
return key.mapToItem(null, 0, 0, key.width, key.height);
|
|
}
|
|
return Qt.rect(0, 0, 0, 0);
|
|
}
|
|
|
|
Repeater {
|
|
id: keys
|
|
model: surface.model
|
|
delegate: Key {
|
|
shiftMode: surface.controller ? surface.controller.shiftMode : KeyboardController.Off
|
|
modifierModes: surface.controller ? surface.controller.modifierModes : ({})
|
|
blank: surface.trackpadActive
|
|
}
|
|
}
|
|
|
|
AlternatesPopup {
|
|
picker: surface.alternates
|
|
z: 1
|
|
}
|
|
}
|