From 5fd8d0f6da23030cbe043c5fd59284393781e23a Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 29 Apr 2025 10:29:30 +1000 Subject: refactor: use anchors instead of layouts --- modules/bar/components/ActiveWindow.qml | 12 ++++++------ modules/bar/components/Clock.qml | 4 ++-- modules/bar/components/OsIcon.qml | 2 +- modules/bar/components/workspaces/OccupiedBg.qml | 2 +- modules/bar/components/workspaces/Workspace.qml | 4 ++-- modules/bar/components/workspaces/Workspaces.qml | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) (limited to 'modules/bar/components') diff --git a/modules/bar/components/ActiveWindow.qml b/modules/bar/components/ActiveWindow.qml index 596c368..24edb9e 100644 --- a/modules/bar/components/ActiveWindow.qml +++ b/modules/bar/components/ActiveWindow.qml @@ -5,7 +5,7 @@ import "root:/config" import QtQuick import QtQuick.Layouts -BoxLayout { +Box { id: root readonly property color colour: Appearance.colours.pink @@ -15,20 +15,20 @@ BoxLayout { clip: true MaterialIcon { + id: icon + text: Icons.getAppCategoryIcon(Hyprland.activeClient?.class) ?? "desktop_windows" color: root.colour - - Layout.alignment: Layout.Center } - Label { + StyledText { 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: Layout.Center - Layout.maximumWidth: root.vertical ? this.implicitHeight : this.implicitWidth + anchors.left: icon.right + anchors.leftMargin: Appearance.padding.smaller } } diff --git a/modules/bar/components/Clock.qml b/modules/bar/components/Clock.qml index a34cc2c..49ef103 100644 --- a/modules/bar/components/Clock.qml +++ b/modules/bar/components/Clock.qml @@ -18,8 +18,8 @@ BoxLayout { Layout.alignment: Layout.Center } - Label { - horizontalAlignment: Label.AlignHCenter + StyledText { + horizontalAlignment: StyledText.AlignHCenter 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 diff --git a/modules/bar/components/OsIcon.qml b/modules/bar/components/OsIcon.qml index 2b99de3..5f2a103 100644 --- a/modules/bar/components/OsIcon.qml +++ b/modules/bar/components/OsIcon.qml @@ -8,7 +8,7 @@ import QtQuick.Layouts Box { padding: [Appearance.padding.smaller, 0] - Label { + StyledText { text: Icons.osIcon font.pointSize: Appearance.font.size.smaller font.family: Appearance.font.family.mono diff --git a/modules/bar/components/workspaces/OccupiedBg.qml b/modules/bar/components/workspaces/OccupiedBg.qml index 97a27a0..f6998c5 100644 --- a/modules/bar/components/workspaces/OccupiedBg.qml +++ b/modules/bar/components/workspaces/OccupiedBg.qml @@ -9,7 +9,7 @@ BoxLayout { id: root required property bool vertical - required property list