Skip to content

Commit

Permalink
Performance optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Jul 27, 2024
1 parent d816870 commit 0c5205c
Show file tree
Hide file tree
Showing 17 changed files with 91 additions and 53 deletions.
3 changes: 1 addition & 2 deletions qml/MobileHeader.qml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ Rectangle {
onClicked: leftMenuClicked()

RippleThemed {
anchors.fill: parent
anchor: parent
width: parent.width
height: parent.height

pressed: parent.pressed
//active: enabled && parent.down
Expand Down
27 changes: 9 additions & 18 deletions qml/MobilePermissions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ Item {

////////

Item {
id: element_network
Item { // element_network
anchors.left: parent.left
anchors.right: parent.right
height: 20
Expand All @@ -92,8 +91,7 @@ Item {
}
}

Text {
id: text_network
Text { // text_network
anchors.left: parent.left
anchors.leftMargin: 64
anchors.right: parent.right
Expand All @@ -109,8 +107,7 @@ Item {
verticalAlignment: Text.AlignVCenter
}
}
Text {
id: legend_network
Text { // legend_network
anchors.left: parent.left
anchors.leftMargin: 64
anchors.right: parent.right
Expand All @@ -125,8 +122,7 @@ Item {

////////

Item {
id: element_camera
Item { // element_camera
anchors.left: parent.left
anchors.right: parent.right
height: 20
Expand Down Expand Up @@ -154,8 +150,7 @@ Item {
}
}

Text {
id: text_camera
Text { // text_camera
anchors.left: parent.left
anchors.leftMargin: 64
anchors.right: parent.right
Expand All @@ -171,8 +166,7 @@ Item {
verticalAlignment: Text.AlignVCenter
}
}
Text {
id: legend_camera
Text { // legend_camera
anchors.left: parent.left
anchors.leftMargin: 64
anchors.right: parent.right
Expand All @@ -187,8 +181,7 @@ Item {

////////

Item {
id: element_position
Item { // element_position
anchors.left: parent.left
anchors.right: parent.right
height: 20
Expand All @@ -215,8 +208,7 @@ Item {
}
}

Text {
id: text_position
Text { // text_position
anchors.left: parent.left
anchors.leftMargin: 64
anchors.right: parent.right
Expand All @@ -232,8 +224,7 @@ Item {
verticalAlignment: Text.AlignVCenter
}
}
Text {
id: legend_position
Text { // legend_position
anchors.left: parent.left
anchors.leftMargin: 64
anchors.right: parent.right
Expand Down
35 changes: 27 additions & 8 deletions qml/ScreenAbout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Loader {
}
Text {
text: qsTr("version %1 %2").arg(utilsApp.appVersion()).arg(utilsApp.appBuildMode())
textFormat: Text.PlainText
color: Theme.colorSubText
font.pixelSize: Theme.fontSizeContentBig
}
Expand Down Expand Up @@ -197,13 +198,16 @@ Loader {
////////////////

ListItem { // description
width: parent.width
anchors.left: parent.left
anchors.right: parent.right

text: qsTr("Barcode & QRcode scanner reader/writer based on qzxing and zxing-cpp libraries.")
source: "qrc:/assets/icons/material-symbols/info.svg"
}

ListItemClickable { // authors
width: parent.width
anchors.left: parent.left
anchors.right: parent.right

text: qsTr("Application by <a href=\"https://emeric.io\">Emeric Grange</a>")
source: "qrc:/assets/icons/material-symbols/supervised_user_circle.svg"
Expand All @@ -213,7 +217,9 @@ Loader {
}

ListItemClickable { // rate
width: parent.width
anchors.left: parent.left
anchors.right: parent.right

visible: (Qt.platform.os === "android" || Qt.platform.os === "ios")

text: qsTr("Rate the application")
Expand All @@ -231,7 +237,8 @@ Loader {
}

ListItemClickable { // release notes
width: parent.width
anchors.left: parent.left
anchors.right: parent.right

text: qsTr("Release notes")
source: "qrc:/assets/icons/material-symbols/new_releases.svg"
Expand All @@ -246,7 +253,8 @@ Loader {
ListSeparator { }

ListItemClickable { // tutorial
width: parent.width
anchors.left: parent.left
anchors.right: parent.right

text: qsTr("Open the tutorial")
source: "qrc:/assets/icons/material-symbols/import_contacts-fill.svg"
Expand All @@ -261,7 +269,9 @@ Loader {
ListSeparator { visible: (Qt.platform.os === "android" || Qt.platform.os === "ios") }

ListItemClickable { // permissions
width: parent.width
anchors.left: parent.left
anchors.right: parent.right

visible: (Qt.platform.os === "android" || Qt.platform.os === "ios")

text: qsTr("About app permissions")
Expand All @@ -275,7 +285,8 @@ Loader {
ListSeparator { }

ListItemClickable { // supported formats
width: parent.width
anchors.left: parent.left
anchors.right: parent.right

text: qsTr("Supported barcode formats")
source: "qrc:/assets/icons/material-symbols/check_circle.svg"
Expand Down Expand Up @@ -345,7 +356,9 @@ Loader {
"Google Material Icons (MIT)",
]
delegate: Text {
width: parent.width
anchors.left: parent.left
anchors.right: parent.right

text: "- " + modelData
textFormat: Text.PlainText
color: Theme.colorSubText
Expand Down Expand Up @@ -393,31 +406,37 @@ Loader {
Text {
color: Theme.colorSubText
text: "App name: %1".arg(utilsApp.appName())
textFormat: Text.PlainText
font.pixelSize: Theme.fontSizeContent
}
Text {
color: Theme.colorSubText
text: "App version: %1".arg(utilsApp.appVersion())
textFormat: Text.PlainText
font.pixelSize: Theme.fontSizeContent
}
Text {
color: Theme.colorSubText
text: "Backend(s): %1".arg(settingsManager.backend_reader) + (settingsManager.backend_zint ? " + zint" : "")
textFormat: Text.PlainText
font.pixelSize: Theme.fontSizeContent
}
Text {
color: Theme.colorSubText
text: "Build mode: %1".arg(utilsApp.appBuildModeFull())
textFormat: Text.PlainText
font.pixelSize: Theme.fontSizeContent
}
Text {
color: Theme.colorSubText
text: "Build date: %1".arg(utilsApp.appBuildDateTime())
textFormat: Text.PlainText
font.pixelSize: Theme.fontSizeContent
}
Text {
color: Theme.colorSubText
text: "Qt version: %1".arg(utilsApp.qtVersion())
textFormat: Text.PlainText
font.pixelSize: Theme.fontSizeContent
}
}
Expand Down
4 changes: 1 addition & 3 deletions qml/ScreenAboutFormats.qml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ Item {
////////

ListView {
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width
anchors.fill: parent

////

Expand Down
9 changes: 6 additions & 3 deletions qml/ScreenBarcodeDetails.qml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ Item {

Item {
id: qrcodearea
width: parent.width
anchors.left: parent.left
anchors.right: parent.right
height: barcode.isLinear ? (parent.width / 2) : parent.width

Rectangle {
Expand Down Expand Up @@ -189,7 +190,8 @@ Item {
////

Rectangle { // barcode content // single line
width: parent.width
anchors.left: parent.left
anchors.right: parent.right
height: barcodedata.height + Theme.componentMargin
radius: Theme.componentRadius
color: Theme.colorComponentBackground
Expand Down Expand Up @@ -224,7 +226,8 @@ Item {
////

Rectangle { // barcode content // multiple lines
width: parent.width
anchors.left: parent.left
anchors.right: parent.right
height: barcodecontent.contentHeight + Theme.componentMargin
radius: Theme.componentRadius
color: Theme.colorComponentBackground
Expand Down
23 changes: 14 additions & 9 deletions qml/ScreenBarcodeReader.qml
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ Loader {
anchors.right: parent.right; }
}
Item {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.bottom: parent.bottom
width: 16; height: 16;

Rectangle { width: 16; height: 4; color: "white";
Expand Down Expand Up @@ -773,7 +773,6 @@ Loader {
anchors.bottom: parent.bottom
anchors.bottomMargin: Theme.componentMarginXL + Math.max(screenPaddingBottom, screenPaddingNavbar)

width: parent.width
spacing: Theme.componentMargin

////
Expand All @@ -782,20 +781,23 @@ Loader {
model: barcodeManager.barcodes

WidgetBarcodeResult {
width: parent.width
anchors.left: parent.left
anchors.right: parent.right
barcode: modelData
}
}

////

RowLayout { // buttons bar
visible: !exitTimer.running

width: parent.width
anchors.left: parent.left
anchors.right: parent.right
height: 48

spacing: Theme.componentMarginXL

visible: !exitTimer.running

Item {
Layout.fillWidth: true
Layout.preferredHeight: 48
Expand Down Expand Up @@ -829,7 +831,9 @@ Loader {
anchors.left: scanImg.right
anchors.leftMargin: Theme.componentMargin
anchors.verticalCenter: parent.verticalCenter

text: qsTr("Scanning...")
textFormat: Text.PlainText
color: "white"
font.pixelSize: Theme.fontSizeContentBig
}
Expand Down Expand Up @@ -908,7 +912,8 @@ Loader {
////

Item { // exit warning
width: parent.width
anchors.left: parent.left
anchors.right: parent.right
height: 48

visible: exitTimer.running
Expand Down Expand Up @@ -941,8 +946,8 @@ Loader {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right

height: screenPaddingStatusbar

color: "black"
opacity: 0.33
visible: true
Expand All @@ -952,8 +957,8 @@ Loader {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom

height: screenPaddingNavbar

color: "black"
opacity: 0.33
visible: true
Expand Down
Loading

0 comments on commit 0c5205c

Please sign in to comment.