mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-18 01:27:25 +00:00
feat: add disabled state to button and enable changing color
This commit is contained in:
parent
b6cf47f467
commit
de15f55f8a
@ -7,24 +7,28 @@ import "../imports"
|
|||||||
|
|
||||||
Button {
|
Button {
|
||||||
property string label: "My button"
|
property string label: "My button"
|
||||||
|
property color btnColor: Theme.lightBlue
|
||||||
|
property color textColor: Theme.blue
|
||||||
|
property bool disabled: false
|
||||||
|
|
||||||
id: btnStyled
|
id: btnStyled
|
||||||
width: txtBtnLabel.width + 2 * Theme.padding
|
width: txtBtnLabel.width + 2 * Theme.padding
|
||||||
height: 44
|
height: 44
|
||||||
|
enabled: !disabled
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: "#ECEFFC"
|
color: disabled ? Theme.grey : btnColor
|
||||||
radius: 8
|
radius: Theme.radius
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: txtBtnLabel
|
id: txtBtnLabel
|
||||||
color: Theme.blue
|
color: btnStyled.disabled ? Theme.darkGrey : btnStyled.textColor
|
||||||
font.pointSize: 15
|
font.pixelSize: 15
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
text: label
|
text: btnStyled.label
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user