Enable charger control buttons according to current status
This commit is contained in:
parent
85d42458ca
commit
b994721229
1 changed files with 10 additions and 7 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue