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 {
|
Variants {
|
||||||
model: Quickshell.screens
|
model: Quickshell.screens
|
||||||
|
|
||||||
delegate: PanelWindow {
|
delegate: PanelWindow {
|
||||||
id: root
|
id: root
|
||||||
required property var modelData
|
required property var modelData
|
||||||
@ -23,7 +24,7 @@ Variants {
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
Workspaces {
|
Workspaces {
|
||||||
screen: root.screen
|
property var screen: modelData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,8 +37,8 @@ Variants {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
spacing: 10
|
|
||||||
id: rightStuff
|
id: rightStuff
|
||||||
|
spacing: 10
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
Volume {}
|
Volume {}
|
||||||
|
|||||||
@ -6,7 +6,11 @@ import "../../reusables/"
|
|||||||
import "../../"
|
import "../../"
|
||||||
import "../../settings/"
|
import "../../settings/"
|
||||||
|
|
||||||
Item {
|
Loader {
|
||||||
|
id: batLoader
|
||||||
|
active: UPower.displayDevice.isLaptopBattery
|
||||||
|
|
||||||
|
sourceComponent: Item {
|
||||||
id: root
|
id: root
|
||||||
implicitWidth: batRow.implicitWidth
|
implicitWidth: batRow.implicitWidth
|
||||||
implicitHeight: Settings.config.barHeight
|
implicitHeight: Settings.config.barHeight
|
||||||
@ -25,12 +29,12 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
IconImage {
|
IconImage {
|
||||||
anchors.verticalCenter: batRow.verticalCenter
|
|
||||||
id: batIcon
|
id: batIcon
|
||||||
|
anchors.verticalCenter: batRow.verticalCenter
|
||||||
source: Quickshell.iconPath(UPower.displayDevice.iconName)
|
source: Quickshell.iconPath(UPower.displayDevice.iconName)
|
||||||
implicitSize: 14
|
implicitSize: 14
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,6 @@ Item {
|
|||||||
id: text
|
id: text
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
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
|
id: root
|
||||||
implicitWidth: workspaceRow.implicitWidth
|
implicitWidth: workspaceRow.implicitWidth
|
||||||
height: 30
|
height: 30
|
||||||
required property var screen
|
|
||||||
Row {
|
Row {
|
||||||
id: workspaceRow
|
id: workspaceRow
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
@ -22,7 +21,18 @@ Item {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: workspaceNumber
|
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
|
required property var modelData
|
||||||
width: isOnMon ? Settings.config.barHeight + 10 : 0
|
width: isOnMon ? Settings.config.barHeight + 10 : 0
|
||||||
height: isOnMon ? Settings.config.barHeight : 0
|
height: isOnMon ? Settings.config.barHeight : 0
|
||||||
|
|||||||
@ -7,8 +7,10 @@ Variants {
|
|||||||
id: root
|
id: root
|
||||||
model: Quickshell.screens
|
model: Quickshell.screens
|
||||||
delegate: WlrLayershell {
|
delegate: WlrLayershell {
|
||||||
required property var modelData
|
|
||||||
id: wpShell
|
id: wpShell
|
||||||
|
|
||||||
|
required property var modelData
|
||||||
|
screen: modelData
|
||||||
anchors {
|
anchors {
|
||||||
left: true
|
left: true
|
||||||
top: true
|
top: true
|
||||||
@ -19,8 +21,8 @@ Variants {
|
|||||||
Image {
|
Image {
|
||||||
fillMode: Image.Stretch
|
fillMode: Image.Stretch
|
||||||
source: Settings.config.currentWall
|
source: Settings.config.currentWall
|
||||||
width: modelData.width
|
width: wpShell.modelData.width
|
||||||
height: modelData.height
|
height: wpShell.modelData.height
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user