Fix System Health ledger rendering
This commit is contained in:
@@ -8,11 +8,22 @@ Item {
|
||||
required property var check
|
||||
property bool issue: false
|
||||
property bool divider: true
|
||||
property int actionActivationCount: 0
|
||||
signal actionRequested(var check)
|
||||
|
||||
objectName: `health-check-row:${root.check.id}:${root.issue ? "issue" : "ledger"}`
|
||||
objectName: `health-check-row:${root.issue ? "issue" : "quiet"}:${root.check.id}`
|
||||
implicitHeight: 62
|
||||
|
||||
// The isolated contract uses the same signal path as a pointer or keyboard
|
||||
// activation instead of calling HealthPage's action handler directly.
|
||||
function activateAction(): bool {
|
||||
if (!actionButton.visible || !actionButton.enabled)
|
||||
return false;
|
||||
root.actionActivationCount += 1;
|
||||
actionButton.clicked();
|
||||
return true;
|
||||
}
|
||||
|
||||
function statusLabel(status: string): string {
|
||||
if (status === "ok") return "Healthy";
|
||||
if (status === "warning") return "Needs attention";
|
||||
@@ -78,7 +89,7 @@ Item {
|
||||
spacing: 12
|
||||
|
||||
Text {
|
||||
objectName: `health-status-text:${root.check.id}:${root.issue ? "issue" : "ledger"}`
|
||||
objectName: `health-status-text:${root.issue ? "issue" : "quiet"}:${root.check.id}`
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: root.statusLabel(root.check.status)
|
||||
color: root.statusColor(root.check.status)
|
||||
@@ -89,7 +100,7 @@ Item {
|
||||
SettingsButton {
|
||||
id: actionButton
|
||||
|
||||
objectName: `health-row-action:${root.check.id}:${root.issue ? "issue" : "ledger"}`
|
||||
objectName: `health-row-action:${root.issue ? "issue" : "quiet"}:${root.check.id}`
|
||||
visible: root.check.action !== undefined
|
||||
text: Health.repairingId === root.check.id ? "Working…" : (root.check.action?.label ?? "")
|
||||
enabled: visible && Health.repairingId !== root.check.id && !Health.busy
|
||||
|
||||
Reference in New Issue
Block a user