mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Don't destroy components in use
Add a delay to all destructions and move the call dialog stuff up a level, so that we don't destroy the component when destroying the parent dialog. fixes #984
This commit is contained in:
parent
a3dce85132
commit
bf7b58c959
4 changed files with 16 additions and 18 deletions
|
@ -29,6 +29,14 @@ Rectangle {
|
|||
|
||||
}
|
||||
|
||||
Component {
|
||||
id: screenShareDialog
|
||||
|
||||
ScreenShare {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: row
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue