From 2be46ff65ab50026e831c42b25c1a4f86eb413c4 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Fri, 15 Aug 2025 21:49:09 +1000 Subject: internal: static bar width --- modules/bar/BarWrapper.qml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'modules/bar/BarWrapper.qml') diff --git a/modules/bar/BarWrapper.qml b/modules/bar/BarWrapper.qml index cd414bb..83ff1c3 100644 --- a/modules/bar/BarWrapper.qml +++ b/modules/bar/BarWrapper.qml @@ -12,7 +12,9 @@ Item { required property PersistentProperties visibilities required property BarPopouts.Wrapper popouts - readonly property int exclusiveZone: Config.bar.persistent || visibilities.bar ? content.implicitWidth : Config.border.thickness + readonly property int padding: Math.max(Appearance.padding.smaller, Config.border.thickness) + readonly property int contentWidth: Config.bar.sizes.innerWidth + padding * 2 + readonly property int exclusiveZone: Config.bar.persistent || visibilities.bar ? contentWidth : Config.border.thickness readonly property bool shouldBeVisible: Config.bar.persistent || visibilities.bar || isHovered property bool isHovered @@ -26,14 +28,13 @@ Item { visible: width > Config.border.thickness implicitWidth: Config.border.thickness - implicitHeight: content.implicitHeight states: State { name: "visible" when: root.shouldBeVisible PropertyChanges { - root.implicitWidth: content.implicitWidth + root.implicitWidth: root.contentWidth } } @@ -67,13 +68,15 @@ Item { Loader { id: content - Component.onCompleted: active = Qt.binding(() => root.shouldBeVisible || root.visible) - anchors.top: parent.top anchors.bottom: parent.bottom anchors.right: parent.right + active: root.shouldBeVisible || root.visible + asynchronous: true + sourceComponent: Bar { + width: root.contentWidth screen: root.screen visibilities: root.visibilities popouts: root.popouts -- cgit v1.2.3-freya