From 06e34cc5a120bde93e2e53f30bf8b90ce6e1310a Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 29 Jul 2021 09:33:32 -0400 Subject: [PATCH] feat(StatusListItem): add enabled prop to StatusLIneItem (#302) --- ui/StatusQ/src/StatusQ/Components/StatusListItem.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/StatusQ/src/StatusQ/Components/StatusListItem.qml b/ui/StatusQ/src/StatusQ/Components/StatusListItem.qml index 6bb743e911..881faebc4a 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusListItem.qml +++ b/ui/StatusQ/src/StatusQ/Components/StatusListItem.qml @@ -37,6 +37,7 @@ Rectangle { property string tertiaryTitle: "" property real leftPadding: 16 property real rightPadding: 16 + property bool enabled: true property StatusIconSettings icon: StatusIconSettings { height: 20 width: 20 @@ -88,6 +89,7 @@ Rectangle { MouseArea { id: sensor + enabled: statusListItem.enabled anchors.fill: parent cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor acceptedButtons: Qt.LeftButton | Qt.RightButton @@ -167,6 +169,9 @@ Rectangle { font.pixelSize: 15 wrapMode: Text.WrapAtWordBoundaryOrAnywhere color: { + if (!statusListItem.enabled) { + return Theme.palette.baseColor1 + } switch (statusListItem.type) { case StatusListItem.Type.Primary: return Theme.palette.directColor1 @@ -184,7 +189,7 @@ Rectangle { width: parent.width text: statusListItem.subTitle font.pixelSize: 15 - color: !statusListItem.tertiaryTitle ? Theme.palette.baseColor1 : Theme.palette.directColor1 + color: !statusListItem.enabled || !statusListItem.tertiaryTitle ? Theme.palette.baseColor1 : Theme.palette.directColor1 visible: !!statusListItem.subTitle wrapMode: Text.WrapAtWordBoundaryOrAnywhere }