diff --git a/resources/qml/MessageInput.qml b/resources/qml/MessageInput.qml index 68948452..f8ab494b 100644 --- a/resources/qml/MessageInput.qml +++ b/resources/qml/MessageInput.qml @@ -29,6 +29,14 @@ Rectangle { } + Component { + id: screenShareDialog + + ScreenShare { + } + + } + RowLayout { id: row diff --git a/resources/qml/Root.qml b/resources/qml/Root.qml index c8c05a3e..98212c83 100644 --- a/resources/qml/Root.qml +++ b/resources/qml/Root.qml @@ -222,12 +222,12 @@ Pane { } function destroyOnClose(obj) { - if (obj.closing != undefined) obj.closing.connect(() => obj.destroy()); - else if (obj.closed != undefined) obj.closed.connect(() => obj.destroy()); + if (obj.closing != undefined) obj.closing.connect(() => obj.destroy(1000)); + else if (obj.aboutToHide != undefined) obj.aboutToHide.connect(() => obj.destroy(1000)); } function destroyOnClosed(obj) { - obj.closed.connect(() => obj.destroy()); + obj.aboutToHide.connect(() => obj.destroy(1000)); } Connections { diff --git a/resources/qml/voip/PlaceCall.qml b/resources/qml/voip/PlaceCall.qml index 2639f5bb..79fd2fc9 100644 --- a/resources/qml/voip/PlaceCall.qml +++ b/resources/qml/voip/PlaceCall.qml @@ -28,14 +28,6 @@ Popup { } - Component { - id: screenShareDialog - - ScreenShare { - } - - } - ColumnLayout { id: columnLayout @@ -81,7 +73,7 @@ Popup { height: Nheko.avatarSize url: room.roomAvatarUrl.replace("mxc://", "image://MxcImage/") displayName: room.roomName - roomid: room.roomid + roomid: room.roomId onClicked: TimelineManager.openImageOverlay(room, room.avatarUrl(userid), room.data.eventId) } @@ -118,8 +110,8 @@ Popup { onClicked: { var dialog = screenShareDialog.createObject(timelineRoot); dialog.open(); - close(); timelineRoot.destroyOnClose(dialog); + close(); } } diff --git a/resources/qml/voip/ScreenShare.qml b/resources/qml/voip/ScreenShare.qml index 0b439a48..cf58f3fa 100644 --- a/resources/qml/voip/ScreenShare.qml +++ b/resources/qml/voip/ScreenShare.qml @@ -11,12 +11,10 @@ import im.nheko 1.0 Popup { modal: true - // only set the anchors on Qt 5.12 or higher - // see https://doc.qt.io/qt-5/qml-qtquick-controls2-popup.html#anchors.centerIn-prop - Component.onCompleted: { - if (anchors) - anchors.centerIn = parent; + anchors.centerIn: parent; + + Component.onCompleted: { frameRateCombo.currentIndex = frameRateCombo.find(Settings.screenShareFrameRate); } palette: Nheko.colors