Always parent popups to window
This commit is contained in:
parent
74784803f5
commit
980e258df8
|
@ -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: ({})
|
||||
}
|
||||
|
|
|
@ -149,7 +149,6 @@ HTile {
|
|||
|
||||
utils.makePopup(
|
||||
"Popups/KeyVerificationPopup.qml",
|
||||
view,
|
||||
{
|
||||
focusOnClosed: nameField,
|
||||
userId: deviceTile.userId,
|
||||
|
|
|
@ -60,7 +60,6 @@ HColumnPage {
|
|||
|
||||
utils.makePopup(
|
||||
"Popups/AuthentificationPopup.qml",
|
||||
page,
|
||||
{
|
||||
userId: page.userId,
|
||||
deviceIds,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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},
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -83,7 +83,6 @@ HColumnLayout {
|
|||
|
||||
onClicked: utils.makePopup(
|
||||
"Popups/InviteToRoomPopup.qml",
|
||||
chat,
|
||||
{
|
||||
userId: chat.userId,
|
||||
roomId: chat.roomId,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 },
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user