mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 23:09:26 -05:00
68 lines
1.8 KiB
QML
68 lines
1.8 KiB
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
import Quickshell
|
|
import Quickshell.Widgets
|
|
import qs
|
|
import qs.services
|
|
import qs.modules.common
|
|
import qs.modules.common.widgets
|
|
import qs.modules.common.widgets.widgetCanvas
|
|
|
|
import qs.modules.overlay.crosshair
|
|
|
|
Item {
|
|
id: root
|
|
readonly property bool usePasswordChars: !PolkitService.flow?.responseVisible ?? true
|
|
|
|
Keys.onPressed: (event) => { // Esc to close
|
|
if (event.key === Qt.Key_Escape) {
|
|
GlobalStates.overlayOpen = false;
|
|
}
|
|
}
|
|
|
|
property real initScale: Config.options.overlay.openingZoomAnimation ? 1.08 : 1.000001
|
|
scale: initScale
|
|
Component.onCompleted: {
|
|
scale = 1
|
|
}
|
|
Behavior on scale {
|
|
animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this)
|
|
}
|
|
|
|
Rectangle {
|
|
id: bg
|
|
anchors.fill: parent
|
|
color: Appearance.colors.colScrim
|
|
visible: Config.options.overlay.darkenScreen && opacity > 0
|
|
opacity: (GlobalStates.overlayOpen && root.scale !== initScale) ? 1 : 0
|
|
Behavior on opacity {
|
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
|
}
|
|
}
|
|
|
|
WidgetCanvas {
|
|
anchors.fill: parent
|
|
onClicked: GlobalStates.overlayOpen = false
|
|
|
|
OverlayTaskbar {
|
|
anchors {
|
|
horizontalCenter: parent.horizontalCenter
|
|
top: parent.top
|
|
topMargin: 50
|
|
}
|
|
}
|
|
|
|
Repeater {
|
|
model: ScriptModel {
|
|
values: Persistent.states.overlay.open.map(identifier => {
|
|
return OverlayContext.availableWidgets.find(w => w.identifier === identifier);
|
|
})
|
|
objectProp: "identifier"
|
|
}
|
|
delegate: OverlayWidgetDelegateChooser {
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|