diff --git a/modules/bar/ActiveWindow.qml b/modules/bar/ActiveWindow.qml index f3515348..5c759441 100644 --- a/modules/bar/ActiveWindow.qml +++ b/modules/bar/ActiveWindow.qml @@ -7,25 +7,26 @@ import QtQuick.Layouts ClippingBoxLayout { id: root + readonly property color colour: Appearance.colours.pink animated: true MaterialIcon { - Layout.alignment: Qt.AlignCenter text: Icons.getAppCategoryIcon(Hyprland.activeClient?.class) ?? "desktop_windows" color: root.colour + + Layout.alignment: Qt.AlignCenter } Label { - Layout.alignment: Qt.AlignCenter - text: Hyprland.activeClient?.title ?? "Desktop" font.pointSize: Appearance.font.size.smaller font.family: Appearance.font.family.mono color: root.colour - rotation: root.vertical ? 90 : 0 + + Layout.alignment: Qt.AlignCenter Layout.maximumWidth: root.vertical ? this.implicitHeight : this.implicitWidth } } diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index 6e18f50d..4015003b 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -15,15 +15,12 @@ Variants { screen: modelData namespace: "caelestia-bar" - // color: Appearance.alpha(Appearance.colours.base, false) color: "transparent" - anchors { - top: true - left: true - right: !vertical - bottom: vertical - } + anchors.top: true + anchors.left: true + anchors.right: !vertical + anchors.bottom: vertical width: contents.implicitWidth height: contents.implicitHeight diff --git a/modules/bar/Clock.qml b/modules/bar/Clock.qml index 2332f29d..99bae22b 100644 --- a/modules/bar/Clock.qml +++ b/modules/bar/Clock.qml @@ -6,21 +6,23 @@ import QtQuick.Layouts BoxLayout { id: root + readonly property color colour: Appearance.colours.peach MaterialIcon { - Layout.alignment: Qt.AlignCenter text: "calendar_month" color: root.colour + + Layout.alignment: Qt.AlignCenter } Label { - Layout.alignment: Qt.AlignCenter horizontalAlignment: Text.AlignJustify - text: root.vertical ? Time.format("hh\nmm") : Time.format("dd/MM/yy hh:mm") font.pointSize: Appearance.font.size.smaller font.family: Appearance.font.family.mono color: root.colour + + Layout.alignment: Qt.AlignCenter } } diff --git a/modules/bar/OsIcon.qml b/modules/bar/OsIcon.qml index 62ff5e69..028c3c73 100644 --- a/modules/bar/OsIcon.qml +++ b/modules/bar/OsIcon.qml @@ -7,11 +7,11 @@ import QtQuick.Layouts Box { Label { - Layout.alignment: Qt.AlignCenter - text: Icons.osIcon font.pointSize: Appearance.font.size.smaller font.family: Appearance.font.family.mono color: Appearance.colours.yellow + + Layout.alignment: Qt.AlignCenter } } diff --git a/services/Hyprland.qml b/services/Hyprland.qml index 2e249890..513d3727 100644 --- a/services/Hyprland.qml +++ b/services/Hyprland.qml @@ -15,8 +15,6 @@ Singleton { property HyprlandWorkspace activeWorkspace: null property HyprlandMonitor focusedMonitor: Hyprland.monitors.values.find(m => m.lastIpcObject.focused) ?? null - Component.onCompleted: reload() - function reload() { Hyprland.refreshWorkspaces(); Hyprland.refreshMonitors(); @@ -29,6 +27,8 @@ Singleton { Hyprland.dispatch(request); } + Component.onCompleted: reload() + Connections { target: Hyprland diff --git a/widgets/Box.qml b/widgets/Box.qml index 536469e2..d93fb690 100644 --- a/widgets/Box.qml +++ b/widgets/Box.qml @@ -17,11 +17,6 @@ Rectangle { readonly property int paddingX: getRealPadding().x readonly property int paddingY: getRealPadding().y - color: "transparent" - - implicitWidth: childrenRect.width + paddingX - implicitHeight: childrenRect.height + paddingY - function getRealPadding() { const pad = {}; @@ -49,6 +44,11 @@ Rectangle { return pad; } + color: "transparent" + + implicitWidth: childrenRect.width + paddingX + implicitHeight: childrenRect.height + paddingY + onChildrenChanged: { for (const child of children) { child.x = Qt.binding(() => paddingLeft); diff --git a/widgets/BoxLayout.qml b/widgets/BoxLayout.qml index 12aa4f7a..da68409f 100644 --- a/widgets/BoxLayout.qml +++ b/widgets/BoxLayout.qml @@ -5,6 +5,8 @@ import QtQuick.Layouts Rectangle { id: root + default property alias children: layout.children + property bool vertical: false property bool homogenous: false property bool animated: false @@ -18,11 +20,6 @@ Rectangle { readonly property int paddingX: getRealPadding().x readonly property int paddingY: getRealPadding().y - color: "transparent" - - implicitWidth: layout.implicitWidth + paddingX - implicitHeight: layout.implicitHeight + paddingY - function getRealPadding() { const pad = {}; @@ -50,7 +47,10 @@ Rectangle { return pad; } - default property alias children: layout.children + color: "transparent" + + implicitWidth: layout.implicitWidth + paddingX + implicitHeight: layout.implicitHeight + paddingY GridLayout { id: layout diff --git a/widgets/ClippingBox.qml b/widgets/ClippingBox.qml index 1ced873f..d0c9b92e 100644 --- a/widgets/ClippingBox.qml +++ b/widgets/ClippingBox.qml @@ -18,11 +18,6 @@ ClippingRectangle { readonly property int paddingX: getRealPadding().x readonly property int paddingY: getRealPadding().y - color: "transparent" - - implicitWidth: childrenRect.width + paddingX - implicitHeight: childrenRect.height + paddingY - function getRealPadding() { const pad = {}; @@ -50,6 +45,11 @@ ClippingRectangle { return pad; } + color: "transparent" + + implicitWidth: childrenRect.width + paddingX + implicitHeight: childrenRect.height + paddingY + onChildrenChanged: { for (const child of children) { child.x = Qt.binding(() => paddingLeft); diff --git a/widgets/ClippingBoxLayout.qml b/widgets/ClippingBoxLayout.qml index 2b22c8ca..e96554c6 100644 --- a/widgets/ClippingBoxLayout.qml +++ b/widgets/ClippingBoxLayout.qml @@ -6,6 +6,8 @@ import QtQuick.Layouts ClippingRectangle { id: root + default property alias children: layout.children + property bool vertical: false property bool homogenous: false property bool animated: false @@ -19,11 +21,6 @@ ClippingRectangle { readonly property int paddingX: getRealPadding().x readonly property int paddingY: getRealPadding().y - color: "transparent" - - implicitWidth: layout.implicitWidth + paddingX - implicitHeight: layout.implicitHeight + paddingY - function getRealPadding() { const pad = {}; @@ -51,7 +48,10 @@ ClippingRectangle { return pad; } - default property alias children: layout.children + color: "transparent" + + implicitWidth: layout.implicitWidth + paddingX + implicitHeight: layout.implicitHeight + paddingY GridLayout { id: layout