nosignal-shell/modules/bar/Bar.qml
2 * r + 2 * t 894fc9bfe6 bar: use loaders
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)
2025-05-01 17:01:28 +10:00

104 lines
2.6 KiB
QML

import "root:/widgets"
import "root:/config"
import Quickshell
import QtQuick
Variants {
model: Quickshell.screens
StyledWindow {
id: win
required property ShellScreen modelData
screen: modelData
name: "bar"
width: BarConfig.vertical ? BarConfig.sizes.totalHeight : -1
height: BarConfig.vertical ? -1 : BarConfig.sizes.totalHeight
anchors.top: true
anchors.left: true
anchors.right: true
// Connections {
// target: BarConfig
// function onVerticalChanged(): void {
// win.visible = false;
// if (BarConfig.vertical) {
// win.anchors.right = false;
// win.anchors.bottom = true;
// } else {
// win.anchors.bottom = false;
// win.anchors.right = true;
// }
// win.visible = true;
// }
// }
Preset {
presetName: "pills"
sourceComponent: Pills {}
}
Preset {
presetName: "panel"
sourceComponent: Panel {}
}
}
component Preset: Loader {
id: loader
required property string presetName
anchors.fill: parent
asynchronous: true
active: false
opacity: 0
states: [
State {
name: "visible"
when: BarConfig.preset.name === loader.presetName
PropertyChanges {
loader.opacity: 1
loader.active: true
}
}
]
transitions: [
Transition {
from: ""
to: "visible"
SequentialAnimation {
PropertyAction {}
NumberAnimation {
property: "opacity"
duration: Appearance.anim.durations.large
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
},
Transition {
from: "visible"
to: ""
SequentialAnimation {
NumberAnimation {
property: "opacity"
duration: Appearance.anim.durations.large
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
PropertyAction {}
}
}
]
}
}