fixes to workspace without apps

This commit is contained in:
Hannes
2026-06-09 00:32:40 +02:00
parent 4f169c660e
commit edba9cc928
3 changed files with 14 additions and 7 deletions
+1 -1
View File
@@ -111,7 +111,7 @@ MouseArea {
BatteryState.start() BatteryState.start()
} }
console.log("battery available:", hasBattery) // console.log("battery available:", hasBattery)
} }
} }
} }
+11 -4
View File
@@ -32,7 +32,7 @@ Row { // Workspace Row
active: modelData.monitor === thisMonitor active: modelData.monitor === thisMonitor
sourceComponent: Rectangle { //workspace sourceComponent: Rectangle { //workspace
// visible: modelData.monitor === thisMonitor // visible: modelData.monitor === thisMonitor
width: Math.max(workspaceNum.width + workspaceText.width+Config.spacing*2, bar.height) width: workspaceText.text.length === 0 ? Math.max(workspaceNum.width + Config.spacing*2, workspaceNum.height + Config.spacing) : Math.max(workspaceNum.width + workspaceText.width + Config.spacing*2, bar.height)
height: workspaceNum.height + Config.spacing height: workspaceNum.height + Config.spacing
radius: Config.small_radius radius: Config.small_radius
color: ( color: (
@@ -52,13 +52,16 @@ Row { // Workspace Row
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
anchors.fill: parent anchors.fill: parent
onClicked: Hyprland.dispatch("workspace " + modelData.id) onClicked: {
Hyprland.dispatch("workspace " + modelData.id)
// console.log("workspaceText: " + workspaceText.text.length)
}
Row { Row {
id: workspaceRow id: workspaceRow
anchors.centerIn: parent anchors.centerIn: parent
spacing: Math.floor(bar.height/8) spacing: Math.floor(bar.height/8)
leftPadding: Math.floor(bar.height/4) leftPadding: workspaceText.text.length === 0 ? 0 : Math.floor(bar.height / 4)
Text { Text {
id: workspaceNum id: workspaceNum
@@ -95,8 +98,12 @@ Row { // Workspace Row
stdout: StdioCollector { stdout: StdioCollector {
onStreamFinished: { onStreamFinished: {
if (this.text.length > 1) {
workspaceText.text = this.text workspaceText.text = this.text
// console.log("workspaceScript output:", this.text) } else {
workspaceText.text = ""
}
// console.log("workspaceScript output:", workspaceText.text, workspaceText.text.length)
} }
} }
} }
+1 -1
View File
@@ -3,7 +3,7 @@ import Quickshell
import Quickshell.Hyprland import Quickshell.Hyprland
import Quickshell.Io import Quickshell.Io
import "../../states/wallpaper" as Global import "../../states/wallpaperdir" as Global
Item { // container, invisible Item { // container, invisible