diff --git a/modules/Bar/Bar.qml b/modules/Bar/Bar.qml index f0b82fc..f52ddca 100644 --- a/modules/Bar/Bar.qml +++ b/modules/Bar/Bar.qml @@ -7,6 +7,7 @@ import QtQuick.Layouts Variants { model: Quickshell.screens + delegate: PanelWindow { id: root required property var modelData @@ -23,7 +24,7 @@ Variants { anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter Workspaces { - screen: root.screen + property var screen: modelData } } @@ -36,8 +37,8 @@ Variants { } Row { - spacing: 10 id: rightStuff + spacing: 10 anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter Volume {} diff --git a/modules/Bar/Battery.qml b/modules/Bar/Battery.qml index a3bb5e7..6e196e5 100644 --- a/modules/Bar/Battery.qml +++ b/modules/Bar/Battery.qml @@ -6,31 +6,35 @@ import "../../reusables/" import "../../" import "../../settings/" -Item { - id: root - implicitWidth: batRow.implicitWidth - implicitHeight: Settings.config.barHeight - Rectangle { - id: batRow - implicitWidth: batText.implicitWidth + batIcon.implicitWidth + 10 - color: "transparent" +Loader { + id: batLoader + active: UPower.displayDevice.isLaptopBattery + sourceComponent: Item { + id: root + implicitWidth: batRow.implicitWidth implicitHeight: Settings.config.barHeight - Row { - anchors.centerIn: batRow - anchors.verticalCenter: batRow.verticalCenter - CustomText { - id: batText - text: Math.round(UPower.displayDevice.percentage * 100) + "%" - } + Rectangle { + id: batRow + implicitWidth: batText.implicitWidth + batIcon.implicitWidth + 10 + color: "transparent" - IconImage { + implicitHeight: Settings.config.barHeight + Row { + anchors.centerIn: batRow anchors.verticalCenter: batRow.verticalCenter - id: batIcon - source: Quickshell.iconPath(UPower.displayDevice.iconName) - implicitSize: 14 - } - + CustomText { + id: batText + text: Math.round(UPower.displayDevice.percentage * 100) + "%" + } + + IconImage { + id: batIcon + anchors.verticalCenter: batRow.verticalCenter + source: Quickshell.iconPath(UPower.displayDevice.iconName) + implicitSize: 14 + } + } } } } diff --git a/modules/Bar/Title.qml b/modules/Bar/Title.qml index 53c8cb4..94db03f 100644 --- a/modules/Bar/Title.qml +++ b/modules/Bar/Title.qml @@ -13,6 +13,6 @@ Item { id: text anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - text: Hyprland.activeToplevel.activated ? Hyprland.activeToplevel.title : "sigma" + text: Hyprland.activeToplevel ? Hyprland.activeToplevel.title : "Desktop" } } diff --git a/modules/Bar/Workspaces.qml b/modules/Bar/Workspaces.qml index fc97766..8a43e63 100644 --- a/modules/Bar/Workspaces.qml +++ b/modules/Bar/Workspaces.qml @@ -10,7 +10,6 @@ Item { id: root implicitWidth: workspaceRow.implicitWidth height: 30 - required property var screen Row { id: workspaceRow anchors.centerIn: parent @@ -22,7 +21,18 @@ Item { anchors.centerIn: parent Rectangle { id: workspaceNumber - property bool isOnMon: modelData.monitor == Hyprland.monitorFor(root.screen) + property bool isOnMon: { + if (!modelData) + return false; + + if (!modelData.monitor) + return false; + + if (!root.screen) + return false; + return modelData.monitor.name === root.screen.name; + } + required property var modelData width: isOnMon ? Settings.config.barHeight + 10 : 0 height: isOnMon ? Settings.config.barHeight : 0 diff --git a/modules/overlays/Wallpaper.qml b/modules/overlays/Wallpaper.qml index 2676172..7ed2f0c 100644 --- a/modules/overlays/Wallpaper.qml +++ b/modules/overlays/Wallpaper.qml @@ -7,8 +7,10 @@ Variants { id: root model: Quickshell.screens delegate: WlrLayershell { - required property var modelData id: wpShell + + required property var modelData + screen: modelData anchors { left: true top: true @@ -19,8 +21,8 @@ Variants { Image { fillMode: Image.Stretch source: Settings.config.currentWall - width: modelData.width - height: modelData.height + width: wpShell.modelData.width + height: wpShell.modelData.height } } }