From ab25276e27253ffc340ca9710ce98f2ef01336e6 Mon Sep 17 00:00:00 2001
From: cberthet <capucine.berthet@savoirfairelinux.com>
Date: Thu, 31 Aug 2023 16:38:53 -0400
Subject: [PATCH] Dialog popup: BaseModalDialog redone, every popup based on it
 checked

GitLab: #1326
Change-Id: Ia72a9f4d2daa60261054e050ab89de18a139ecd2
---
 src/app/commoncomponents/BaseModalDialog.qml  |  97 ++---
 src/app/commoncomponents/ConfirmDialog.qml    |   7 +-
 .../commoncomponents/DaemonReconnectPopup.qml |   3 +-
 .../commoncomponents/DeleteAccountDialog.qml  |  19 +-
 src/app/commoncomponents/EditedPopup.qml      |  27 +-
 src/app/commoncomponents/PasswordDialog.qml   |  64 ++--
 src/app/commoncomponents/PhotoboothPopup.qml  | 356 ++++++++----------
 .../commoncomponents/SimpleMessageDialog.qml  |   5 -
 src/app/mainview/components/AboutPopUp.qml    | 272 ++++++-------
 src/app/mainview/components/ContactPicker.qml |  11 +-
 .../mainview/components/DevicesListPopup.qml  |  56 +--
 src/app/mainview/components/HostPopup.qml     |  35 +-
 src/app/mainview/components/UserProfile.qml   |  47 +--
 .../components/WelcomePageQrDialog.qml        |  22 +-
 .../components/LinkDeviceDialog.qml           | 114 +++---
 .../components/NameRegistrationDialog.qml     |  17 +-
 .../components/RevokeDevicePasswordDialog.qml |   5 +-
 17 files changed, 466 insertions(+), 691 deletions(-)

diff --git a/src/app/commoncomponents/BaseModalDialog.qml b/src/app/commoncomponents/BaseModalDialog.qml
index 2ee3de52a..4259c68f0 100644
--- a/src/app/commoncomponents/BaseModalDialog.qml
+++ b/src/app/commoncomponents/BaseModalDialog.qml
@@ -20,6 +20,7 @@ import QtQuick.Controls
 import QtQuick.Layouts
 import Qt5Compat.GraphicalEffects
 import net.jami.Constants 1.1
