Further improvements to the ChatBox API

Further improvements to the ChatBox API so that outside components no longer access the ChatBar item directly.
This commit is contained in:
James Graham
2023-06-09 15:02:42 +00:00
parent 9425f24315
commit 105be518c7
3 changed files with 19 additions and 13 deletions

View File

@@ -38,7 +38,7 @@ Kirigami.Page {
timelineViewLoader.item.positionViewAtBeginning();
hasScrolledUpBefore = false;
if (!Kirigami.Settings.isMobile && chatBoxLoader.item) {
chatBoxLoader.item.chatBar.forceActiveFocus();
chatBoxLoader.item.forceActiveFocus();
}
}
@@ -61,7 +61,7 @@ Kirigami.Page {
currentRoom: root.currentRoom
onFocusChatBox: {
if (chatBoxLoader.item) {
chatBoxLoader.item.chatBar.forceActiveFocus()
chatBoxLoader.item.forceActiveFocus()
}
}
}
@@ -151,8 +151,8 @@ Kirigami.Page {
Keys.onPressed: {
if (!(event.modifiers & Qt.ControlModifier) && event.key < Qt.Key_Escape) {
event.accepted = true;
chatBoxLoader.item.chatBar.insertText(event.text);
chatBoxLoader.item.chatBar.forceActiveFocus();
chatBoxLoader.item.insertText(event.text);
chatBoxLoader.item.forceActiveFocus();
return;
} else if (event.key === Qt.Key_PageUp) {
event.accepted = true;