From 7261824837bbcdc689bba25400cfadc905bc9e3f Mon Sep 17 00:00:00 2001 From: "s0wlz (Matthias Puchstein)" Date: Wed, 22 Apr 2026 01:45:02 +0200 Subject: [PATCH] fix: deduplicate status color and guard stale 0/0 in KubernetesPill --- dot_config/quickshell/bar/KubernetesPill.qml | 24 +++++--------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/dot_config/quickshell/bar/KubernetesPill.qml b/dot_config/quickshell/bar/KubernetesPill.qml index 78833be..4263cc5 100644 --- a/dot_config/quickshell/bar/KubernetesPill.qml +++ b/dot_config/quickshell/bar/KubernetesPill.qml @@ -14,34 +14,22 @@ BarPill { return Shared.Theme.blue; } + readonly property color statusColor: accentColor + content: [ Text { Layout.alignment: Qt.AlignHCenter - text: "\u{f03be}" - color: { - let s = Shared.Kubernetes.status; - if (s === "ok") return Shared.Theme.green; - if (s === "degraded") return Shared.Theme.yellow; - if (s === "error") return Shared.Theme.red; - if (s === "stale") return Shared.Theme.overlay0; - return Shared.Theme.blue; - } + text: "\u{f03be}" // nf-md-kubernetes + color: statusColor font.pixelSize: Shared.Theme.fontLarge font.family: Shared.Theme.iconFont }, Text { Layout.alignment: Qt.AlignHCenter - text: Shared.Kubernetes.status === "loading" + text: (Shared.Kubernetes.status === "loading" || Shared.Kubernetes.totalCount === 0) ? "…" : Shared.Kubernetes.readyCount + "/" + Shared.Kubernetes.totalCount - color: { - let s = Shared.Kubernetes.status; - if (s === "ok") return Shared.Theme.green; - if (s === "degraded") return Shared.Theme.yellow; - if (s === "error") return Shared.Theme.red; - if (s === "stale") return Shared.Theme.overlay0; - return Shared.Theme.blue; - } + color: statusColor font.pixelSize: Shared.Theme.fontSmall font.family: Shared.Theme.fontFamily font.bold: true