fix: sharing QR code size (#1830)

This commit is contained in:
aiamnezia
2025-09-03 07:58:36 +04:00
committed by GitHub
parent 02a52d0169
commit 7154428d26
2 changed files with 12 additions and 4 deletions

View File

@@ -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] : ""
}
}

View File

@@ -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()