Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Itinerary
Commits
21db2624
Commit
21db2624
authored
Apr 22, 2022
by
Volker Krause
Browse files
Support all barcode formats specified in pkpass files
Also, fix an invalid reference for the size computation.
parent
1e417ec1
Pipeline
#166891
passed with stage
in 1 minute and 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/app/PkPassBarcode.qml
View file @
21db2624
...
...
@@ -11,6 +11,7 @@ import org.kde.pkpass 1.0 as KPkPass
import
org
.
kde
.
prison
1.0
as
Prison
Rectangle
{
id
:
root
property
var
pass
implicitHeight
:
barcodeLayout
.
implicitHeight
...
...
@@ -25,9 +26,17 @@ Rectangle {
Prison.Barcode
{
Layout.alignment
:
Qt
.
AlignCenter
Layout.margins
:
4
Layout.preferredWidth
:
Math
.
max
(
implicitWidth
,
0.8
*
bodyBackground
.
width
)
Layout.preferredHeight
:
Layout
.
preferredWidth
barcodeType
:
pass
.
barcodes
[
0
].
format
==
KPkPass
.
Barcode
.
QR
?
Prison
.
Barcode
.
QRCode
:
Prison
.
Barcode
.
Aztec
Layout.preferredWidth
:
0.8
*
root
.
parent
.
width
Layout.preferredHeight
:
implicitHeight
*
(
Layout
.
preferredWidth
/
implicitWidth
)
barcodeType
:
{
switch
(
pass
.
barcodes
[
0
].
format
)
{
case
KPkPass
.
Barcode
.
QR
:
return
Prison
.
Barcode
.
QRCode
case
KPkPass
.
Barcode
.
Aztec
:
return
Prison
.
Barcode
.
Aztec
case
KPkPass
.
Barcode
.
PDF417
:
return
Prison
.
Barcode
.
PDF417
;
case
KPkPass
.
Barcode
.
Code128
:
return
Prison
.
Barcode
.
Code128
;
}
return
Prison
.
Barcode
.
Null
;
}
content
:
pass
.
barcodes
[
0
].
message
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment