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
+4 -2
View File
@@ -183,8 +183,10 @@ bindd = Ctrl+Shift+Alt+Super, Delete, Shutdown, exec, systemctl poweroff || logi
##! Screen
# Zoom
binde = Super, Minus, exec, ~/.config/hypr/hyprland/scripts/zoom.sh decrease 0.1 # Zoom out
binde = Super, Equal, exec, ~/.config/hypr/hyprland/scripts/zoom.sh increase 0.1 # Zoom in
binde = Super, Minus, exec, qs ipc call zoom zoomOut # Zoom out
binde = Super, Equal, exec, qs ipc call zoom zoomIn # Zoom in
binde = Super, Minus, exec, qs ipc call TEST_ALIVE || ~/.config/hypr/hyprland/scripts/zoom.sh decrease 0.1 # [hidden] Zoom out
binde = Super, Equal, exec, qs ipc call TEST_ALIVE || ~/.config/hypr/hyprland/scripts/zoom.sh increase 0.1 # [hidden] Zoom in
##! Media
bindl= Super+Shift, N, exec, playerctl next || playerctl position `bc <<< "100 * $(playerctl metadata mpris:length) / 1000000 / 100"` # Next track
+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)
}
}
}