From 407396e01e66bf39a82131ac5602abc2b1080565 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 13 Dec 2019 09:52:04 -0400 Subject: [PATCH] Put RoomPane inside a loader --- src/qml/Chat/Chat.qml | 17 +++++++++++------ src/qml/Chat/RoomPane/MemberView.qml | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/qml/Chat/Chat.qml b/src/qml/Chat/Chat.qml index e886ac5c..02ff8803 100644 --- a/src/qml/Chat/Chat.qml +++ b/src/qml/Chat/Chat.qml @@ -23,14 +23,15 @@ Item { ) || "waiting" readonly property alias loader: loader - readonly property alias roomPane: roomPane + readonly property alias roomPane: roomPaneLoader.item HLoader { id: loader - anchors.rightMargin: roomPane.visibleSize + anchors.rightMargin: ready ? roomPane.visibleSize : 0 anchors.fill: parent - visible: ! roomPane.hidden || anchors.rightMargin < width + visible: + ready ? ! roomPane.hidden || anchors.rightMargin < width : true onLoaded: if (chat.focus) item.composer.takeFocus() source: ready ? "ChatPage.qml" : "" @@ -47,8 +48,12 @@ Item { } } - RoomPane { - id: roomPane - referenceSizeParent: chat + HLoader { + id: roomPaneLoader + active: ready + sourceComponent: RoomPane { + id: roomPane + referenceSizeParent: chat + } } } diff --git a/src/qml/Chat/RoomPane/MemberView.qml b/src/qml/Chat/RoomPane/MemberView.qml index 3e70aa73..f5c8c147 100644 --- a/src/qml/Chat/RoomPane/MemberView.qml +++ b/src/qml/Chat/RoomPane/MemberView.qml @@ -67,7 +67,7 @@ HColumnLayout { id: inviteButton icon.name: "room-send-invite" backgroundColor: theme.chat.roomPane.inviteButton.background - enabled: chat.ready ? chat.roomInfo.can_invite : false + enabled: chat.roomInfo.can_invite toolTip.text: enabled ?