forked from Shinonome/dots-hyprland
75 lines
2.0 KiB
QML
75 lines
2.0 KiB
QML
import qs.modules.common
|
|
import qs
|
|
import QtQuick
|
|
import Quickshell
|
|
import Quickshell.Hyprland
|
|
import Quickshell.Io
|
|
pragma Singleton
|
|
pragma ComponentBehavior: Bound
|
|
|
|
Singleton {
|
|
id: root
|
|
property bool barOpen: true
|
|
property bool sidebarLeftOpen: false
|
|
property bool sidebarRightOpen: false
|
|
property bool mediaControlsOpen: false
|
|
property bool osdBrightnessOpen: false
|
|
property bool osdVolumeOpen: false
|
|
property bool oskOpen: false
|
|
property bool overviewOpen: false
|
|
property bool screenLocked: false
|
|
property bool screenLockContainsCharacters: false
|
|
property bool sessionOpen: false
|
|
property bool superDown: false
|
|
property bool superReleaseMightTrigger: true
|
|
property bool workspaceShowNumbers: false
|
|
|
|
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()
|
|
}
|
|
|
|
Timer {
|
|
id: workspaceShowNumbersTimer
|
|
interval: Config.options.bar.workspaces.showNumberDelay
|
|
repeat: false
|
|
onTriggered: {
|
|
workspaceShowNumbers = true
|
|
}
|
|
}
|
|
|
|
GlobalShortcut {
|
|
name: "workspaceNumber"
|
|
description: "Hold to show workspace numbers, release to show icons"
|
|
|
|
onPressed: {
|
|
root.superDown = true
|
|
workspaceShowNumbersTimer.start()
|
|
}
|
|
onReleased: {
|
|
root.superDown = false
|
|
workspaceShowNumbersTimer.stop()
|
|
workspaceShowNumbers = false
|
|
}
|
|
}
|
|
|
|
IpcHandler {
|
|
target: "zoom"
|
|
|
|
function zoomIn() {
|
|
screenZoom = Math.min(screenZoom + 0.4, 3.0)
|
|
}
|
|
|
|
function zoomOut() {
|
|
screenZoom = Math.max(screenZoom - 0.4, 1)
|
|
}
|
|
}
|
|
} |