Always parent popups to window

This commit is contained in:
miruka 2020-06-26 06:34:06 -04:00
parent 74784803f5
commit 980e258df8
10 changed files with 2 additions and 17 deletions

View File

@ -9,7 +9,6 @@ HMenuItem {
utils.makePopup(
popup,
popupParent,
utils.objectUpdate(
{ focusOnClosed: menu.previouslyFocused }, properties,
),
@ -20,7 +19,6 @@ HMenuItem {
property var popup // url or HPopup Component
property QtObject popupParent: window
property bool autoDestruct: true
property var properties: ({})
}

View File

@ -149,7 +149,6 @@ HTile {
utils.makePopup(
"Popups/KeyVerificationPopup.qml",
view,
{
focusOnClosed: nameField,
userId: deviceTile.userId,

View File

@ -60,7 +60,6 @@ HColumnPage {
utils.makePopup(
"Popups/AuthentificationPopup.qml",
page,
{
userId: page.userId,
deviceIds,

View File

@ -25,7 +25,6 @@ Banner {
forget: button => {
utils.makePopup(
"Popups/ForgetRoomPopup.qml",
mainUI, // Must not be destroyed with chat
{
userId: chat.userId,
roomId: chat.roomId,

View File

@ -37,7 +37,6 @@ Item {
sequences: window.settings.keys.leaveRoom
onActivated: utils.makePopup(
"Popups/LeaveRoomPopup.qml",
chat,
{userId, roomId, roomName: roomInfo.display_name},
)
}
@ -46,7 +45,6 @@ Item {
sequences: window.settings.keys.forgetRoom
onActivated: utils.makePopup(
"Popups/ForgetRoomPopup.qml",
chat,
{userId, roomId, roomName: roomInfo.display_name},
)
}

View File

@ -61,7 +61,6 @@ HTile {
enabled: false
popup: "Popups/RemoveMemberPopup.qml"
popupParent: chat
properties: ({
userId: chat.userId,
roomId: chat.roomId,
@ -85,7 +84,6 @@ HTile {
enabled: false
popup: "Popups/RemoveMemberPopup.qml"
popupParent: chat
properties: ({
userId: chat.userId,
roomId: chat.roomId,

View File

@ -83,7 +83,6 @@ HColumnLayout {
onClicked: utils.makePopup(
"Popups/InviteToRoomPopup.qml",
chat,
{
userId: chat.userId,
roomId: chat.roomId,

View File

@ -245,7 +245,6 @@ HColumnLayout {
enabled: properties.eventSenderAndIds.length
popup: "Popups/RedactPopup.qml"
popupParent: chat
properties: ({
preferUserId: chat.userId,
roomId: chat.roomId,
@ -279,7 +278,6 @@ HColumnLayout {
text: qsTr("Clear messages")
popup: "Popups/ClearMessagesPopup.qml"
popupParent: chat
properties: ({
userId: chat.userId,
roomId: chat.roomId,

View File

@ -56,7 +56,6 @@ Rectangle {
sequences: window.settings.keys.removeFocusedOrSelectedMessages
onActivated: utils.makePopup(
"Popups/RedactPopup.qml",
chat,
{
preferUserId: chat.userId,
roomId: chat.roomId,
@ -166,7 +165,6 @@ Rectangle {
sequences: window.settings.keys.clearRoomMessages
onActivated: utils.makePopup(
"Popups/ClearMessagesPopup.qml",
mainUI,
{
userId: window.uiState.pageProperties.userId,
roomId: window.uiState.pageProperties.roomId,

View File

@ -48,9 +48,9 @@ QtObject {
}
function makePopup(urlComponent, parent=null, properties={}, callback=null,
function makePopup(urlComponent, properties={}, callback=null,
autoDestruct=true) {
makeObject(urlComponent, parent, properties, (popup) => {
makeObject(urlComponent, window, properties, (popup) => {
popup.open()
if (autoDestruct) popup.closed.connect(() => { popup.destroy() })
if (callback) callback(popup)
@ -68,7 +68,6 @@ QtObject {
utils.makePopup(
"Popups/UnexpectedErrorPopup.qml",
window,
{ errorType: type, message, traceback },
)
}