Box/popups: ignore enter press on disabled buttons

This commit is contained in:
miruka 2020-08-21 05:08:12 -04:00
parent 8fbe59f6eb
commit 2ccb28fa49
8 changed files with 10 additions and 8 deletions

View File

@ -4,7 +4,6 @@
- server list sorting method / explain what the % number is (stability)
- spam alt+shift+a/going to room when starting app on server browser → segfault
- login with account already added → infinite spinner in room list
- verify onKeyboardAccept/Cancel things respect button enabled state
- global presence control

View File

@ -85,8 +85,8 @@ HFlickableColumnPage {
}
}
onKeyboardAccept: if (saveButton.enabled) saveButton.clicked()
onKeyboardCancel: cancel()
onKeyboardAccept: applyChanges()
HUserAvatar {
id: avatar

View File

@ -168,7 +168,9 @@ HBox {
}
}
onKeyboardAccept: if (serverField.item.apply.enabled) box.connect()
onKeyboardAccept:
if (serverField.item.apply.enabled) serverField.item.apply.clicked()
onAccepted: window.saveState(this)
Timer {

View File

@ -64,7 +64,7 @@ HFlickableColumnPage {
}
}
onKeyboardAccept: create()
onKeyboardAccept: if (applyButton.enabled) applyButton.clicked()
onKeyboardCancel: cancel()
HRoomAvatar {

View File

@ -81,7 +81,7 @@ HFlickableColumnPage {
}
}
onKeyboardAccept: startChat()
onKeyboardAccept: if (applyButton.enabled) applyButton.clicked()
onKeyboardCancel: cancel()
CurrentUserAvatar {

View File

@ -70,7 +70,7 @@ HFlickableColumnPage {
}
}
onKeyboardAccept: join()
onKeyboardAccept: if (joinButton.enabled) joinButton.clicked()
onKeyboardCancel: cancel()
CurrentUserAvatar {

View File

@ -63,6 +63,7 @@ HFlickableColumnPage {
footer: AutoDirectionLayout {
ApplyButton {
id: applyButton
enabled: anyChange
loading: saveFuture !== null
disableWhileLoading: false
@ -76,7 +77,7 @@ HFlickableColumnPage {
}
}
onKeyboardAccept: save()
onKeyboardAccept: if (applyButton.enabled) applyButton.clicked()
onKeyboardCancel: cancel()
HRoomAvatar {

View File

@ -73,7 +73,7 @@ HFlickableColumnPopup {
}
onOpened: passwordField.forceActiveFocus()
onKeyboardAccept: popup.validate()
onKeyboardAccept: if (validateButton.enabled) validateButton.clicked()
SummaryLabel { id: summary }