Always parent popups to window
This commit is contained in:
parent
74784803f5
commit
980e258df8
|
@ -9,7 +9,6 @@ HMenuItem {
|
||||||
|
|
||||||
utils.makePopup(
|
utils.makePopup(
|
||||||
popup,
|
popup,
|
||||||
popupParent,
|
|
||||||
utils.objectUpdate(
|
utils.objectUpdate(
|
||||||
{ focusOnClosed: menu.previouslyFocused }, properties,
|
{ focusOnClosed: menu.previouslyFocused }, properties,
|
||||||
),
|
),
|
||||||
|
@ -20,7 +19,6 @@ HMenuItem {
|
||||||
|
|
||||||
|
|
||||||
property var popup // url or HPopup Component
|
property var popup // url or HPopup Component
|
||||||
property QtObject popupParent: window
|
|
||||||
property bool autoDestruct: true
|
property bool autoDestruct: true
|
||||||
property var properties: ({})
|
property var properties: ({})
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,6 @@ HTile {
|
||||||
|
|
||||||
utils.makePopup(
|
utils.makePopup(
|
||||||
"Popups/KeyVerificationPopup.qml",
|
"Popups/KeyVerificationPopup.qml",
|
||||||
view,
|
|
||||||
{
|
{
|
||||||
focusOnClosed: nameField,
|
focusOnClosed: nameField,
|
||||||
userId: deviceTile.userId,
|
userId: deviceTile.userId,
|
||||||
|
|
|
@ -60,7 +60,6 @@ HColumnPage {
|
||||||
|
|
||||||
utils.makePopup(
|
utils.makePopup(
|
||||||
"Popups/AuthentificationPopup.qml",
|
"Popups/AuthentificationPopup.qml",
|
||||||
page,
|
|
||||||
{
|
{
|
||||||
userId: page.userId,
|
userId: page.userId,
|
||||||
deviceIds,
|
deviceIds,
|
||||||
|
|
|
@ -25,7 +25,6 @@ Banner {
|
||||||
forget: button => {
|
forget: button => {
|
||||||
utils.makePopup(
|
utils.makePopup(
|
||||||
"Popups/ForgetRoomPopup.qml",
|
"Popups/ForgetRoomPopup.qml",
|
||||||
mainUI, // Must not be destroyed with chat
|
|
||||||
{
|
{
|
||||||
userId: chat.userId,
|
userId: chat.userId,
|
||||||
roomId: chat.roomId,
|
roomId: chat.roomId,
|
||||||
|
|
|
@ -37,7 +37,6 @@ Item {
|
||||||
sequences: window.settings.keys.leaveRoom
|
sequences: window.settings.keys.leaveRoom
|
||||||
onActivated: utils.makePopup(
|
onActivated: utils.makePopup(
|
||||||
"Popups/LeaveRoomPopup.qml",
|
"Popups/LeaveRoomPopup.qml",
|
||||||
chat,
|
|
||||||
{userId, roomId, roomName: roomInfo.display_name},
|
{userId, roomId, roomName: roomInfo.display_name},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -46,7 +45,6 @@ Item {
|
||||||
sequences: window.settings.keys.forgetRoom
|
sequences: window.settings.keys.forgetRoom
|
||||||
onActivated: utils.makePopup(
|
onActivated: utils.makePopup(
|
||||||
"Popups/ForgetRoomPopup.qml",
|
"Popups/ForgetRoomPopup.qml",
|
||||||
chat,
|
|
||||||
{userId, roomId, roomName: roomInfo.display_name},
|
{userId, roomId, roomName: roomInfo.display_name},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,6 @@ HTile {
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
popup: "Popups/RemoveMemberPopup.qml"
|
popup: "Popups/RemoveMemberPopup.qml"
|
||||||
popupParent: chat
|
|
||||||
properties: ({
|
properties: ({
|
||||||
userId: chat.userId,
|
userId: chat.userId,
|
||||||
roomId: chat.roomId,
|
roomId: chat.roomId,
|
||||||
|
@ -85,7 +84,6 @@ HTile {
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
popup: "Popups/RemoveMemberPopup.qml"
|
popup: "Popups/RemoveMemberPopup.qml"
|
||||||
popupParent: chat
|
|
||||||
properties: ({
|
properties: ({
|
||||||
userId: chat.userId,
|
userId: chat.userId,
|
||||||
roomId: chat.roomId,
|
roomId: chat.roomId,
|
||||||
|
|
|
@ -83,7 +83,6 @@ HColumnLayout {
|
||||||
|
|
||||||
onClicked: utils.makePopup(
|
onClicked: utils.makePopup(
|
||||||
"Popups/InviteToRoomPopup.qml",
|
"Popups/InviteToRoomPopup.qml",
|
||||||
chat,
|
|
||||||
{
|
{
|
||||||
userId: chat.userId,
|
userId: chat.userId,
|
||||||
roomId: chat.roomId,
|
roomId: chat.roomId,
|
||||||
|
|
|
@ -245,7 +245,6 @@ HColumnLayout {
|
||||||
enabled: properties.eventSenderAndIds.length
|
enabled: properties.eventSenderAndIds.length
|
||||||
|
|
||||||
popup: "Popups/RedactPopup.qml"
|
popup: "Popups/RedactPopup.qml"
|
||||||
popupParent: chat
|
|
||||||
properties: ({
|
properties: ({
|
||||||
preferUserId: chat.userId,
|
preferUserId: chat.userId,
|
||||||
roomId: chat.roomId,
|
roomId: chat.roomId,
|
||||||
|
@ -279,7 +278,6 @@ HColumnLayout {
|
||||||
text: qsTr("Clear messages")
|
text: qsTr("Clear messages")
|
||||||
|
|
||||||
popup: "Popups/ClearMessagesPopup.qml"
|
popup: "Popups/ClearMessagesPopup.qml"
|
||||||
popupParent: chat
|
|
||||||
properties: ({
|
properties: ({
|
||||||
userId: chat.userId,
|
userId: chat.userId,
|
||||||
roomId: chat.roomId,
|
roomId: chat.roomId,
|
||||||
|
|
|
@ -56,7 +56,6 @@ Rectangle {
|
||||||
sequences: window.settings.keys.removeFocusedOrSelectedMessages
|
sequences: window.settings.keys.removeFocusedOrSelectedMessages
|
||||||
onActivated: utils.makePopup(
|
onActivated: utils.makePopup(
|
||||||
"Popups/RedactPopup.qml",
|
"Popups/RedactPopup.qml",
|
||||||
chat,
|
|
||||||
{
|
{
|
||||||
preferUserId: chat.userId,
|
preferUserId: chat.userId,
|
||||||
roomId: chat.roomId,
|
roomId: chat.roomId,
|
||||||
|
@ -166,7 +165,6 @@ Rectangle {
|
||||||
sequences: window.settings.keys.clearRoomMessages
|
sequences: window.settings.keys.clearRoomMessages
|
||||||
onActivated: utils.makePopup(
|
onActivated: utils.makePopup(
|
||||||
"Popups/ClearMessagesPopup.qml",
|
"Popups/ClearMessagesPopup.qml",
|
||||||
mainUI,
|
|
||||||
{
|
{
|
||||||
userId: window.uiState.pageProperties.userId,
|
userId: window.uiState.pageProperties.userId,
|
||||||
roomId: window.uiState.pageProperties.roomId,
|
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) {
|
autoDestruct=true) {
|
||||||
makeObject(urlComponent, parent, properties, (popup) => {
|
makeObject(urlComponent, window, properties, (popup) => {
|
||||||
popup.open()
|
popup.open()
|
||||||
if (autoDestruct) popup.closed.connect(() => { popup.destroy() })
|
if (autoDestruct) popup.closed.connect(() => { popup.destroy() })
|
||||||
if (callback) callback(popup)
|
if (callback) callback(popup)
|
||||||
|
@ -68,7 +68,6 @@ QtObject {
|
||||||
|
|
||||||
utils.makePopup(
|
utils.makePopup(
|
||||||
"Popups/UnexpectedErrorPopup.qml",
|
"Popups/UnexpectedErrorPopup.qml",
|
||||||
window,
|
|
||||||
{ errorType: type, message, traceback },
|
{ errorType: type, message, traceback },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user