Auto-focus OK only for ClearMessagesPopup

This commit is contained in:
miruka 2019-09-09 08:15:28 -04:00
parent 7f995c749f
commit 9f8ac6ca9f
3 changed files with 3 additions and 3 deletions

View File

@ -95,7 +95,7 @@ Rectangle {
true : modelData.enabled) && true : modelData.enabled) &&
! button.loading ! button.loading
onClicked: buttonCallbacks[modelData.name](button) onClicked: buttonCallbacks[name](button)
Keys.onLeftPressed: previous.forceActiveFocus() Keys.onLeftPressed: previous.forceActiveFocus()
Keys.onUpPressed: previous.forceActiveFocus() Keys.onUpPressed: previous.forceActiveFocus()
@ -105,7 +105,7 @@ Rectangle {
Keys.onEnterPressed: Keys.onReturnPressed(event) Keys.onEnterPressed: Keys.onReturnPressed(event)
Component.onCompleted: Component.onCompleted:
if (modelData.name == focusButton) forceActiveFocus() if (name == focusButton) forceActiveFocus()
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: theme.baseElementsHeight Layout.preferredHeight: theme.baseElementsHeight

View File

@ -18,7 +18,6 @@ HPopup {
property bool okEnabled: true property bool okEnabled: true
box.focusButton: "ok"
box.clickButtonOnEnter: "ok" box.clickButtonOnEnter: "ok"
box.buttonModel: [ box.buttonModel: [
{ name: "ok", text: okText, iconName: "ok" , enabled: okEnabled}, { name: "ok", text: okText, iconName: "ok" , enabled: okEnabled},

View File

@ -7,6 +7,7 @@ HBoxPopup {
"The messages will only be removed on your side. " + "The messages will only be removed on your side. " +
"They will be available again after you restart the application." "They will be available again after you restart the application."
) )
box.focusButton: "ok"
onOk: py.callClientCoro(userId, "clear_events", [roomId]) onOk: py.callClientCoro(userId, "clear_events", [roomId])