Enable charger control buttons according to current status

This commit is contained in:
Matti Viljanen 2020-03-21 01:18:07 +02:00
parent 85d42458ca
commit b994721229
No known key found for this signature in database
GPG key ID: CF32A1495158F888

View file

@ -149,23 +149,26 @@ Page {
left: parent.left left: parent.left
right: parent.right right: parent.right
} }
height: button.height height: resumeButton.height
Column { Column {
width: parent.width / 2 width: parent.width / 2
Button { Button {
id: button id: resumeButton
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Enable") text: qsTr("Resume")
onClicked: chargingEnabled = true onClicked: battery.chargingEnabled = true
enabled: !battery.chargingEnabled
} }
} }
Column { Column {
width: parent.width / 2 width: parent.width / 2
Button { Button {
id: pauseButton
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Disable") text: qsTr("Pause")
onClicked: chargingEnabled = false onClicked: battery.chargingEnabled = false
enabled: battery.chargingEnabled
} }
} }
} }
@ -188,7 +191,7 @@ Page {
left: parent.left left: parent.left
right: parent.right right: parent.right
} }
height: button.height height: resumeButton.height
Column { Column {
width: parent.width / 2 width: parent.width / 2