smooth zooming

This commit is contained in:
end-4
2025-07-05 09:04:52 +02:00
parent f973052d16
commit 4e71d002ea
2 changed files with 24 additions and 2 deletions
+20
View File
@@ -14,6 +14,14 @@ Singleton {
property bool workspaceShowNumbers: false
property bool superReleaseMightTrigger: true
property real screenZoom: 1
onScreenZoomChanged: {
Quickshell.execDetached(["hyprctl", "keyword", "cursor:zoom_factor", root.screenZoom.toString()]);
}
Behavior on screenZoom {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
}
// When user is not reluctant while pressing super, they probably don't need to see workspace numbers
onSuperReleaseMightTriggerChanged: {
workspaceShowNumbersTimer.stop()
@@ -41,4 +49,16 @@ Singleton {
workspaceShowNumbers = false
}
}
IpcHandler {
target: "zoom"
function zoomIn() {
screenZoom = Math.min(screenZoom + 0.4, 3.0)
}
function zoomOut() {
screenZoom = Math.max(screenZoom - 0.4, 1)
}
}
}