From 9f8ac6ca9f962873ba736381badadbc9ea859417 Mon Sep 17 00:00:00 2001 From: miruka Date: Mon, 9 Sep 2019 08:15:28 -0400 Subject: [PATCH] Auto-focus OK only for ClearMessagesPopup --- src/qml/Base/HBox.qml | 4 ++-- src/qml/Base/HBoxPopup.qml | 1 - src/qml/Chat/ClearMessagesPopup.qml | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qml/Base/HBox.qml b/src/qml/Base/HBox.qml index 390d0463..b56269ff 100644 --- a/src/qml/Base/HBox.qml +++ b/src/qml/Base/HBox.qml @@ -95,7 +95,7 @@ Rectangle { true : modelData.enabled) && ! button.loading - onClicked: buttonCallbacks[modelData.name](button) + onClicked: buttonCallbacks[name](button) Keys.onLeftPressed: previous.forceActiveFocus() Keys.onUpPressed: previous.forceActiveFocus() @@ -105,7 +105,7 @@ Rectangle { Keys.onEnterPressed: Keys.onReturnPressed(event) Component.onCompleted: - if (modelData.name == focusButton) forceActiveFocus() + if (name == focusButton) forceActiveFocus() Layout.fillWidth: true Layout.preferredHeight: theme.baseElementsHeight diff --git a/src/qml/Base/HBoxPopup.qml b/src/qml/Base/HBoxPopup.qml index 746f995c..a3ede936 100644 --- a/src/qml/Base/HBoxPopup.qml +++ b/src/qml/Base/HBoxPopup.qml @@ -18,7 +18,6 @@ HPopup { property bool okEnabled: true - box.focusButton: "ok" box.clickButtonOnEnter: "ok" box.buttonModel: [ { name: "ok", text: okText, iconName: "ok" , enabled: okEnabled}, diff --git a/src/qml/Chat/ClearMessagesPopup.qml b/src/qml/Chat/ClearMessagesPopup.qml index 2095ab82..02f12e0e 100644 --- a/src/qml/Chat/ClearMessagesPopup.qml +++ b/src/qml/Chat/ClearMessagesPopup.qml @@ -7,6 +7,7 @@ HBoxPopup { "The messages will only be removed on your side. " + "They will be available again after you restart the application." ) + box.focusButton: "ok" onOk: py.callClientCoro(userId, "clear_events", [roomId])