diff --git a/src/MainApplicationWindow.qml b/src/MainApplicationWindow.qml index 9dd2360b3eca41866bb5628e7b13973e9670cda6..0011976b8049b24e487a474dd56d21430885f3d2 100644 --- a/src/MainApplicationWindow.qml +++ b/src/MainApplicationWindow.qml @@ -215,16 +215,12 @@ ApplicationWindow { onClosing: root.close() - onScreenChanged: JamiQmlUtils.mainApplicationScreen = root.screen - Component.onCompleted: { if (CurrentAccountToMigrate.accountToMigrateListSize <= 0) startClient() else startAccountMigration() - JamiQmlUtils.mainApplicationScreen = root.screen - if (Qt.platform.os.toString() !== "windows" && Qt.platform.os.toString() !== "osx") DBusErrorHandler.setActive(true) } diff --git a/src/constant/JamiQmlUtils.qml b/src/constant/JamiQmlUtils.qml index 4863b8a8daaba6d4a993e76ba924368028bc5408..d3cba9806d49db1f9f1f110312e65ee4b30a85d3 100644 --- a/src/constant/JamiQmlUtils.qml +++ b/src/constant/JamiQmlUtils.qml @@ -31,8 +31,6 @@ Item { readonly property string accountMigrationViewLoadPath: "qrc:/src/AccountMigrationView.qml" readonly property string base64StringTitle: "data:image/png;base64," - property var mainApplicationScreen: "" - property var accountCreationInputParaObject: ({}) function setUpAccountCreationInputPara(inputPara) { diff --git a/src/constant/JamiTheme.qml b/src/constant/JamiTheme.qml index 9c5a628990ec6a8cbcdce14c82e8b03b57870895..701874871291a32d032e1576f213a5d3b216d112 100644 --- a/src/constant/JamiTheme.qml +++ b/src/constant/JamiTheme.qml @@ -271,6 +271,7 @@ Item { property real minimumPreviewWidth: 120 property real pluginHandlersPopupViewHeight: 200 property real pluginHandlersPopupViewDelegateHeight: 50 + property real secondaryDialogDimension: 500 property real lineEditContextMenuItemsHeight: 15 property real lineEditContextMenuItemsWidth: 100 diff --git a/src/mainview/MainView.qml b/src/mainview/MainView.qml index e9342ecd7c928691071cf88db960198c41b0493f..0c1191242b9aa4b00fe05b959f40b4a3a1bda74d 100644 --- a/src/mainview/MainView.qml +++ b/src/mainview/MainView.qml @@ -449,13 +449,8 @@ Rectangle { AboutPopUp { id: aboutPopUpDialog - - onVisibleChanged: { - height = Qt.binding(function () { - return Math.min(preferredHeight, - mainView.height - JamiTheme.preferredMarginSize * 2) - }) - } + width: Math.min(mainView.width - 2 * JamiTheme.preferredMarginSize, JamiTheme.secondaryDialogDimension) + height: Math.min(mainView.height - 2 * JamiTheme.preferredMarginSize, JamiTheme.secondaryDialogDimension) } WelcomePageQrDialog { @@ -464,6 +459,8 @@ Rectangle { UserProfile { id: userProfile + width: Math.min(mainView.width - 2 * JamiTheme.preferredMarginSize, JamiTheme.secondaryDialogDimension) + height: Math.min(mainView.height - 2 * JamiTheme.preferredMarginSize, JamiTheme.secondaryDialogDimension) } Shortcut { diff --git a/src/mainview/components/AboutPopUp.qml b/src/mainview/components/AboutPopUp.qml index 6b5cd98fd7a77ecc3fbbb3d019b9f7f43b0ae0b4..8bfa16a20bedd37bf802d430e49372a67d5cbd2b 100644 --- a/src/mainview/components/AboutPopUp.qml +++ b/src/mainview/components/AboutPopUp.qml @@ -29,26 +29,16 @@ import "../../commoncomponents" BaseModalDialog { id: root - property int preferredHeight: 0 - - width: 400 - - onPopupContentLoadStatusChanged: { - if (popupContentLoadStatus === Loader.Ready) - preferredHeight = Qt.binding(function() { - return popupContentLoader.item.contentHeight - }) - } - popupContent: JamiFlickable { id: aboutPopUpScrollView contentHeight: aboutPopUpContentRectColumnLayout.implicitHeight + width: root.width ColumnLayout { id: aboutPopUpContentRectColumnLayout - width: Math.max(root.width, implicitWidth) + width: root.width height: Math.max(aboutPopUpScrollView.height, implicitHeight) ResponsiveImage { diff --git a/src/mainview/components/CallOverlay.qml b/src/mainview/components/CallOverlay.qml index a55e1f7ed64ba5039fbe14b081c4ad82658eca70..3ac6addda89faf6cb221c333e4fb1d54bb9b19d1 100644 --- a/src/mainview/components/CallOverlay.qml +++ b/src/mainview/components/CallOverlay.qml @@ -160,7 +160,7 @@ Item { if (Qt.application.screens.length === 1) { AvAdapter.shareEntireScreen(0) } else { - SelectScreenWindowCreation.createSelectScreenWindowObject(JamiQmlUtils.mainApplicationScreen) + SelectScreenWindowCreation.createSelectScreenWindowObject(appWindow) SelectScreenWindowCreation.showSelectScreenWindow(callPreviewId, false) } } @@ -169,7 +169,7 @@ Item { AvAdapter.muteCamera = !sharingActive && root.isVideoMuted AvAdapter.getListWindows() if (AvAdapter.windowsNames.length >= 1) { - SelectScreenWindowCreation.createSelectScreenWindowObject(JamiQmlUtils.mainApplicationScreen) + SelectScreenWindowCreation.createSelectScreenWindowObject(appWindow) SelectScreenWindowCreation.showSelectScreenWindow(callPreviewId, true) } } diff --git a/src/mainview/components/SelectScreen.qml b/src/mainview/components/SelectScreen.qml index a77a2666f0e1091f5ec77206531010b68a24ef59..ff86aa82c046524616307868b437085e2520637b 100644 --- a/src/mainview/components/SelectScreen.qml +++ b/src/mainview/components/SelectScreen.qml @@ -35,15 +35,17 @@ import "../../commoncomponents" Window { id: root - property int minWidth: 650 - property int minHeight: 500 - property bool window: false property int selectedScreenNumber: -1 property bool selectAllScreens: false property string currentPreview: "" property var screens: [] + property real componentMinWidth: 200 + property real componentWidthDoubleColumn: screenSelectionScrollView.width / 2 - + screenSelectionScrollViewFlow.spacing / 2 - JamiTheme.preferredMarginSize + property real componentWidthSingleColumn: screenSelectionScrollView.width - + 2 * JamiTheme.preferredMarginSize modality: Qt.ApplicationModal title: window ? JamiStrings.selectWindow : JamiStrings.selectScreen @@ -75,11 +77,6 @@ Window { screenInfo2.model = screens.length windowsText.visible = root.window } - minimumWidth: minWidth - minimumHeight: minHeight - - width: minWidth - height: minHeight Rectangle { id: selectScreenWindowRect @@ -110,7 +107,7 @@ Window { rightPadding: JamiTheme.preferredMarginSize leftPadding: JamiTheme.preferredMarginSize - spacing: 10 + spacing: JamiTheme.preferredMarginSize Text { width: screenSelectionScrollView.width @@ -134,8 +131,7 @@ Window { color: JamiTheme.secondaryBackgroundColor - width: screenSelectionScrollView.width / 2 - - screenSelectionScrollViewFlow.spacing / 2 - JamiTheme.preferredMarginSize + width: componentWidthDoubleColumn > componentMinWidth ? componentWidthDoubleColumn : componentWidthSingleColumn height: 3 * width / 4 border.color: selectedScreenNumber === index ? JamiTheme.screenSelectionBorderColor : JamiTheme.tabbarBorderColor @@ -208,8 +204,7 @@ Window { color: JamiTheme.secondaryBackgroundColor - width: screenSelectionScrollView.width / 2 - - screenSelectionScrollViewFlow.spacing / 2 - JamiTheme.preferredMarginSize + width: componentWidthDoubleColumn > componentMinWidth ? componentWidthDoubleColumn : componentWidthSingleColumn height: 3 * width / 4 border.color: selectAllScreens ? JamiTheme.screenSelectionBorderColor : JamiTheme.tabbarBorderColor @@ -286,8 +281,7 @@ Window { color: JamiTheme.secondaryBackgroundColor - width: screenSelectionScrollView.width / 2 - - screenSelectionScrollViewFlow.spacing / 2 - JamiTheme.preferredMarginSize + width: componentWidthDoubleColumn > componentMinWidth ? componentWidthDoubleColumn : componentWidthSingleColumn height: 3 * width / 4 border.color: selectedScreenNumber === index ? JamiTheme.screenSelectionBorderColor : JamiTheme.tabbarBorderColor @@ -356,14 +350,17 @@ Window { anchors.bottomMargin: JamiTheme.preferredMarginSize anchors.horizontalCenter: selectScreenWindowRect.horizontalCenter - width: childrenRect.width + width: parent.width height: childrenRect.height spacing: JamiTheme.preferredMarginSize MaterialButton { id: selectButton - preferredWidth: 200 + Layout.maximumWidth: 200 + Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter + Layout.leftMargin: JamiTheme.preferredMarginSize enabled: selectedScreenNumber != -1 || selectAllScreens opacity: enabled ? 1.0 : 0.5 @@ -392,7 +389,10 @@ Window { MaterialButton { id: cancelButton - preferredWidth: 200 + Layout.maximumWidth: 200 + Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter + Layout.rightMargin: JamiTheme.preferredMarginSize color: JamiTheme.buttonTintedBlack hoveredColor: JamiTheme.buttonTintedBlackHovered diff --git a/src/mainview/components/UserProfile.qml b/src/mainview/components/UserProfile.qml index 106cb5218871a3e5accda7df96ce82ec4dbfd148..f2b4d492e78111381e392457f987c649f6ec0563 100644 --- a/src/mainview/components/UserProfile.qml +++ b/src/mainview/components/UserProfile.qml @@ -35,14 +35,12 @@ BaseModalDialog { property int preferredImgSize: 80 - width: 480 - height: 480 - popupContent: Rectangle { id: userProfileContentRect color: JamiTheme.backgroundColor radius: JamiTheme.modalPopupRadius + anchors.fill: parent GridLayout { id: userProfileDialogLayout @@ -160,6 +158,7 @@ BaseModalDialog { id: contactId Layout.alignment: Qt.AlignLeft + width: userProfileContentRect.width - 200 font.pointSize: JamiTheme.textFontSize font.kerning: true @@ -169,19 +168,11 @@ BaseModalDialog { readOnly: true selectByMouse: true - wrapMode: Text.NoWrap - text: textMetricsContactIdText.elidedText + wrapMode: Text.WrapAnywhere + text: idText horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter - - TextMetrics { - id: textMetricsContactIdText - font: contactId.font - text: idText - elideWidth: userProfileContentRect.width - 200 - elide: Qt.ElideMiddle - } } Text { diff --git a/src/mainview/js/selectscreenwindowcreation.js b/src/mainview/js/selectscreenwindowcreation.js index 42766a8cfff60aea54c6a6758133e1e326e77697..dd8a3664ee3594e8900e685a353d4d88d1b203f9 100644 --- a/src/mainview/js/selectscreenwindowcreation.js +++ b/src/mainview/js/selectscreenwindowcreation.js @@ -19,13 +19,14 @@ // Global select screen window component, object variable for creation. var selectScreenWindowComponent var selectScreenWindowObject +var mainWindow -function createSelectScreenWindowObject(providedScreen) { +function createSelectScreenWindowObject(appWindow) { if (selectScreenWindowObject) return selectScreenWindowComponent = Qt.createComponent( "../components/SelectScreen.qml") - selectScreenWindowComponent.screen = providedScreen + mainWindow = appWindow if (selectScreenWindowComponent.status === Component.Ready) finishCreation() else if (selectScreenWindowComponent.status === Component.Error) @@ -49,11 +50,13 @@ function showSelectScreenWindow(previewId, window) { selectScreenWindowObject.window = window selectScreenWindowObject.show() - var screen = selectScreenWindowComponent.screen - selectScreenWindowObject.x = screen.virtualX + - (screen.width - selectScreenWindowObject.width) / 2 - selectScreenWindowObject.y = screen.virtualY + - (screen.height - selectScreenWindowObject.height) / 2 + var centerX = mainWindow.x + mainWindow.width / 2 + var centerY = mainWindow.y + mainWindow.height / 2 + + selectScreenWindowObject.width = 0.75 * appWindow.width + selectScreenWindowObject.height = 0.75 * appWindow.height + selectScreenWindowObject.x = centerX - selectScreenWindowObject.width / 2 + selectScreenWindowObject.y = centerY - selectScreenWindowObject.height / 2 } // Destroy and reset selectScreenWindowObject when window is closed.