+import "../mainview/components"
 
 Popup {
     id: root
@@ -28,65 +29,80 @@ Popup {
     property bool autoClose: true
     property alias backgroundColor: container.color
     property alias title: titleText.text
-    property var popupContentLoader: containerSubContentLoader
+    property var popupcontainerSubContentLoader: containerSubContentLoader
+    property bool topLayoutVisible: true
     property alias popupContentLoadStatus: containerSubContentLoader.status
     property alias popupContent: containerSubContentLoader.sourceComponent
-    property int popupContentPreferredHeight: 0
-    property int popupContentPreferredWidth: 0
-    property int popupContentMargins: 0
+    property int popupContentMargins: JamiTheme.preferredMarginSize
 
     parent: Overlay.overlay
-
-    // center in parent
-    x: Math.round((parent.width - width) / 2)
-    y: Math.round((parent.height - height) / 2)
-
+    anchors.centerIn: parent
     modal: true
+    padding: popupContentMargins
 
-    padding: 0
-
-    // A popup is invisible until opened.
-    visible: false
     focus: true
     closePolicy: autoClose ? (Popup.CloseOnEscape | Popup.CloseOnPressOutside) : Popup.NoAutoClose
 
-    Rectangle {
+    contentItem: Control {
         id: container
 
-        anchors.fill: parent
+        property color color: JamiTheme.secondaryBackgroundColor
+        padding: popupContentMargins
+        anchors.margins: popupContentMargins
+        anchors.centerIn: parent
+
+        background: Rectangle {
+            id: bgRect
+            radius: JamiTheme.modalPopupRadius
+            color: container.color
+            layer.enabled: true
+            layer.effect: DropShadow {
+                horizontalOffset: 3.0
+                verticalOffset: 3.0
+                radius: bgRect.radius * 4
+                color: JamiTheme.shadowColor
+                source: bgRect
+                transparentBorder: true
+                samples: radius + 1
+            }
+        }
+
+        contentItem: ColumnLayout {
+            id: contentLayout
+
+            RowLayout {
+                Layout.preferredWidth: parent.width
+                Layout.bottomMargin: JamiTheme.preferredMarginSize
+                visible: topLayoutVisible
 
-        ColumnLayout {
-            anchors.fill: parent
+                Label {
+                    id: titleText
 
-            spacing: 0
+                    Layout.alignment: Qt.AlignTop | Qt.AlignLeft
+                    font.pointSize: JamiTheme.menuFontSize
+                    color: JamiTheme.textColor
 
-            Text {
-                id: titleText
 
-                Layout.alignment: Qt.AlignTop | Qt.AlignLeft
-                Layout.margins: text.length === 0 ? 0 : 10
+                    visible: text.length > 0
+                }
 
-                Layout.preferredHeight: text.length === 0 ? 0 : contentHeight
+                JamiPushButton {
+                    id: closeButton
+                    Layout.alignment: Qt.AlignRight
+                    imageColor: "grey"
+                    normalColor: "transparent"
 
-                font.pointSize: JamiTheme.menuFontSize
-                color: JamiTheme.textColor
+                    source: JamiResources.round_close_24dp_svg
+                    onClicked: close()
+                }
             }
 
             Loader {
                 id: containerSubContentLoader
 
-                Layout.topMargin: popupContentMargins
-                Layout.bottomMargin: popupContentMargins
                 Layout.alignment: Qt.AlignCenter
-                Layout.fillWidth: popupContentPreferredWidth === 0
-                Layout.fillHeight: popupContentPreferredHeight === 0
-                Layout.preferredHeight: popupContentPreferredHeight
-                Layout.preferredWidth: popupContentPreferredWidth
             }
         }
-
-        radius: JamiTheme.modalPopupRadius
-        color: JamiTheme.secondaryBackgroundColor
     }
 
     background: Rectangle {
@@ -103,19 +119,6 @@ Popup {
         }
     }
 
-    DropShadow {
-        z: -1
-        width: root.width
-        height: root.height
-        horizontalOffset: 3.0
-        verticalOffset: 3.0
-        radius: container.radius * 4
-        color: JamiTheme.shadowColor
-        source: container
-        transparentBorder: true
-        samples: radius + 1
-    }
-
     enter: Transition {
         NumberAnimation {
             properties: "opacity"
diff --git a/src/app/commoncomponents/ConfirmDialog.qml b/src/app/commoncomponents/ConfirmDialog.qml
index 7ebbbf162..fb3c5942b 100644
--- a/src/app/commoncomponents/ConfirmDialog.qml
+++ b/src/app/commoncomponents/ConfirmDialog.qml
@@ -27,9 +27,6 @@ BaseModalDialog {
 
     signal accepted
 
-    width: Math.min(appWindow.width - 2 * JamiTheme.preferredMarginSize, JamiTheme.preferredDialogWidth)
-    height: Math.min(appWindow.height - 2 * JamiTheme.preferredMarginSize, JamiTheme.preferredDialogHeight)
-
     property string confirmLabel: ""
     property string textLabel: ""
 
@@ -40,7 +37,7 @@ BaseModalDialog {
             id: labelAction
 
             Layout.alignment: Qt.AlignHCenter
-            Layout.preferredWidth: column.width - JamiTheme.preferredMarginSize * 2
+            Layout.maximumWidth: root.width - JamiTheme.preferredMarginSize * 4
 
             color: JamiTheme.textColor
             text: root.textLabel
@@ -55,8 +52,8 @@ BaseModalDialog {
 
         RowLayout {
             spacing: 16
-            Layout.fillWidth: true
             Layout.alignment: Qt.AlignCenter
+            Layout.topMargin: JamiTheme.preferredMarginSize
 
             MaterialButton {
                 id: primaryBtn
diff --git a/src/app/commoncomponents/DaemonReconnectPopup.qml b/src/app/commoncomponents/DaemonReconnectPopup.qml
index 5e7796946..6cf50caf5 100644
--- a/src/app/commoncomponents/DaemonReconnectPopup.qml
+++ b/src/app/commoncomponents/DaemonReconnectPopup.qml
@@ -68,7 +68,8 @@ BaseModalDialog {
             id: daemonReconnectPopupTextLabel
 
             Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
-            Layout.topMargin: preferredMargin
+            Layout.maximumWidth: root.parent.width - 4 * JamiTheme.preferredMarginSize
+            wrapMode: Text.Wrap
 
             text: connectionFailed ? JamiStrings.reconnectionFailed : JamiStrings.reconnectDaemon
             font.pointSize: JamiTheme.textFontSize + 2
diff --git a/src/app/commoncomponents/DeleteAccountDialog.qml b/src/app/commoncomponents/DeleteAccountDialog.qml
index 3d0d7bc68..7d508a571 100644
--- a/src/app/commoncomponents/DeleteAccountDialog.qml
+++ b/src/app/commoncomponents/DeleteAccountDialog.qml
@@ -33,17 +33,15 @@ BaseModalDialog {
 
     title: JamiStrings.deleteAccount
 
-    width: Math.min(appWindow.width - 2 * JamiTheme.preferredMarginSize, JamiTheme.preferredDialogWidth)
-    height: Math.min(appWindow.height - 2 * JamiTheme.preferredMarginSize, JamiTheme.preferredDialogHeight)
-
     popupContent: ColumnLayout {
         id: deleteAccountContentColumnLayout
+        anchors.centerIn: parent
 
         Label {
             id: labelDeletion
 
             Layout.alignment: Qt.AlignHCenter
-            Layout.preferredWidth: deleteAccountContentColumnLayout.width - JamiTheme.preferredMarginSize * 2
+            Layout.maximumWidth: root.width - 4*JamiTheme.preferredMarginSize
 
             color: JamiTheme.textColor
             text: JamiStrings.confirmDeleteQuestion
@@ -51,8 +49,6 @@ BaseModalDialog {
             font.pointSize: JamiTheme.textFontSize
             font.kerning: true
 
-            horizontalAlignment: Text.AlignHCenter
-            verticalAlignment: Text.AlignVCenter
             wrapMode: Text.Wrap
         }
 
@@ -60,7 +56,6 @@ BaseModalDialog {
             id: labelBestId
 
             Layout.alignment: Qt.AlignHCenter
-            Layout.preferredWidth: deleteAccountContentColumnLayout.width - JamiTheme.preferredMarginSize * 2
 
             color: JamiTheme.textColor
             text: bestName
@@ -68,9 +63,6 @@ BaseModalDialog {
             font.pointSize: JamiTheme.textFontSize
             font.kerning: true
             font.bold: true
-
-            horizontalAlignment: Text.AlignHCenter
-            verticalAlignment: Text.AlignVCenter
             wrapMode: Text.Wrap
         }
 
@@ -78,7 +70,7 @@ BaseModalDialog {
             id: labelAccountHash
 
             Layout.alignment: Qt.AlignHCenter
-            Layout.preferredWidth: deleteAccountContentColumnLayout.width - JamiTheme.preferredMarginSize * 2
+            Layout.preferredWidth: root.width - 4*JamiTheme.preferredMarginSize
 
             color: JamiTheme.textColor
             text: accountId
@@ -87,7 +79,6 @@ BaseModalDialog {
             font.kerning: true
 
             horizontalAlignment: Text.AlignHCenter
-            verticalAlignment: Text.AlignVCenter
             wrapMode: Text.Wrap
         }
 
@@ -97,7 +88,7 @@ BaseModalDialog {
             visible: !isSIP
 
             Layout.alignment: Qt.AlignHCenter
-            Layout.preferredWidth: deleteAccountContentColumnLayout.width - JamiTheme.preferredMarginSize * 2
+            Layout.preferredWidth: root.width - 4*JamiTheme.preferredMarginSize
 
             text: JamiStrings.deleteAccountInfos
 
@@ -120,6 +111,7 @@ BaseModalDialog {
                 id: btnDelete
 
                 Layout.alignment: Qt.AlignHCenter
+                Layout.topMargin: JamiTheme.preferredMarginSize
 
                 preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8
                 buttontextHeightMargin: JamiTheme.buttontextHeightMargin
@@ -164,6 +156,7 @@ BaseModalDialog {
                 id: btnCancel
 
                 Layout.alignment: Qt.AlignHCenter
+                Layout.topMargin: JamiTheme.preferredMarginSize
 
                 preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8
                 buttontextHeightMargin: JamiTheme.buttontextHeightMargin
diff --git a/src/app/commoncomponents/EditedPopup.qml b/src/app/commoncomponents/EditedPopup.qml
index 883a540f9..49bab54da 100644
--- a/src/app/commoncomponents/EditedPopup.qml
+++ b/src/app/commoncomponents/EditedPopup.qml
@@ -25,19 +25,13 @@ import net.jami.Constants 1.1
 BaseModalDialog {
     id: root
 
-    width: 488
-    height: 256
+    width: JamiTheme.secondaryDialogDimension
 
     property var previousBodies: undefined
 
-    popupContent: Item {
-        id: rect
-
-        width: root.width
-
-        JamiListView {
-            anchors.fill: parent
-            anchors.margins: JamiTheme.preferredMarginSize
+    popupContent: JamiListView {
+            width: root.width - 4 * JamiTheme.preferredMarginSize
+            height: Math.min(count * 50, 150)
 
             model: root.previousBodies
 
@@ -79,17 +73,4 @@ BaseModalDialog {
                 }
             }
         }
-
-        PushButton {
-            id: btnCancel
-            imageColor: "grey"
-            normalColor: "transparent"
-            anchors.right: parent.right
-            anchors.top: parent.top
-            anchors.topMargin: 10
-            anchors.rightMargin: 10
-            source: JamiResources.round_close_24dp_svg
-            onClicked: close()
-        }
     }
-}
diff --git a/src/app/commoncomponents/PasswordDialog.qml b/src/app/commoncomponents/PasswordDialog.qml
index f7e3fdb6f..f008ec844 100644
--- a/src/app/commoncomponents/PasswordDialog.qml
+++ b/src/app/commoncomponents/PasswordDialog.qml
@@ -35,9 +35,6 @@ BaseModalDialog {
 
     signal done(bool success, int purpose)
 
-    width: Math.min(appWindow.width - 2 * JamiTheme.preferredMarginSize, JamiTheme.preferredDialogWidth)
-    height: Math.min(appWindow.height - 2 * JamiTheme.preferredMarginSize, JamiTheme.preferredDialogHeight)
-
     title: {
         switch (purpose) {
         case PasswordDialog.ExportAccount:
@@ -75,7 +72,7 @@ BaseModalDialog {
     popupContent: ColumnLayout {
         id: popupContentColumnLayout
 
-        spacing: 0
+        spacing: 16
 
         function validatePassword() {
             switch (purpose) {
@@ -128,6 +125,8 @@ BaseModalDialog {
             Layout.alignment: Qt.AlignHCenter
             Layout.preferredWidth: JamiTheme.preferredFieldWidth
             Layout.preferredHeight: visible ? 48 : 0
+            Layout.leftMargin: JamiTheme.preferredMarginSize
+            Layout.rightMargin: JamiTheme.preferredMarginSize
 
             visible: purpose === PasswordDialog.ChangePassword || purpose === PasswordDialog.ExportAccount
             placeholderText: JamiStrings.enterCurrentPassword
@@ -141,6 +140,8 @@ BaseModalDialog {
             Layout.alignment: Qt.AlignHCenter
             Layout.preferredWidth: JamiTheme.preferredFieldWidth
             Layout.preferredHeight: visible ? 48 : 0
+            Layout.leftMargin: JamiTheme.preferredMarginSize
+            Layout.rightMargin: JamiTheme.preferredMarginSize
 
             visible: purpose === PasswordDialog.ChangePassword || purpose === PasswordDialog.SetPassword
 
@@ -155,6 +156,8 @@ BaseModalDialog {
             Layout.alignment: Qt.AlignHCenter
             Layout.preferredWidth: JamiTheme.preferredFieldWidth
             Layout.preferredHeight: visible ? 48 : 0
+            Layout.leftMargin: JamiTheme.preferredMarginSize
+            Layout.rightMargin: JamiTheme.preferredMarginSize
 
             visible: purpose === PasswordDialog.ChangePassword || purpose === PasswordDialog.SetPassword
 
@@ -163,49 +166,24 @@ BaseModalDialog {
             onDynamicTextChanged: popupContentColumnLayout.validatePassword()
         }
 
-        RowLayout {
-            spacing: 16
-            Layout.fillWidth: true
-            Layout.alignment: Qt.AlignCenter
-
-            MaterialButton {
-                id: btnConfirm
-
-                Layout.alignment: Qt.AlignHCenter
-
-                preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8
-
-                color: enabled ? JamiTheme.buttonTintedBlack : JamiTheme.buttonTintedGrey
-                hoveredColor: JamiTheme.buttonTintedBlackHovered
-                pressedColor: JamiTheme.buttonTintedBlackPressed
-                secondary: true
-                autoAccelerator: true
-                enabled: purpose === PasswordDialog.SetPassword
-
-                text: (purpose === PasswordDialog.ExportAccount) ? JamiStrings.exportAccount : JamiStrings.change
+        MaterialButton {
+            id: btnConfirm
 
-                onClicked: {
-                    btnConfirm.enabled = false;
-                    timerToOperate.restart();
-                }
-            }
-
-            MaterialButton {
-                id: btnCancel
-
-                Layout.alignment: Qt.AlignHCenter
-
-                preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8
+            Layout.alignment: Qt.AlignHCenter
+            preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8
 
-                color: JamiTheme.buttonTintedBlack
-                hoveredColor: JamiTheme.buttonTintedBlackHovered
-                pressedColor: JamiTheme.buttonTintedBlackPressed
-                secondary: true
-                autoAccelerator: true
+            color: enabled ? JamiTheme.buttonTintedBlack : JamiTheme.buttonTintedGrey
+            hoveredColor: JamiTheme.buttonTintedBlackHovered
+            pressedColor: JamiTheme.buttonTintedBlackPressed
+            secondary: true
+            autoAccelerator: true
+            enabled: purpose === PasswordDialog.SetPassword
 
-                text: JamiStrings.optionCancel
+            text: (purpose === PasswordDialog.ExportAccount) ? JamiStrings.exportAccount : JamiStrings.change
 
-                onClicked: close()
+            onClicked: {
+                btnConfirm.enabled = false;
+                timerToOperate.restart();
             }
         }
     }
diff --git a/src/app/commoncomponents/PhotoboothPopup.qml b/src/app/commoncomponents/PhotoboothPopup.qml
index 1fffe1cb8..63a911cfc 100644
--- a/src/app/commoncomponents/PhotoboothPopup.qml
+++ b/src/app/commoncomponents/PhotoboothPopup.qml
@@ -32,15 +32,12 @@ import "../mainview/components"
 BaseModalDialog {
     id: root
 
-    height: 157
-    x: - width / 2
-    y: - height / 5
-
     property string imageId
     property bool newItem
     property real buttonSize: JamiTheme.smartListAvatarSize
     property real imageSize: 25
 
+
     signal focusOnPreviousItem
     signal focusOnNextItem
 
@@ -60,9 +57,15 @@ BaseModalDialog {
         importButton.forceActiveFocus()
     }
 
+    width: JamiTheme.preferredDialogWidth
+
+    title: JamiStrings.chooseAvatarPicture
+
     RecordBox {
         id: recordBox
 
+        anchors.centerIn: parent
+
         isPhoto: true
         visible: false
 
@@ -77,223 +80,176 @@ BaseModalDialog {
         }
     }
 
-    popupContent: Item {
+    popupContent: RowLayout {
+            id: buttonsRowLayout
 
-        Component.onCompleted: {
-            root.width = Qt.binding(() => clearButton.visible ? 283 : 210)
-        }
-
-        Rectangle {
-            id: container
-
-            anchors.fill: parent
-            radius: JamiTheme.photoPopupRadius
-            color: JamiTheme.inviteHoverColor
+            spacing: 10
 
             PushButton {
-                id: btnCancel
-                imageColor: "grey"
-                normalColor: "transparent"
-                anchors.right: parent.right
-                anchors.top: parent.top
-                anchors.topMargin: 10
-                anchors.rightMargin: 10
-                source: JamiResources.round_close_24dp_svg
-                onClicked: { close();}
-            }
+                id: takePhotoButton
 
+                objectName: "takePhotoButton"
 
-            ColumnLayout {
-                id:  mainLayout
-                anchors.fill: parent
-                anchors.margins: JamiTheme.preferredMarginSize
+                Layout.alignment: Qt.AlignHCenter
 
-                Text {
-                    id: informativeLabel
+                height: buttonSize
+                width: buttonSize
+                imageContainerWidth: imageSize
+                imageContainerHeight: imageSize
+                radius: height / 2
+                border.color: JamiTheme.buttonTintedBlue
+                normalColor: "transparent"
+                imageColor: JamiTheme.buttonTintedBlue
+                toolTipText: JamiStrings.takePhoto
+                source: JamiResources.baseline_camera_alt_24dp_svg
+                hoveredColor: JamiTheme.smartListHoveredColor
+
+                Keys.onPressed: function (keyEvent) {
+                    if (keyEvent.key === Qt.Key_Enter ||
+                            keyEvent.key === Qt.Key_Return) {
+                        clicked()
+                        keyEvent.accepted = true
+                    } else if (keyEvent.key === Qt.Key_Up) {
+                        root.focusOnPreviousItem()
+                        keyEvent.accepted = true
+                    }
+                }
 
-                    Layout.alignment: Qt.AlignCenter
-                    Layout.fillWidth: true
-                    Layout.topMargin: 26
-                    horizontalAlignment: Text.AlignHCenter
-                    verticalAlignment: Text.AlignVCenter
-                    text: JamiStrings.chooseAvatarPicture
-                    color: JamiTheme.primaryForegroundColor
-                    font.pixelSize: JamiTheme.popupPhotoTextSize
-                    elide: Text.ElideRight
+                KeyNavigation.tab: {
+                    if (clearButton.visible)
+                        return clearButton
+                    return importButton
                 }
+                KeyNavigation.down: KeyNavigation.tab
+
+                onClicked: {
+                    recordBox.parent = buttonsRowLayout
+
+                    recordBox.x = Qt.binding(function() {
+                        var buttonCenterX = buttonsRowLayout.width / 2
+                        return buttonCenterX - recordBox.width / 2
+                    })
+                    recordBox.y = Qt.binding(function() {
+                        return - recordBox.height / 2
+                    })
+                    startBooth()
+                }
+            }
 
-                RowLayout {
-                    id: buttonsRowLayout
-                    Layout.preferredHeight: childrenRect.height
-                    Layout.alignment: Qt.AlignCenter
-                    spacing: 10
-
-                    PushButton {
-                        id: takePhotoButton
-
-                        objectName: "takePhotoButton"
-
-                        Layout.alignment: Qt.AlignHCenter
-
-                        height: buttonSize
-                        width: buttonSize
-                        imageContainerWidth: imageSize
-                        imageContainerHeight: imageSize
-                        radius: height / 2
-                        border.color: JamiTheme.buttonTintedBlue
-                        normalColor: "transparent"
-                        imageColor: JamiTheme.buttonTintedBlue
-                        toolTipText: JamiStrings.takePhoto
-                        source: JamiResources.baseline_camera_alt_24dp_svg
-                        hoveredColor: JamiTheme.smartListHoveredColor
-
-                        Keys.onPressed: function (keyEvent) {
-                            if (keyEvent.key === Qt.Key_Enter ||
-                                    keyEvent.key === Qt.Key_Return) {
-                                clicked()
-                                keyEvent.accepted = true
-                            } else if (keyEvent.key === Qt.Key_Up) {
-                                root.focusOnPreviousItem()
-                                keyEvent.accepted = true
-                            }
-                        }
+            PushButton {
+                id: importButton
 
-                        KeyNavigation.tab: {
-                            if (clearButton.visible)
-                                return clearButton
-                            return importButton
-                        }
-                        KeyNavigation.down: KeyNavigation.tab
-
-                        onClicked: {
-                            recordBox.parent = buttonsRowLayout
-
-                            recordBox.x = Qt.binding(function() {
-                                var buttonCenterX = buttonsRowLayout.width / 2
-                                return buttonCenterX - recordBox.width / 2
-                            })
-                            recordBox.y = Qt.binding(function() {
-                                return - recordBox.height / 2
-                            })
-                            startBooth()
-                        }
-                    }
+                objectName: "photoboothViewImportButton"
 
-                    PushButton {
-                        id: importButton
-
-                        objectName: "photoboothViewImportButton"
-
-                        Layout.alignment: Qt.AlignHCenter
-                        visible: parent.visible
-
-                        height: buttonSize
-                        width: buttonSize
-                        imageContainerWidth: imageSize
-                        imageContainerHeight: imageSize
-                        radius: height / 2
-                        border.color: JamiTheme.buttonTintedBlue
-                        normalColor: "transparent"
-                        source: JamiResources.round_folder_24dp_svg
-                        toolTipText: JamiStrings.importFromFile
-                        imageColor: JamiTheme.buttonTintedBlue
-                        hoveredColor: JamiTheme.smartListHoveredColor
-
-
-                        Keys.onPressed: function (keyEvent) {
-                            if (keyEvent.key === Qt.Key_Enter ||
-                                    keyEvent.key === Qt.Key_Return) {
-                                clicked()
-                                keyEvent.accepted = true
-                            } else if (keyEvent.key === Qt.Key_Down ||
-                                       keyEvent.key === Qt.Key_Tab) {
-                                clearButton.forceActiveFocus()
-                                keyEvent.accepted = true
-                            }
-                        }
+                Layout.alignment: Qt.AlignHCenter
+                visible: parent.visible
 
-                        KeyNavigation.up: takePhotoButton
-
-                        onClicked: {
-                            stopBooth()
-                            var dlg = viewCoordinator.presentDialog(
-                                        appWindow,
-                                        "commoncomponents/JamiFileDialog.qml",
-                                        {
-                                            title: JamiStrings.chooseAvatarImage,
-                                            fileMode: JamiFileDialog.OpenFile,
-                                            folder: StandardPaths.writableLocation(
-                                                        StandardPaths.PicturesLocation),
-                                            nameFilters: [JamiStrings.imageFiles,
-                                                JamiStrings.allFiles]
-                                        })
-                            dlg.fileAccepted.connect(function(file) {
-                                var filePath = UtilsAdapter.getAbsPath(file)
-                                if (!root.newItem) {
-                                    AccountAdapter.setCurrentAccountAvatarFile(filePath)
-                                } else {
-                                    UtilsAdapter.setTempCreationImageFromFile(filePath, root.imageId)
-                                }
-                                root.close()
-                            })
-                        }
+                height: buttonSize
+                width: buttonSize
+                imageContainerWidth: imageSize
+                imageContainerHeight: imageSize
+                radius: height / 2
+                border.color: JamiTheme.buttonTintedBlue
+                normalColor: "transparent"
+                source: JamiResources.round_folder_24dp_svg
+                toolTipText: JamiStrings.importFromFile
+                imageColor: JamiTheme.buttonTintedBlue
+                hoveredColor: JamiTheme.smartListHoveredColor
+
+
+                Keys.onPressed: function (keyEvent) {
+                    if (keyEvent.key === Qt.Key_Enter ||
+                            keyEvent.key === Qt.Key_Return) {
+                        clicked()
+                        keyEvent.accepted = true
+                    } else if (keyEvent.key === Qt.Key_Down ||
+                               keyEvent.key === Qt.Key_Tab) {
+                        clearButton.forceActiveFocus()
+                        keyEvent.accepted = true
                     }
+                }
 
-                    PushButton {
-                        id: clearButton
-
-                        objectName: "photoboothViewClearButton"
+                KeyNavigation.up: takePhotoButton
+
+                onClicked: {
+                    stopBooth()
+                    var dlg = viewCoordinator.presentDialog(
+                                appWindow,
+                                "commoncomponents/JamiFileDialog.qml",
+                                {
+                                    title: JamiStrings.chooseAvatarImage,
+                                    fileMode: JamiFileDialog.OpenFile,
+                                    folder: StandardPaths.writableLocation(
+                                                StandardPaths.PicturesLocation),
+                                    nameFilters: [JamiStrings.imageFiles,
+                                        JamiStrings.allFiles]
+                                })
+                    dlg.fileAccepted.connect(function(file) {
+                        var filePath = UtilsAdapter.getAbsPath(file)
+                        if (!root.newItem) {
+                            AccountAdapter.setCurrentAccountAvatarFile(filePath)
+                        } else {
+                            UtilsAdapter.setTempCreationImageFromFile(filePath, root.imageId)
+                        }
+                        root.close()
+                    })
+                }
+            }
 
-                        Layout.alignment: Qt.AlignHCenter
+            PushButton {
+                id: clearButton
 
-                        height: buttonSize
-                        width: buttonSize
-                        imageContainerWidth: imageSize
-                        imageContainerHeight: imageSize
-                        radius: height / 2
-                        border.color: JamiTheme.buttonTintedBlue
-                        normalColor: "transparent"
-                        source: JamiResources.ic_hangup_participant_24dp_svg
-                        toolTipText: JamiStrings.clearAvatar
-                        imageColor: JamiTheme.buttonTintedBlue
-                        hoveredColor: JamiTheme.smartListHoveredColor
+                objectName: "photoboothViewClearButton"
 
+                Layout.alignment: Qt.AlignHCenter
 
-                        visible: {
-                            if (!newItem && LRCInstance.currentAccountAvatarSet)
-                                return true
-                            if (newItem && UtilsAdapter.tempCreationImage(imageId).length !== 0)
-                                return true
-                            return false
-                        }
-
-                        KeyNavigation.up: importButton
-
-                        Keys.onPressed: function (keyEvent) {
-                            if (keyEvent.key === Qt.Key_Enter ||
-                                    keyEvent.key === Qt.Key_Return) {
-                                clicked()
-                                importButton.forceActiveFocus()
-                                keyEvent.accepted = true
-                            } else if (keyEvent.key === Qt.Key_Down ||
-                                       keyEvent.key === Qt.Key_Tab) {
-                                btnCancel.forceActiveFocus()
-                                keyEvent.accepted = true
-                            }
-                        }
+                height: buttonSize
+                width: buttonSize
+                imageContainerWidth: imageSize
+                imageContainerHeight: imageSize
+                radius: height / 2
+                border.color: JamiTheme.buttonTintedBlue
+                normalColor: "transparent"
+                source: JamiResources.ic_hangup_participant_24dp_svg
+                toolTipText: JamiStrings.clearAvatar
+                imageColor: JamiTheme.buttonTintedBlue
+                hoveredColor: JamiTheme.smartListHoveredColor
+
+
+                visible: {
+                    if (!newItem && LRCInstance.currentAccountAvatarSet)
+                        return true
+                    if (newItem && UtilsAdapter.tempCreationImage(imageId).length !== 0)
+                        return true
+                    return false
+                }
 
-                        onClicked: {
-                            if (!root.newItem)
-                                AccountAdapter.setCurrentAccountAvatarBase64()
-                            else
-                                UtilsAdapter.setTempCreationImageFromString("", imageId)
-                            visible = false
-                            stopBooth()
-                            root.close()
-                        }
+                KeyNavigation.up: importButton
+
+                Keys.onPressed: function (keyEvent) {
+                    if (keyEvent.key === Qt.Key_Enter ||
+                            keyEvent.key === Qt.Key_Return) {
+                        clicked()
+                        importButton.forceActiveFocus()
+                        keyEvent.accepted = true
+                    } else if (keyEvent.key === Qt.Key_Down ||
+                               keyEvent.key === Qt.Key_Tab) {
+                        btnCancel.forceActiveFocus()
+                        keyEvent.accepted = true
                     }
                 }
+
+                onClicked: {
+                    if (!root.newItem)
+                        AccountAdapter.setCurrentAccountAvatarBase64()
+                    else
+                        UtilsAdapter.setTempCreationImageFromString("", imageId)
+                    visible = false
+                    stopBooth()
+                    root.close()
+                }
             }
         }
     }
-}
+
+
diff --git a/src/app/commoncomponents/SimpleMessageDialog.qml b/src/app/commoncomponents/SimpleMessageDialog.qml
index c31a6fb50..a47e9110d 100644
--- a/src/app/commoncomponents/SimpleMessageDialog.qml
+++ b/src/app/commoncomponents/SimpleMessageDialog.qml
@@ -44,9 +44,6 @@ BaseModalDialog {
         open();
     }
 
-    width: Math.max(JamiTheme.preferredDialogWidth, buttonTitles.length * (JamiTheme.preferredFieldWidth / 2 + JamiTheme.preferredMarginSize))
-    height: JamiTheme.preferredDialogHeight / 2 - JamiTheme.preferredMarginSize
-
     popupContent: ColumnLayout {
         Label {
             id: infoTextLabel
@@ -72,12 +69,10 @@ BaseModalDialog {
 
             data: innerContentData
         }
-
         RowLayout {
             spacing: JamiTheme.preferredMarginSize
 
             Layout.fillWidth: true
-            Layout.preferredHeight: contentHeight
             Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
             Layout.bottomMargin: JamiTheme.preferredMarginSize
 
diff --git a/src/app/mainview/components/AboutPopUp.qml b/src/app/mainview/components/AboutPopUp.qml
index 21bd99bc9..54218a77f 100644
--- a/src/app/mainview/components/AboutPopUp.qml
+++ b/src/app/mainview/components/AboutPopUp.qml
@@ -26,191 +26,169 @@ import "../../commoncomponents"
 
 BaseModalDialog {
     id: root
-
-    width: Math.min(parent.width - 2 * JamiTheme.preferredMarginSize, JamiTheme.secondaryDialogDimension)
-    height: Math.min(parent.height - 2 * JamiTheme.preferredMarginSize, JamiTheme.secondaryDialogDimension)
-
-    popupContentMargins: 14
-
-    PushButton {
-        id: btnClose
-
-        anchors.right: parent.right
-        anchors.top: parent.top
-        anchors.topMargin: JamiTheme.preferredMarginSize
-        anchors.rightMargin: JamiTheme.preferredMarginSize
-        imageColor: "grey"
-        normalColor: JamiTheme.transparentColor
-
-        source: JamiResources.round_close_24dp_svg
-
-        onClicked: {
-            close();
-        }
-    }
+    margins: JamiTheme.preferredMarginSize
 
     popupContent: JamiFlickable {
-        id: aboutPopUpScrollView
-
-        width: root.width
-        contentHeight: aboutPopUpContentRectColumnLayout.implicitHeight
+            id: aboutPopUpScrollView
+            width: aboutPopUpContentRectColumnLayout.implicitWidth
+            height: JamiTheme.preferredDialogHeight
 
-        ColumnLayout {
-            id: aboutPopUpContentRectColumnLayout
+            contentHeight: aboutPopUpContentRectColumnLayout.implicitHeight
 
-            width: root.width
+            ColumnLayout {
+                id: aboutPopUpContentRectColumnLayout
+                anchors.centerIn: parent
 
-            ResponsiveImage {
-                id: aboutPopUPJamiLogoImage
+                ResponsiveImage {
+                    id: aboutPopUPJamiLogoImage
 
-                Layout.alignment: Qt.AlignCenter
-                Layout.topMargin: JamiTheme.preferredMarginSize
-                Layout.preferredWidth: JamiTheme.aboutLogoPreferredWidth
-                Layout.preferredHeight: JamiTheme.aboutLogoPreferredHeight
+                    Layout.alignment: Qt.AlignCenter
+                    Layout.preferredWidth: JamiTheme.aboutLogoPreferredWidth
+                    Layout.preferredHeight: JamiTheme.aboutLogoPreferredHeight
 
-                source: JamiTheme.darkTheme ? JamiResources.logo_jami_standard_coul_white_svg : JamiResources.logo_jami_standard_coul_svg
-            }
+                    source: JamiTheme.darkTheme ? JamiResources.logo_jami_standard_coul_white_svg : JamiResources.logo_jami_standard_coul_svg
+                }
 
-            TextEdit {
-                id: jamiSlogansText
+                TextEdit {
+                    id: jamiSlogansText
 
-                Layout.alignment: Qt.AlignCenter
-                Layout.preferredWidth: aboutPopUpScrollView.width
-                Layout.topMargin: 26
+                    Layout.alignment: Qt.AlignCenter
+                    Layout.maximumWidth: JamiTheme.preferredDialogWidth - 2*JamiTheme.preferredMarginSize
+                    Layout.topMargin: 26
 
-                wrapMode: Text.WordWrap
-                font.pixelSize: JamiTheme.bigFontSize
+                    wrapMode: Text.WordWrap
+                    font.pixelSize: JamiTheme.bigFontSize
 
-                horizontalAlignment: Text.AlignHCenter
-                verticalAlignment: Text.AlignVCenter
+                    horizontalAlignment: Text.AlignHCenter
+                    verticalAlignment: Text.AlignVCenter
 
-                text: textMetricsjamiSlogansText.text
-                selectByMouse: true
-                readOnly: true
-                color: JamiTheme.tintedBlue
+                    text: textMetricsjamiSlogansText.text
+                    selectByMouse: true
+                    readOnly: true
+                    color: JamiTheme.tintedBlue
 
-                TextMetrics {
-                    id: textMetricsjamiSlogansText
-                    font: jamiSlogansText.font
-                    text: JamiStrings.slogan
+                    TextMetrics {
+                        id: textMetricsjamiSlogansText
+                        font: jamiSlogansText.font
+                        text: JamiStrings.slogan
+                    }
                 }
-            }
 
-            TextEdit {
-                id: jamiVersionText
+                TextEdit {
+                    id: jamiVersionText
 
-                Layout.alignment: Qt.AlignCenter
-                Layout.preferredWidth: aboutPopUpScrollView.width
+                    Layout.alignment: Qt.AlignCenter
+                    Layout.maximumWidth: JamiTheme.preferredDialogWidth - 2*JamiTheme.preferredMarginSize
 
-                font.pixelSize: JamiTheme.tinyCreditsTextSize
+                    font.pixelSize: JamiTheme.tinyCreditsTextSize
 
-                padding: 0
+                    padding: 0
 
-                text: JamiStrings.version + ": " + UtilsAdapter.getVersionStr()
-                selectByMouse: true
-                readOnly: true
-                color: JamiTheme.textColor
+                    text: JamiStrings.version + ": " + UtilsAdapter.getVersionStr()
+                    selectByMouse: true
+                    readOnly: true
+                    color: JamiTheme.textColor
 
-                horizontalAlignment: Text.AlignHCenter
-                verticalAlignment: Text.AlignVCenter
-            }
+                    horizontalAlignment: Text.AlignHCenter
+                    verticalAlignment: Text.AlignVCenter
+                }
 
-            TextEdit {
-                id: jamiDeclarationText
+                TextEdit {
+                    id: jamiDeclarationText
 
-                Layout.alignment: Qt.AlignCenter
-                Layout.preferredWidth: aboutPopUpScrollView.width - JamiTheme.preferredMarginSize * 2
-                Layout.topMargin: 15
+                    Layout.alignment: Qt.AlignCenter
+                    Layout.maximumWidth: JamiTheme.preferredDialogWidth - 2*JamiTheme.preferredMarginSize
+                    Layout.topMargin: 15
 
-                wrapMode: Text.WordWrap
-                font.pixelSize: JamiTheme.creditsTextSize
-                color: JamiTheme.textColor
+                    wrapMode: Text.WordWrap
+                    font.pixelSize: JamiTheme.creditsTextSize
+                    color: JamiTheme.textColor
 
-                horizontalAlignment: Text.AlignHCenter
-                verticalAlignment: Text.AlignVCenter
+                    horizontalAlignment: Text.AlignHCenter
+                    verticalAlignment: Text.AlignVCenter
 
-                // TextMetrics does not work for multi-line.
-                text: JamiStrings.declaration
-                selectByMouse: true
-                readOnly: true
-            }
+                    // TextMetrics does not work for multi-line.
+                    text: JamiStrings.declaration
+                    selectByMouse: true
+                    readOnly: true
+                }
 
-            TextEdit {
-                id: jamiDeclarationHyperText
+                TextEdit {
+                    id: jamiDeclarationHyperText
 
-                Layout.alignment: Qt.AlignCenter
+                    Layout.alignment: Qt.AlignCenter
 
-                // Strangely, hoveredLink works badly when width grows too large
-                Layout.preferredWidth: 50
-                Layout.topMargin: 15
+                    // Strangely, hoveredLink works badly when width grows too large
+                    Layout.maximumWidth: JamiTheme.preferredDialogWidth - 2*JamiTheme.preferredMarginSize
+                    Layout.topMargin: 15
 
-                color: JamiTheme.textColor
+                    color: JamiTheme.textColor
 
-                font.pixelSize: JamiTheme.creditsTextSize
-                horizontalAlignment: Text.AlignHCenter
-                verticalAlignment: Text.AlignVCenter
+                    font.pixelSize: JamiTheme.creditsTextSize
+                    horizontalAlignment: Text.AlignHCenter
+                    verticalAlignment: Text.AlignVCenter
 
-                text: textMetricsjamiDeclarationHyperText.text
-                textFormat: TextEdit.RichText
-                selectByMouse: true
-                readOnly: true
-                onLinkActivated: Qt.openUrlExternally(link)
+                    text: textMetricsjamiDeclarationHyperText.text
+                    textFormat: TextEdit.RichText
+                    selectByMouse: true
+                    readOnly: true
+                    onLinkActivated: Qt.openUrlExternally(link)
 
-                TextMetrics {
-                    id: textMetricsjamiDeclarationHyperText
-                    font: jamiDeclarationHyperText.font
-                    text: '<a href="https://jami.net" style="color: ' + JamiTheme.blueLinkColor + '">jami.net</a>'
-                }
+                    TextMetrics {
+                        id: textMetricsjamiDeclarationHyperText
+                        font: jamiDeclarationHyperText.font
+                        text: '<a href="https://jami.net" style="color: ' + JamiTheme.blueLinkColor + '">jami.net</a>'
+                    }
 
-                MouseArea {
-                    anchors.fill: parent
+                    MouseArea {
+                        anchors.fill: parent
 
-                    // We don't want to eat clicks on the Text.
-                    acceptedButtons: Qt.NoButton
-                    cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
+                        // We don't want to eat clicks on the Text.
+                        acceptedButtons: Qt.NoButton
+                        cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
+                    }
                 }
-            }
-
-            TextEdit {
-                id: jamiNoneWarrantyHyperText
-
-                Layout.alignment: Qt.AlignCenter
-                Layout.preferredWidth: Math.min(390, root.width)
-                Layout.topMargin: 15
-                wrapMode: Text.WordWrap
-                font.pixelSize: JamiTheme.tinyCreditsTextSize
-
-                horizontalAlignment: Text.AlignHCenter
-                verticalAlignment: Text.AlignTop
-                color: JamiTheme.textColor
-
-                text: textMetricsjamiNoneWarrantyHyperText.text
-                textFormat: TextEdit.RichText
-                selectByMouse: true
-                readOnly: true
-                onLinkActivated: Qt.openUrlExternally(link)
-
-                TextMetrics {
-                    id: textMetricsjamiNoneWarrantyHyperText
-                    font: jamiDeclarationHyperText.font
-                    text: JamiStrings.declarationYear + " " + '<a href="https://savoirfairelinux.com" style="color: ' + JamiTheme.blueLinkColor + '">Savoir-faire Linux Inc.</a><br>' + 'This program comes with absolutely no warranty. See the <a href="http://www.gnu.org/licenses/gpl-3.0.html" style="color: ' + JamiTheme.blueLinkColor + '">GNU General Public License</a>, version 3 or later for details.'
+
+                TextEdit {
+                    id: jamiNoneWarrantyHyperText
+
+                    Layout.alignment: Qt.AlignCenter
+                    Layout.maximumWidth: JamiTheme.preferredDialogWidth - 2*JamiTheme.preferredMarginSize
+                    Layout.topMargin: 15
+                    wrapMode: Text.WordWrap
+                    font.pixelSize: JamiTheme.tinyCreditsTextSize
+
+                    horizontalAlignment: Text.AlignHCenter
+                    verticalAlignment: Text.AlignTop
+                    color: JamiTheme.textColor
+
+                    text: textMetricsjamiNoneWarrantyHyperText.text
+                    textFormat: TextEdit.RichText
+                    selectByMouse: true
+                    readOnly: true
+                    onLinkActivated: Qt.openUrlExternally(link)
+
+                    TextMetrics {
+                        id: textMetricsjamiNoneWarrantyHyperText
+                        font: jamiDeclarationHyperText.font
+                        text: JamiStrings.declarationYear + " " + '<a href="https://savoirfairelinux.com" style="color: ' + JamiTheme.blueLinkColor + '">Savoir-faire Linux Inc.</a><br>' + 'This program comes with absolutely no warranty. See the <a href="http://www.gnu.org/licenses/gpl-3.0.html" style="color: ' + JamiTheme.blueLinkColor + '">GNU General Public License</a>, version 3 or later for details.'
+                    }
+
+                    MouseArea {
+                        anchors.fill: parent
+                        acceptedButtons: Qt.NoButton
+                        cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
+                    }
                 }
 
-                MouseArea {
-                    anchors.fill: parent
-                    acceptedButtons: Qt.NoButton
-                    cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
+                ProjectCreditsScrollView {
+                    id: projectCreditsScrollView
+                    Layout.alignment: Qt.AlignCenter
+                    Layout.maximumWidth: JamiTheme.preferredDialogWidth - 2*JamiTheme.preferredMarginSize
+                    Layout.preferredHeight: 100
+                    Layout.topMargin: 25
+                    Layout.margins: JamiTheme.preferredMarginSize
                 }
-            }
-
-            ProjectCreditsScrollView {
-                id: projectCreditsScrollView
-                Layout.alignment: Qt.AlignCenter
-                Layout.preferredWidth: aboutPopUpScrollView.width - JamiTheme.preferredMarginSize * 2
-                Layout.preferredHeight: 100
-                Layout.topMargin: 25
-                Layout.margins: JamiTheme.preferredMarginSize
-            }
         }
     }
 }
diff --git a/src/app/mainview/components/ContactPicker.qml b/src/app/mainview/components/ContactPicker.qml
index ca0f8d812..a732924e7 100644
--- a/src/app/mainview/components/ContactPicker.qml
+++ b/src/app/mainview/components/ContactPicker.qml
@@ -28,11 +28,6 @@ BaseModalDialog {
 
     property int type: ContactList.CONFERENCE
 
-    width: Math.min(appWindow.width - 2 * JamiTheme.preferredMarginSize, JamiTheme.preferredDialogWidth)
-    height: Math.min(appWindow.height - 2 * JamiTheme.preferredMarginSize, JamiTheme.preferredDialogHeight)
-
-    padding: 0
-
     title: {
         switch (type) {
         case ContactList.CONFERENCE:
@@ -48,6 +43,8 @@ BaseModalDialog {
 
     popupContent: ColumnLayout {
         id: contactPickerPopupRectColumnLayout
+        anchors.centerIn: parent
+        width: 400
 
         Searchbar {
             id: contactPickerContactSearchBar
@@ -81,8 +78,4 @@ BaseModalDialog {
             }
         }
     }
-
-    onAboutToShow: {
-        contactPickerListView.model = ContactAdapter.getContactSelectableModel(type);
-    }
 }
diff --git a/src/app/mainview/components/DevicesListPopup.qml b/src/app/mainview/components/DevicesListPopup.qml
index 054db9e0b..3c5efabc7 100644
--- a/src/app/mainview/components/DevicesListPopup.qml
+++ b/src/app/mainview/components/DevicesListPopup.qml
@@ -27,44 +27,26 @@ import "../../commoncomponents"
 BaseModalDialog {
     id: root
 
-    width: 488
-    height: 320
-
-    popupContent: Rectangle {
-        id: rect
-
-        color: JamiTheme.transparentColor
-        width: root.width
-
-        PushButton {
-            id: btnCancel
-            imageColor: "grey"
-            normalColor: "transparent"
-            anchors.right: parent.right
-            anchors.top: parent.top
-            anchors.topMargin: 10
-            anchors.rightMargin: 10
-            source: JamiResources.round_close_24dp_svg
-            onClicked: {
-                close();
-            }
-        }
+    width: JamiTheme.secondaryDialogDimension
+
+    title: JamiStrings.defaultCallHost
 
-        ColumnLayout {
+    popupContent: ColumnLayout {
             id: mainLayout
-            anchors.fill: parent
+
+            anchors.centerIn: parent
             anchors.margins: JamiTheme.preferredMarginSize
             spacing: JamiTheme.preferredMarginSize
 
+
             Label {
                 id: informativeLabel
 
                 Layout.alignment: Qt.AlignCenter
-                Layout.fillWidth: true
-                Layout.topMargin: 26
-                wrapMode: Text.WordWrap
-                horizontalAlignment: Text.AlignHCenter
-                verticalAlignment: Text.AlignVCenter
+                Layout.topMargin: JamiTheme.preferredMarginSize
+                Layout.preferredWidth: root.width - 4*JamiTheme.preferredMarginSize
+
+                wrapMode: Text.Wrap
                 text: JamiStrings.chooseHoster
                 color: JamiTheme.primaryForegroundColor
             }
@@ -97,7 +79,7 @@ BaseModalDialog {
                     property bool isCurrent: DeviceName
 
                     implicitWidth: devicesListView.width
-                    width: devicesListView.width
+                    width: root.width - 4*JamiTheme.preferredMarginSize
                     height: 70
 
                     highlighted: ListView.isCurrentItem
@@ -136,7 +118,6 @@ BaseModalDialog {
                         ColumnLayout {
                             id: deviceInfoColumnLayout
 
-                            Layout.fillWidth: true
                             Layout.fillHeight: true
                             Layout.leftMargin: JamiTheme.preferredMarginSize
 
@@ -144,7 +125,6 @@ BaseModalDialog {
                                 id: labelDeviceName
 
                                 Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
-                                Layout.fillWidth: true
 
                                 elide: Text.ElideRight
                                 color: JamiTheme.textColor
@@ -155,7 +135,7 @@ BaseModalDialog {
                                 id: labelDeviceId
 
                                 Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
-                                Layout.fillWidth: true
+                                Layout.preferredWidth: root.width - 200
 
                                 elide: Text.ElideRight
                                 color: JamiTheme.textColor
@@ -175,9 +155,10 @@ BaseModalDialog {
                 }
             }
 
-            RowLayout {
+            ColumnLayout {
+                id: buttonLayout
                 spacing: JamiTheme.preferredMarginSize
-                Layout.preferredWidth: parent.width
+                Layout.preferredWidth: root.width - 240
 
                 MaterialButton {
                     id: chooseBtn
@@ -192,8 +173,8 @@ BaseModalDialog {
 
                     Layout.alignment: Qt.AlignCenter
                     Layout.fillWidth: true
+
                     primary: true
-                    preferredWidth: chooseBtnTextSize.width + 2 * JamiTheme.buttontextWizzardPadding
                     enabled: devicesListView.currentItem
 
                     text: JamiStrings.chooseThisDevice
@@ -220,7 +201,6 @@ BaseModalDialog {
                     Layout.alignment: Qt.AlignCenter
                     Layout.fillWidth: true
                     primary: true
-                    preferredWidth: rmDeviceBtnTextSize.width + 2 * JamiTheme.buttontextWizzardPadding
                     enabled: devicesListView.currentItem
 
                     text: JamiStrings.removeCurrentDevice
@@ -235,4 +215,4 @@ BaseModalDialog {
             }
         }
     }
-}
+
diff --git a/src/app/mainview/components/HostPopup.qml b/src/app/mainview/components/HostPopup.qml
index 23db77e59..b278f87bf 100644
--- a/src/app/mainview/components/HostPopup.qml
+++ b/src/app/mainview/components/HostPopup.qml
@@ -26,45 +26,21 @@ import "../../commoncomponents"
 BaseModalDialog {
     id: root
 
-    width: 488
-    height: 256
-
     property bool isAdmin: {
         var role = UtilsAdapter.getParticipantRole(CurrentAccount.id, CurrentConversation.id, CurrentAccount.uri);
         return role === Member.Role.ADMIN;
     }
 
-    popupContent: Rectangle {
-        id: rect
-
-        color: JamiTheme.transparentColor
-        width: root.width
-
-        PushButton {
-            id: btnCancel
-            imageColor: "grey"
-            normalColor: "transparent"
-            anchors.right: parent.right
-            anchors.top: parent.top
-            anchors.topMargin: 10
-            anchors.rightMargin: 10
-            source: JamiResources.round_close_24dp_svg
-            onClicked: {
-                close();
-            }
-        }
-
-        ColumnLayout {
+    popupContent: ColumnLayout {
             id: mainLayout
-            anchors.fill: parent
-            anchors.margins: JamiTheme.preferredMarginSize
+            spacing: JamiTheme.preferredMarginSize
 
             Label {
                 id: informativeLabel
 
                 Layout.alignment: Qt.AlignCenter
                 Layout.fillWidth: true
-                Layout.topMargin: 26
+                Layout.maximumWidth: root.parent.width - 4*JamiTheme.preferredMarginSize
                 wrapMode: Text.WordWrap
                 horizontalAlignment: Text.AlignHCenter
                 verticalAlignment: Text.AlignVCenter
@@ -77,7 +53,7 @@ BaseModalDialog {
 
                 Layout.alignment: Qt.AlignCenter
 
-                Layout.topMargin: 26
+                Layout.margins: JamiTheme.preferredMarginSize
                 text: isAdmin ? JamiStrings.becomeHostOneCall : JamiStrings.hostThisCall
 
                 onClicked: {
@@ -90,6 +66,7 @@ BaseModalDialog {
                 id: becomeDefaultHostBtn
 
                 Layout.alignment: Qt.AlignCenter
+                Layout.margins: JamiTheme.preferredMarginSize
 
                 text: JamiStrings.becomeDefaultHost
                 toolTipText: JamiStrings.becomeDefaultHost
@@ -105,4 +82,4 @@ BaseModalDialog {
             }
         }
     }
-}
+//}
diff --git a/src/app/mainview/components/UserProfile.qml b/src/app/mainview/components/UserProfile.qml
index fd28e0e50..2f8235c51 100644
--- a/src/app/mainview/components/UserProfile.qml
+++ b/src/app/mainview/components/UserProfile.qml
@@ -24,9 +24,6 @@ import "../../commoncomponents"
 BaseModalDialog {
     id: root
 
-    width: Math.min(appWindow.width - 2 * JamiTheme.preferredMarginSize, JamiTheme.secondaryDialogDimension)
-    height: Math.min(appWindow.height - 2 * JamiTheme.preferredMarginSize, JamiTheme.secondaryDialogDimension)
-
     property string convId
     property string aliasText
     property string registeredNameText
@@ -34,19 +31,11 @@ BaseModalDialog {
 
     property int preferredImgSize: 80
 
-    popupContent: Rectangle {
-        id: userProfileContentRect
-
-        color: JamiTheme.backgroundColor
-        radius: JamiTheme.modalPopupRadius
-        anchors.fill: parent
-
-        GridLayout {
+    popupContent: GridLayout {
             id: userProfileDialogLayout
 
-            anchors.centerIn: parent
-            anchors.fill: parent
             anchors.margins: JamiTheme.preferredMarginSize
+            width: JamiTheme.secondaryDialogDimension
 
             columns: 2
             rows: 6
@@ -89,7 +78,7 @@ BaseModalDialog {
                     id: textMetricsContactAliasText
                     font: contactAlias.font
                     text: aliasText
-                    elideWidth: userProfileContentRect.width - 200
+                    elideWidth: root.width - 200
                     elide: Qt.ElideMiddle
                 }
             }
@@ -142,12 +131,13 @@ BaseModalDialog {
                     id: textMetricsContactDisplayNameText
                     font: contactDisplayName.font
                     text: registeredNameText
-                    elideWidth: userProfileContentRect.width - 200
+                    elideWidth: root.width - 200
                     elide: Qt.ElideMiddle
                 }
             }
 
             Text {
+                id: identifierText
                 Layout.alignment: Qt.AlignRight
                 font.pointSize: JamiTheme.textFontSize
                 text: JamiStrings.identifier
@@ -158,8 +148,8 @@ BaseModalDialog {
                 id: contactId
 
                 Layout.alignment: Qt.AlignLeft
-                Layout.preferredWidth: userProfileContentRect.width - 200
-
+                Layout.preferredWidth: root.width - 250
+                Layout.rightMargin: JamiTheme.preferredMarginSize
                 font.pointSize: JamiTheme.textFontSize
                 font.kerning: true
                 color: JamiTheme.textColor
@@ -167,7 +157,7 @@ BaseModalDialog {
                 readOnly: true
                 selectByMouse: true
 
-                wrapMode: TextEdit.WrapAnywhere
+                wrapMode: Text.Wrap
                 text: idText
 
                 horizontalAlignment: Text.AlignLeft
@@ -194,25 +184,6 @@ BaseModalDialog {
 
                 source: convId !== "" ? "image://qrImage/contact_" + convId : "image://qrImage/contact_" + idText
             }
-
-            MaterialButton {
-                id: btnClose
-
-                Layout.columnSpan: 2
-                Layout.alignment: Qt.AlignHCenter
-
-                preferredWidth: JamiTheme.preferredFieldWidth / 2
-                buttontextHeightMargin: JamiTheme.buttontextHeightMargin
-
-                color: JamiTheme.buttonTintedBlack
-                hoveredColor: JamiTheme.buttonTintedBlackHovered
-                pressedColor: JamiTheme.buttonTintedBlackPressed
-                secondary: true
-
-                text: JamiStrings.close
-
-                onClicked: close()
-            }
         }
     }
-}
+
diff --git a/src/app/mainview/components/WelcomePageQrDialog.qml b/src/app/mainview/components/WelcomePageQrDialog.qml
index 39e925f03..1712941b5 100644
--- a/src/app/mainview/components/WelcomePageQrDialog.qml
+++ b/src/app/mainview/components/WelcomePageQrDialog.qml
@@ -18,26 +18,26 @@
 import QtQuick
 import net.jami.Adapters 1.1
 import net.jami.Constants 1.1
+import QtQuick.Layouts
 import "../../commoncomponents"
 
 BaseModalDialog {
     id: root
 
-    //Content height + margin.
-    property int size: JamiTheme.qrCodeImageSize + 30
-
-    width: size
-    height: size
+    topLayoutVisible: false
 
     backgroundColor: JamiTheme.whiteColor
 
-    popupContentPreferredHeight: JamiTheme.qrCodeImageSize
-    popupContentPreferredWidth: JamiTheme.qrCodeImageSize
     popupContent: Image {
-        id: userQrImage
+            id: userQrImage
+            property int size: JamiTheme.qrCodeImageSize
+            width: size
+            height: size
+            anchors.centerIn: parent
 
-        smooth: false
-        fillMode: Image.PreserveAspectFit
-        source: "image://qrImage/account_" + CurrentAccount.id
+            smooth: false
+            fillMode: Image.PreserveAspectFit
+            source: "image://qrImage/account_" + CurrentAccount.id
     }
 }
+
diff --git a/src/app/settingsview/components/LinkDeviceDialog.qml b/src/app/settingsview/components/LinkDeviceDialog.qml
index 21b7c43ba..3db9f9638 100644
--- a/src/app/settingsview/components/LinkDeviceDialog.qml
+++ b/src/app/settingsview/components/LinkDeviceDialog.qml
@@ -31,9 +31,6 @@ BaseModalDialog {
 
     title: JamiStrings.addDevice
 
-    width: Math.min(appWindow.width - 2 * JamiTheme.preferredMarginSize, JamiTheme.preferredDialogWidth)
-    height: Math.min(appWindow.height - 2 * JamiTheme.preferredMarginSize, JamiTheme.preferredDialogHeight)
-
     popupContent: StackLayout {
         id: stackedWidget
 
@@ -50,7 +47,8 @@ BaseModalDialog {
         function setExportPage(status, pin) {
             if (status === NameDirectory.ExportOnRingStatus.SUCCESS) {
                 infoLabel.success = true;
-                infoLabelsRowLayout.visible = true;
+                yourPinLabel.visible = true;
+                exportedPIN.visible = true;
                 infoLabel.text = JamiStrings.pinTimerInfos;
                 exportedPIN.text = pin;
             } else {
@@ -69,6 +67,7 @@ BaseModalDialog {
                 }
             }
             stackedWidget.currentIndex = exportingInfoPage.pageIndex;
+            stackedWidget.height = exportingLayout.implicitHeight;
         }
 
         Timer {
@@ -109,12 +108,11 @@ BaseModalDialog {
             readonly property int pageIndex: 0
 
             ColumnLayout {
-                anchors.fill: parent
-
-                spacing: 16
+                spacing: JamiTheme.preferredMarginSize
+                anchors.centerIn: parent
 
                 Label {
-                    Layout.alignment: Qt.AlignHCenter
+                    Layout.alignment: Qt.AlignCenter
 
                     text: JamiStrings.enterAccountPassword
                     color: JamiTheme.textColor
@@ -147,7 +145,7 @@ BaseModalDialog {
 
                 RowLayout {
                     Layout.alignment: Qt.AlignCenter
-                    Layout.fillWidth: true
+                    Layout.bottomMargin: JamiTheme.preferredMarginSize
                     spacing: 16
 
                     MaterialButton {
@@ -200,9 +198,10 @@ BaseModalDialog {
             readonly property int pageIndex: 1
 
             ColumnLayout {
-                anchors.fill: parent
+                id: spinnerLayout
 
-                spacing: 16
+                spacing: JamiTheme.preferredMarginSize
+                anchors.centerIn: parent
 
                 Label {
                     Layout.alignment: Qt.AlignCenter
@@ -237,51 +236,45 @@ BaseModalDialog {
 
             readonly property int pageIndex: 2
 
-            ColumnLayout {
-                anchors.fill: parent
+            width: childrenRect.width
+            height: childrenRect.height
+
+            onHeightChanged: {
+                stackedWidget.height = exportingLayout.implicitHeight
+            }
 
-                spacing: 16
+            ColumnLayout {
+                id: exportingLayout
 
-                Item {
-                    id: infoLabelsRowLayout
+                Label {
+                    id: yourPinLabel
 
                     Layout.alignment: Qt.AlignCenter
-                    Layout.margins: JamiTheme.preferredMarginSize
-                    Layout.preferredWidth: yourPinLabel.contentWidth + exportedPIN.contentWidth + 5
-                    Label {
-                        id: yourPinLabel
-
-                        anchors.left: infoLabelsRowLayout.left
-                        anchors.verticalCenter: infoLabelsRowLayout.verticalCenter
-
-                        text: JamiStrings.yourPinIs
-                        color: JamiTheme.textColor
-                        font.pointSize: JamiTheme.headerFontSize
-                        font.kerning: true
-                        horizontalAlignment: Text.AlignHCenter
-                        verticalAlignment: Text.AlignVCenter
-                    }
 
-                    MaterialLineEdit {
-                        id: exportedPIN
+                    text: JamiStrings.yourPinIs
+                    color: JamiTheme.textColor
+                    font.pointSize: JamiTheme.headerFontSize
+                    font.kerning: true
+                    horizontalAlignment: Text.AlignHCenter
+                    verticalAlignment: Text.AlignVCenter
+                }
 
-                        anchors.left: yourPinLabel.right
-                        anchors.leftMargin: 5
-                        anchors.verticalCenter: infoLabelsRowLayout.verticalCenter
+                MaterialLineEdit {
+                    id: exportedPIN
 
-                        padding: 0
+                    padding: 0
+                    Layout.alignment: Qt.AlignCenter
 
-                        text: JamiStrings.pin
-                        wrapMode: Text.NoWrap
+                    text: JamiStrings.pin
+                    wrapMode: Text.NoWrap
 
-                        color: JamiTheme.textColor
-                        selectByMouse: true
-                        readOnly: true
-                        font.pointSize: JamiTheme.headerFontSize
-                        font.kerning: true
-                        horizontalAlignment: Text.AlignHCenter
-                        verticalAlignment: Text.AlignVCenter
-                    }
+                    color: JamiTheme.textColor
+                    selectByMouse: true
+                    readOnly: true
+                    font.pointSize: JamiTheme.headerFontSize
+                    font.kerning: true
+                    horizontalAlignment: Text.AlignHCenter
+                    verticalAlignment: Text.AlignVCenter
                 }
 
                 Label {
@@ -293,7 +286,8 @@ BaseModalDialog {
                     property string backgroundColor: success ? "whitesmoke" : "transparent"
                     property string borderColor: success ? "lightgray" : "transparent"
 
-                    Layout.maximumWidth: stackedWidget.width - JamiTheme.preferredMarginSize * 2
+                    Layout.maximumWidth: JamiTheme.preferredDialogWidth
+                    Layout.margins: JamiTheme.preferredMarginSize
 
                     Layout.alignment: Qt.AlignCenter
 
@@ -316,30 +310,6 @@ BaseModalDialog {
                         color: JamiTheme.secondaryBackgroundColor
                     }
                 }
-
-                MaterialButton {
-                    id: btnCloseExportDialog
-
-                    Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
-                    Layout.bottomMargin: JamiTheme.preferredMarginSize
-
-                    preferredWidth: JamiTheme.preferredFieldWidth / 2 - 8
-                    buttontextHeightMargin: JamiTheme.buttontextHeightMargin
-
-                    color: enabled ? JamiTheme.buttonTintedBlack : JamiTheme.buttonTintedGrey
-                    hoveredColor: JamiTheme.buttonTintedBlackHovered
-                    pressedColor: JamiTheme.buttonTintedBlackPressed
-                    secondary: true
-                    enabled: true
-
-                    text: JamiStrings.close
-
-                    onClicked: {
-                        if (infoLabel.success)
-                            accepted();
-                        close();
-                    }
-                }
             }
         }
     }
diff --git a/src/app/settingsview/components/NameRegistrationDialog.qml b/src/app/settingsview/components/NameRegistrationDialog.qml
index a54a6f092..f596b11fe 100644
--- a/src/app/settingsview/components/NameRegistrationDialog.qml
+++ b/src/app/settingsview/components/NameRegistrationDialog.qml
@@ -31,14 +31,13 @@ BaseModalDialog {
 
     signal accepted
 
-    width: Math.min(appWindow.width - 2 * JamiTheme.preferredMarginSize, JamiTheme.preferredDialogWidth)
-    height: Math.min(appWindow.height - 2 * JamiTheme.preferredMarginSize, JamiTheme.preferredDialogHeight)
-
     title: JamiStrings.setUsername
 
     popupContent: StackLayout {
         id: stackedWidget
 
+        width: children[currentIndex].width
+
         function startRegistration() {
             stackedWidget.currentIndex = nameRegisterSpinnerPage.pageIndex;
             spinnerMovie.visible = true;
@@ -97,8 +96,10 @@ BaseModalDialog {
 
             readonly property int pageIndex: 0
 
+            width: childrenRect.width
+            height: childrenRect.height
+
             ColumnLayout {
-                anchors.fill: parent
 
                 spacing: 16
 
@@ -179,8 +180,10 @@ BaseModalDialog {
 
             readonly property int pageIndex: 1
 
+            width: childrenRect.width
+            height: childrenRect.height
+
             ColumnLayout {
-                anchors.fill: parent
 
                 spacing: 16
 
@@ -217,8 +220,10 @@ BaseModalDialog {
 
             readonly property int pageIndex: 2
 
+            width: childrenRect.width
+            height: childrenRect.height
+
             ColumnLayout {
-                anchors.fill: parent
 
                 spacing: 16
 
diff --git a/src/app/settingsview/components/RevokeDevicePasswordDialog.qml b/src/app/settingsview/components/RevokeDevicePasswordDialog.qml
index 112b74fe5..aae59f874 100644
--- a/src/app/settingsview/components/RevokeDevicePasswordDialog.qml
+++ b/src/app/settingsview/components/RevokeDevicePasswordDialog.qml
@@ -28,9 +28,6 @@ BaseModalDialog {
 
     required property string deviceId
 
-    width: Math.min(appWindow.width - 2 * JamiTheme.preferredMarginSize, JamiTheme.preferredDialogWidth)
-    height: Math.min(appWindow.height - 2 * JamiTheme.preferredMarginSize, JamiTheme.preferredDialogHeight)
-
     title: JamiStrings.removeDevice
 
     popupContent: ColumnLayout {
@@ -42,7 +39,7 @@ BaseModalDialog {
             id: labelDeletion
 
             Layout.alignment: Qt.AlignHCenter
-            Layout.preferredWidth: revokeDeviceContentColumnLayout.width - JamiTheme.preferredMarginSize * 2
+            Layout.maximumWidth: root.parent.width - JamiTheme.preferredMarginSize * 4
 
             text: JamiStrings.confirmRemoval
             color: JamiTheme.textColor
-- 
GitLab