HPasswordPopup: enable OK if password not empty

This commit is contained in:
miruka 2019-09-09 07:49:07 -04:00
parent e5893c5569
commit 7f995c749f
2 changed files with 5 additions and 1 deletions

View File

@ -14,11 +14,14 @@ HPopup {
property alias details: details
property bool okClicked: false
property string okText: qsTr("OK")
property bool okEnabled: true
box.focusButton: "ok"
box.clickButtonOnEnter: "ok"
box.buttonModel: [
{ name: "ok", text: qsTr("OK"), iconName: "ok" },
{ name: "ok", text: okText, iconName: "ok" , enabled: okEnabled},
{ name: "cancel", text: qsTr("Cancel"), iconName: "cancel" },
]
box.buttonCallbacks: ({

View File

@ -5,6 +5,7 @@ import "../SidePane"
HBoxPopup {
id: popup
okEnabled: Boolean(passwordField.text)
onAboutToShow: {
okClicked = false