ActionsHandler poperties

Make sure that all low level components get ActionsHandler through actual properties rather than magically
This commit is contained in:
James Graham
2023-10-22 13:39:34 +00:00
parent c2d82750b1
commit ef1d62d45c
6 changed files with 47 additions and 7 deletions

View File

@@ -60,6 +60,13 @@ Kirigami.Page {
*/
property MediaMessageFilterModel mediaMessageFilterModel: RoomManager.mediaMessageFilterModel
/**
* @brief The ActionsHandler object to use.
*/
property ActionsHandler actionsHandler: ActionsHandler {
room: root.currentRoom
}
property bool loading: !root.currentRoom || (root.currentRoom.timelineSize === 0 && !root.currentRoom.allHistoryLoaded)
/// Disable cancel shortcut. Used by the separate window since it provides its own cancel implementation.
@@ -114,6 +121,7 @@ Kirigami.Page {
currentRoom: root.currentRoom
messageEventModel: root.messageEventModel
messageFilterModel: root.messageFilterModel
actionsHandler: root.actionsHandler
onFocusChatBox: {
if (chatBoxLoader.item) {
chatBoxLoader.item.forceActiveFocus()
@@ -155,6 +163,7 @@ Kirigami.Page {
width: parent.width
currentRoom: root.currentRoom
connection: root.connection
actionsHandler: root.actionsHandler
onMessageSent: {
if (!timelineViewLoader.item.atYEnd) {
timelineViewLoader.item.goToLastMessage();
@@ -180,11 +189,6 @@ Kirigami.Page {
}
}
ActionsHandler {
id: actionsHandler
room: root.currentRoom
}
Shortcut {
sequence: StandardKey.Cancel
onActivated: {