78 lines
1.7 KiB
QML
78 lines
1.7 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import qs.modules.bar.popouts as BarPopouts
|
|
import qs.config
|
|
import qs.custom
|
|
import qs.util
|
|
import Quickshell
|
|
import Quickshell.Hyprland
|
|
import QtQuick
|
|
|
|
Item {
|
|
id: root
|
|
|
|
required property PersistentProperties uiState
|
|
required property BarPopouts.Wrapper popouts
|
|
|
|
visible: width > 0
|
|
implicitWidth: 0
|
|
implicitHeight: content.implicitHeight
|
|
|
|
states: State {
|
|
name: "visible"
|
|
when: root.uiState.dashboard
|
|
|
|
PropertyChanges {
|
|
root.implicitWidth: content.implicitWidth
|
|
}
|
|
}
|
|
|
|
transitions: [
|
|
Transition {
|
|
from: ""
|
|
to: "visible"
|
|
|
|
Anim {
|
|
target: root
|
|
property: "implicitWidth"
|
|
duration: Config.anim.durations.expressiveDefaultSpatial
|
|
easing.bezierCurve: Config.anim.curves.expressiveDefaultSpatial
|
|
}
|
|
},
|
|
Transition {
|
|
from: "visible"
|
|
to: ""
|
|
|
|
Anim {
|
|
target: root
|
|
property: "implicitWidth"
|
|
easing.bezierCurve: Config.anim.curves.emphasized
|
|
}
|
|
}
|
|
]
|
|
|
|
Background {
|
|
id: background
|
|
visible: false
|
|
wrapper: root
|
|
}
|
|
|
|
GlowEffect {
|
|
source: background
|
|
glowColor: content.active ? content.item.color : "transparent"
|
|
}
|
|
|
|
Loader {
|
|
id: content
|
|
|
|
Component.onCompleted: active = Qt.binding(() => root.uiState.dashboard || root.visible)
|
|
|
|
anchors.right: parent.right
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
sourceComponent: Content {
|
|
uiState: root.uiState
|
|
popouts: root.popouts
|
|
}
|
|
}
|
|
}
|