Commit 6c0fb343 authored by Volker Krause's avatar Volker Krause

Fix aspect ratio for 1D barcodes

parent 4908b5f5
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
import QtQuick 2.5 import QtQuick 2.5
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Controls 2.1 as QQC2 import QtQuick.Controls 2.1 as QQC2
import QtQuick.Window 2.10
import org.kde.kirigami 2.0 as Kirigami import org.kde.kirigami 2.0 as Kirigami
import org.kde.prison 1.0 as Prison import org.kde.prison 1.0 as Prison
import org.kde.kitinerary 1.0 import org.kde.kitinerary 1.0
...@@ -61,9 +62,9 @@ ColumnLayout { ...@@ -61,9 +62,9 @@ ColumnLayout {
anchors.top: barcodeContainer.top anchors.top: barcodeContainer.top
anchors.bottom: barcodeContainer.bottom anchors.bottom: barcodeContainer.bottom
color: "white" color: "white"
property bool is1dCode: currentTicket.ticketTokenType == Ticket.Code128
implicitWidth: Math.max(root.width * 0.8, barcode.implicitWidth + barcode.anchors.margins * 2) implicitWidth: Math.max(root.width * 0.8, barcode.implicitWidth + barcode.anchors.margins * 2)
// ### we assume aspect ratio 1:1 here, which is correct for QR and Aztec only implicitHeight: visible ? is1dCode ? Screen.pixelDensity * 25 : implicitWidth : 0
implicitHeight: visible ? implicitWidth : 0
visible: barcode.implicitHeight > 0 visible: barcode.implicitHeight > 0
MouseArea { MouseArea {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment