add check for laptop and update workspace logic + several errors fixed
This commit is contained in:
parent
0a0a333472
commit
9e97d6c2e3
@ -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 {}
|
||||
|
||||
@ -6,7 +6,11 @@ import "../../reusables/"
|
||||
import "../../"
|
||||
import "../../settings/"
|
||||
|
||||
Item {
|
||||
Loader {
|
||||
id: batLoader
|
||||
active: UPower.displayDevice.isLaptopBattery
|
||||
|
||||
sourceComponent: Item {
|
||||
id: root
|
||||
implicitWidth: batRow.implicitWidth
|
||||
implicitHeight: Settings.config.barHeight
|
||||
@ -25,12 +29,12 @@ Item {
|
||||
}
|
||||
|
||||
IconImage {
|
||||
anchors.verticalCenter: batRow.verticalCenter
|
||||
id: batIcon
|
||||
anchors.verticalCenter: batRow.verticalCenter
|
||||
source: Quickshell.iconPath(UPower.displayDevice.iconName)
|
||||
implicitSize: 14
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user