Use loaders for all optional components e.g. workspace windows and occupied background Fix bar preset loader usage Fix occupied group Change text on active ws colour Tray no extension for paths (use qt auto resolution)
108 lines
2.9 KiB
QML
108 lines
2.9 KiB
QML
import "root:/widgets"
|
|
import "root:/services"
|
|
import "root:/config"
|
|
import QtQuick
|
|
import Qt5Compat.GraphicalEffects
|
|
|
|
Rectangle {
|
|
id: root
|
|
|
|
required property bool vertical
|
|
required property list<Workspace> workspaces
|
|
required property Item mask
|
|
required property real maskWidth
|
|
required property real maskHeight
|
|
required property int groupOffset
|
|
|
|
readonly property Workspace currentWs: workspaces[Hyprland.activeWsId - 1 - groupOffset]
|
|
property real leading: (vertical ? currentWs?.y : currentWs?.x) ?? 0
|
|
property real trailing: (vertical ? currentWs?.y : currentWs?.x) ?? 0
|
|
property real currentSize: (currentWs?.size) ?? 0
|
|
property real size: Math.abs(leading - trailing) + currentSize
|
|
property real offset: Math.min(leading, trailing)
|
|
|
|
clip: true
|
|
x: vertical ? 1 : offset + 1
|
|
y: vertical ? offset + 1 : 1
|
|
width: (vertical ? BarConfig.sizes.innerHeight : size) - 2
|
|
height: (vertical ? size : BarConfig.sizes.innerHeight) - 2
|
|
radius: BarConfig.workspaces.rounded ? Appearance.rounding.full : 0
|
|
|
|
anchors.horizontalCenter: vertical ? parent.horizontalCenter : undefined
|
|
anchors.verticalCenter: vertical ? undefined : parent.verticalCenter
|
|
|
|
Rectangle {
|
|
id: base
|
|
|
|
visible: false
|
|
anchors.fill: parent
|
|
color: Appearance.on(root.color)
|
|
|
|
Behavior on color {
|
|
ColorAnimation {
|
|
duration: Appearance.anim.durations.normal
|
|
easing.type: Easing.BezierSpline
|
|
easing.bezierCurve: Appearance.anim.curves.standard
|
|
}
|
|
}
|
|
}
|
|
|
|
OpacityMask {
|
|
source: base
|
|
maskSource: root.mask
|
|
|
|
x: root.vertical ? 0 : -parent.offset
|
|
y: root.vertical ? -parent.offset : 0
|
|
width: root.maskWidth
|
|
height: root.maskHeight
|
|
|
|
anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined
|
|
anchors.verticalCenter: root.vertical ? undefined : parent.verticalCenter
|
|
}
|
|
|
|
Behavior on color {
|
|
ColorAnimation {
|
|
duration: Appearance.anim.durations.normal
|
|
easing.type: Easing.BezierSpline
|
|
easing.bezierCurve: Appearance.anim.curves.standard
|
|
}
|
|
}
|
|
|
|
Behavior on leading {
|
|
enabled: BarConfig.workspaces.activeTrail
|
|
|
|
Anim {}
|
|
}
|
|
|
|
Behavior on trailing {
|
|
enabled: BarConfig.workspaces.activeTrail
|
|
|
|
Anim {
|
|
duration: Appearance.anim.durations.normal * 2
|
|
}
|
|
}
|
|
|
|
Behavior on currentSize {
|
|
enabled: BarConfig.workspaces.activeTrail
|
|
|
|
Anim {}
|
|
}
|
|
|
|
Behavior on offset {
|
|
enabled: !BarConfig.workspaces.activeTrail
|
|
|
|
Anim {}
|
|
}
|
|
|
|
Behavior on size {
|
|
enabled: !BarConfig.workspaces.activeTrail
|
|
|
|
Anim {}
|
|
}
|
|
|
|
component Anim: NumberAnimation {
|
|
duration: Appearance.anim.durations.normal
|
|
easing.type: Easing.BezierSpline
|
|
easing.bezierCurve: Appearance.anim.curves.emphasized
|
|
}
|
|
}
|