From 7154428d26f0b187be3f19caac92cbddad0afce8 Mon Sep 17 00:00:00 2001 From: aiamnezia Date: Wed, 3 Sep 2025 07:58:36 +0400 Subject: [PATCH] fix: sharing QR code size (#1830) --- client/ui/qml/Pages2/PageSettingsApiSubscriptionKey.qml | 8 ++++++-- client/ui/qml/Pages2/PageShareConnection.qml | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/client/ui/qml/Pages2/PageSettingsApiSubscriptionKey.qml b/client/ui/qml/Pages2/PageSettingsApiSubscriptionKey.qml index 23f9706a..2ad818ea 100644 --- a/client/ui/qml/Pages2/PageSettingsApiSubscriptionKey.qml +++ b/client/ui/qml/Pages2/PageSettingsApiSubscriptionKey.qml @@ -119,8 +119,9 @@ PageType { } Rectangle { - Layout.fillWidth: true - Layout.preferredHeight: width + Layout.preferredWidth: Math.min(Math.min(root.width - (Layout.leftMargin + Layout.rightMargin), root.height * 0.5), 360) + Layout.preferredHeight: Layout.preferredWidth + Layout.alignment: Qt.AlignHCenter Layout.topMargin: 20 Layout.leftMargin: 16 Layout.rightMargin: 16 @@ -132,6 +133,9 @@ PageType { Image { anchors.fill: parent smooth: false + fillMode: Image.PreserveAspectFit + sourceSize.width: parent.width + sourceSize.height: parent.height source: ApiConfigsController.qrCodesCount > 0 && ApiConfigsController.qrCodes[0] ? ApiConfigsController.qrCodes[0] : "" } } diff --git a/client/ui/qml/Pages2/PageShareConnection.qml b/client/ui/qml/Pages2/PageShareConnection.qml index efac6a8d..8e56dac5 100644 --- a/client/ui/qml/Pages2/PageShareConnection.qml +++ b/client/ui/qml/Pages2/PageShareConnection.qml @@ -269,8 +269,9 @@ PageType { Rectangle { id: qrCodeContainer - Layout.fillWidth: true - Layout.preferredHeight: width + Layout.preferredWidth: Math.min(Math.min(listView.width - (Layout.leftMargin + Layout.rightMargin), pageShareConnection.height * 0.5), 360) + Layout.preferredHeight: Layout.preferredWidth + Layout.alignment: Qt.AlignHCenter Layout.topMargin: 20 Layout.leftMargin: 16 Layout.rightMargin: 16 @@ -280,6 +281,9 @@ PageType { Image { anchors.fill: parent smooth: false + fillMode: Image.PreserveAspectFit + sourceSize.width: parent.width + sourceSize.height: parent.height source: pageShareConnection.isSelfHostedConfig ? (isQrCodeVisible ? ExportController.qrCodes[0] : "") : (isQrCodeVisible ? ApiConfigsController.qrCodes[0] : "") property bool isFocusable: true Keys.onTabPressed: FocusController.nextKeyTabItem()