From de15f55f8aeb717d5b4e9e35295000f26a987a1a Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 29 May 2020 14:12:57 -0400 Subject: [PATCH] feat: add disabled state to button and enable changing color --- ui/shared/StyledButton.qml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ui/shared/StyledButton.qml b/ui/shared/StyledButton.qml index 357861f1b3..81c31beb69 100644 --- a/ui/shared/StyledButton.qml +++ b/ui/shared/StyledButton.qml @@ -7,24 +7,28 @@ import "../imports" Button { property string label: "My button" + property color btnColor: Theme.lightBlue + property color textColor: Theme.blue + property bool disabled: false id: btnStyled width: txtBtnLabel.width + 2 * Theme.padding height: 44 + enabled: !disabled background: Rectangle { - color: "#ECEFFC" - radius: 8 + color: disabled ? Theme.grey : btnColor + radius: Theme.radius anchors.fill: parent } Text { id: txtBtnLabel - color: Theme.blue - font.pointSize: 15 + color: btnStyled.disabled ? Theme.darkGrey : btnStyled.textColor + font.pixelSize: 15 anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - text: label + text: btnStyled.label font.weight: Font.Medium } }