Floating polish: visibility, resize, saved geometry, D-Bus, desktop entry
- 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>
This commit is contained in:
@@ -17,6 +17,8 @@ Window {
|
||||
|
||||
width: 1000
|
||||
height: 340 + popupMargin
|
||||
minimumWidth: 480
|
||||
minimumHeight: 180 + popupMargin
|
||||
visible: false
|
||||
color: "transparent"
|
||||
|
||||
@@ -42,5 +44,10 @@ Window {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user