summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-24 13:31:36 +0800
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-24 13:31:36 +0800
commit01b38be6afbe660e3b9f9e136870a76afb69bf31 (patch)
treea18c46b9d8fb0261addeadb89ca2a8ebd22f0ccc
parentdashboard: default weather (diff)
downloadcaelestia-shell-01b38be6afbe660e3b9f9e136870a76afb69bf31.tar.gz
caelestia-shell-01b38be6afbe660e3b9f9e136870a76afb69bf31.tar.bz2
caelestia-shell-01b38be6afbe660e3b9f9e136870a76afb69bf31.zip
internal: fix binding loops
-rw-r--r--modules/bar/components/ActiveWindow.qml6
-rw-r--r--modules/bar/components/Clock.qml8
-rw-r--r--modules/bar/components/StatusIcons.qml9
-rw-r--r--modules/bar/components/Tray.qml8
-rw-r--r--modules/launcher/Content.qml3
-rw-r--r--modules/notifications/Notification.qml2
-rw-r--r--widgets/StyledRect.qml2
7 files changed, 31 insertions, 7 deletions
diff --git a/modules/bar/components/ActiveWindow.qml b/modules/bar/components/ActiveWindow.qml
index 75dfc43..b2b9572 100644
--- a/modules/bar/components/ActiveWindow.qml
+++ b/modules/bar/components/ActiveWindow.qml
@@ -15,12 +15,16 @@ Item {
implicitWidth: child.implicitWidth
implicitHeight: child.implicitHeight
- StyledRect {
+ Item {
id: child
+ readonly property bool vertical: root.vertical
+
anchors.centerIn: parent
clip: true
+ implicitWidth: root.vertical ? Math.max(icon.implicitWidth, text.implicitHeight) : icon.implicitWidth + text.implicitWidth + text.anchors.leftMargin
+ implicitHeight: root.vertical ? icon.implicitHeight + text.implicitWidth + text.anchors.topMargin : Math.max(icon.implicitHeight, text.implicitheight)
MaterialIcon {
id: icon
diff --git a/modules/bar/components/Clock.qml b/modules/bar/components/Clock.qml
index 3397222..bec7e30 100644
--- a/modules/bar/components/Clock.qml
+++ b/modules/bar/components/Clock.qml
@@ -3,11 +3,15 @@ import "root:/services"
import "root:/config"
import QtQuick
-StyledRect {
+Item {
id: root
+ readonly property bool vertical: parent?.vertical ?? false
property color colour: Colours.palette.peach
+ implicitWidth: vertical ? Math.max(icon.implicitWidth, text.implicitWidth) : icon.implicitWidth + text.implicitWidth + text.anchors.leftMargin
+ implicitHeight: vertical ? icon.implicitHeight + text.implicitHeight + text.anchors.topMargin : Math.max(icon.implicitHeight, text.implicitHeight)
+
MaterialIcon {
id: icon
@@ -18,6 +22,8 @@ StyledRect {
}
AnchorText {
+ id: text
+
prevAnchor: icon
horizontalAlignment: StyledText.AlignHCenter
diff --git a/modules/bar/components/StatusIcons.qml b/modules/bar/components/StatusIcons.qml
index 62823e0..14c02f9 100644
--- a/modules/bar/components/StatusIcons.qml
+++ b/modules/bar/components/StatusIcons.qml
@@ -5,12 +5,15 @@ import "root:/config"
import Quickshell
import QtQuick
-StyledRect {
+Item {
id: root
+ readonly property bool vertical: parent?.vertical ?? false
property color colour: Colours.palette.rosewater
clip: true
+ implicitWidth: vertical ? Math.max(network.implicitWidth, bluetooth.implicitWidth, devices.implicitWidth) : network.implicitWidth + bluetooth.implicitWidth + bluetooth.anchors.leftMargin + (repeater.count > 0 ? devices.implicitWidth + devices.anchors.leftMargin : 0)
+ implicitHeight: vertical ? network.implicitHeight + bluetooth.implicitHeight + bluetooth.anchors.topMargin + (repeater.count > 0 ? devices.implicitHeight + devices.anchors.topMargin : 0) : Math.max(network.implicitHeight, bluetooth.implicitHeight, devices.implicitHeight)
MaterialIcon {
id: network
@@ -35,6 +38,8 @@ StyledRect {
}
Box {
+ id: devices
+
anchors.left: vertical ? undefined : bluetooth.right
anchors.leftMargin: vertical ? 0 : Appearance.padding.smaller
anchors.top: vertical ? bluetooth.bottom : undefined
@@ -44,6 +49,8 @@ StyledRect {
anchors.verticalCenter: vertical ? undefined : bluetooth.verticalCenter
Repeater {
+ id: repeater
+
model: ScriptModel {
values: Bluetooth.devices.filter(d => d.connected)
}
diff --git a/modules/bar/components/Tray.qml b/modules/bar/components/Tray.qml
index ccebe1f..8ccd48a 100644
--- a/modules/bar/components/Tray.qml
+++ b/modules/bar/components/Tray.qml
@@ -4,15 +4,21 @@ import "root:/config"
import Quickshell.Services.SystemTray
import QtQuick
-StyledRect {
+Item {
id: root
+ readonly property bool vertical: parent?.vertical ?? false
property color colour: Colours.palette.lavender
clip: true
visible: width > 0 && height > 0 // To avoid warnings about being visible with no size
+ implicitWidth: layout.implicitWidth
+ implicitHeight: layout.implicitHeight
+
BoxLayout {
+ id: layout
+
Repeater {
model: SystemTray.items
diff --git a/modules/launcher/Content.qml b/modules/launcher/Content.qml
index be3667d..54cc872 100644
--- a/modules/launcher/Content.qml
+++ b/modules/launcher/Content.qml
@@ -50,6 +50,8 @@ Item {
anchors.bottom: parent.bottom
anchors.margins: root.padding
+ implicitHeight: Math.max(searchIcon.implicitHeight, search.implicitHeight, clearIcon.implicitHeight)
+
MaterialIcon {
id: searchIcon
@@ -139,6 +141,7 @@ Item {
anchors.fill: parent
hoverEnabled: true
+ cursorShape: search.text ? Qt.PointingHandCursor : undefined
onEntered: hovered = true
onExited: hovered = false
diff --git a/modules/notifications/Notification.qml b/modules/notifications/Notification.qml
index cc446c9..d8c8ba7 100644
--- a/modules/notifications/Notification.qml
+++ b/modules/notifications/Notification.qml
@@ -21,7 +21,7 @@ StyledRect {
color: root.modelData?.urgency === NotificationUrgency.Critical ? Colours.palette.m3secondaryContainer : Colours.palette.m3surfaceContainer
radius: Appearance.rounding.normal
implicitWidth: NotifsConfig.sizes.width
- implicitHeight: inner.height
+ implicitHeight: inner.implicitHeight
x: NotifsConfig.sizes.width
Component.onCompleted: x = 0
diff --git a/widgets/StyledRect.qml b/widgets/StyledRect.qml
index 1b6f1e7..8b3ac05 100644
--- a/widgets/StyledRect.qml
+++ b/widgets/StyledRect.qml
@@ -7,8 +7,6 @@ Rectangle {
property bool vertical: parent?.vertical ?? false // Convenience property for propagation to children
color: "transparent"
- implicitWidth: childrenRect.width
- implicitHeight: childrenRect.height
Behavior on color {
ColorAnimation {