Don't focus chatbar on mobile

This popup the virtual keyboard and is quite distrubing on mobile.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
Carl Schwan
2023-03-14 13:05:52 +01:00
parent afe8a2a5e4
commit bc84ad8d56

View File

@@ -48,8 +48,10 @@ Kirigami.ScrollablePage {
applicationWindow().hoverLinkIndicator.text = ""; applicationWindow().hoverLinkIndicator.text = "";
messageListView.positionViewAtBeginning(); messageListView.positionViewAtBeginning();
hasScrolledUpBefore = false; hasScrolledUpBefore = false;
if (!Kirigami.Settings.isMobile) {
chatBox.chatBar.forceActiveFocus(); chatBox.chatBar.forceActiveFocus();
} }
}
Connections { Connections {
target: messageEventModel target: messageEventModel
@@ -353,7 +355,9 @@ Kirigami.ScrollablePage {
visible: currentRoom && currentRoom.hasUnreadMessages && currentRoom.readMarkerLoaded visible: currentRoom && currentRoom.hasUnreadMessages && currentRoom.readMarkerLoaded
action: Kirigami.Action { action: Kirigami.Action {
onTriggered: { onTriggered: {
if (!Kirigami.Settings.isMobile) {
chatBox.chatBar.forceActiveFocus(); chatBox.chatBar.forceActiveFocus();
}
messageListView.goToEvent(currentRoom.readMarkerEventId) messageListView.goToEvent(currentRoom.readMarkerEventId)
} }
icon.name: "go-up" icon.name: "go-up"
@@ -378,7 +382,9 @@ Kirigami.ScrollablePage {
visible: !messageListView.atYEnd visible: !messageListView.atYEnd
action: Kirigami.Action { action: Kirigami.Action {
onTriggered: { onTriggered: {
if (!Kirigami.Settings.isMobile) {
chatBox.chatBar.forceActiveFocus(); chatBox.chatBar.forceActiveFocus();
}
goToLastMessage(); goToLastMessage();
currentRoom.markAllMessagesAsRead(); currentRoom.markAllMessagesAsRead();
} }
@@ -531,10 +537,12 @@ Kirigami.ScrollablePage {
showQuickReaction: true showQuickReaction: true
onChosen: { onChosen: {
page.currentRoom.toggleReaction(hoverActions.event.eventId, emoji); page.currentRoom.toggleReaction(hoverActions.event.eventId, emoji);
if (!Kirigami.Settings.isMobile) {
chatBox.chatBar.forceActiveFocus(); chatBox.chatBar.forceActiveFocus();
} }
} }
} }
}
QQC2.Button { QQC2.Button {
QQC2.ToolTip.text: i18n("Edit") QQC2.ToolTip.text: i18n("Edit")
QQC2.ToolTip.visible: hovered QQC2.ToolTip.visible: hovered