initial commit for repositioning bar, currently broken

This commit is contained in:
2026-08-12 20:15:55 +02:00
parent c29b91cd26
commit 1d150292d3
8 changed files with 217 additions and 62 deletions
+24 -11
View File
@@ -15,31 +15,40 @@ import qs.Modules.Network
Item {
id: root
readonly property int contentHeight: Config.bar.height + padding * 2
readonly property int exclusiveZone: Config.bar.autoHide ? Config.bar.border : contentHeight
readonly property int clampedExtent: Math.max(Config.bar.border, extent)
readonly property int contentThickness: Config.bar.height + padding * 2
readonly property int exclusiveZone: Config.bar.autoHide ? Config.bar.border : contentThickness
property real extent: fullscreen ? 0 : Config.bar.border
required property bool fullscreen
readonly property bool horizontal: position !== "left"
property bool isHovered
readonly property int padding: Math.max(Appearance.padding.smaller, Config.bar.border)
required property Wrapper popouts
required property ClipWrapper popoutsWrapper
required property string position
required property ShellScreen screen
readonly property bool shouldBeVisible: !fullscreen && (!Config.bar.autoHide || visibilities.bar || isHovered)
readonly property int vPadding: 6
required property PersistentProperties visibilities
function checkPopout(x: real): void {
content.item?.checkPopout(x);
function checkPopout(pos: real): void {
(content.item as Bar)?.checkPopout(pos);
}
implicitHeight: fullscreen ? 0 : Config.bar.border
visible: height > Config.bar.border
function entryAt(pos: real): string {
return (content.item as Bar)?.entryAt(pos) ?? "";
}
implicitHeight: extent
implicitWidth: extent
visible: extent > Config.bar.border
states: State {
name: "visible"
when: root.shouldBeVisible
PropertyChanges {
root.implicitHeight: root.contentHeight
root.extent: root.contentThickness
}
}
transitions: [
@@ -50,7 +59,7 @@ Item {
Anim {
duration: MaterialEasing.expressiveEffectsTime
easing.bezierCurve: MaterialEasing.expressiveEffects
property: "implicitHeight"
property: "extent"
target: root
}
},
@@ -61,7 +70,7 @@ Item {
Anim {
duration: MaterialEasing.expressiveEffectsTime
easing.bezierCurve: MaterialEasing.expressiveEffects
property: "implicitHeight"
property: "extent"
target: root
}
}
@@ -71,13 +80,17 @@ Item {
id: content
active: root.shouldBeVisible || root.visible
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.bottom: root.position !== "bottom" ? parent.bottom : undefined
anchors.left: root.horizontal ? parent.left : undefined
anchors.right: parent.right
anchors.top: root.position !== "top" ? parent.top : undefined
height: root.contentThickness
width: root.contentThickness
sourceComponent: Bar {
fullscreen: root.fullscreen
height: root.contentHeight
horizontal: root.horizontal
popouts: root.popouts
popoutsWrapper: root.popoutsWrapper
screen: root.screen