Skip to content

Commit

Permalink
Minor improvements and cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed May 24, 2024
1 parent 55f668c commit d507245
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/builds_mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
env:
APP_NAME: "QmlMobileScanner"
APP_VERSION: "0.1"
QT_VERSION: "6.6.3"
QT_VERSION: "6.7.1"

#-------------------------------------------------------------------------------
# Workflow jobs
Expand Down
11 changes: 5 additions & 6 deletions assets/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:8.1.2' // works with Qt 6.5+ // Java 17
classpath 'com.android.tools.build:gradle:8.1.4' // works with Qt 6.5+ // Java 17
}
}

Expand Down Expand Up @@ -61,8 +61,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

packagingOptions {
Expand All @@ -82,8 +82,8 @@ android {

defaultConfig {
resConfig "en"
minSdkVersion 23 // qtMinSdkVersion
targetSdkVersion 34 // qtTargetSdkVersion
minSdkVersion qtMinSdkVersion
targetSdkVersion qtTargetSdkVersion
ndk.abiFilters = qtTargetAbiList.split(",")

namespace 'io.emeric.qmlmobilescanner'
Expand All @@ -98,7 +98,6 @@ android {
exclude 'lib/*/*_Controls_Fusion_*'
exclude 'lib/*/*_Controls_Imagine_*'
exclude 'lib/*/*_Controls_Universal_*'

// image formats
exclude 'lib/*/*_imageformats_qgif_*'
exclude 'lib/*/*_imageformats_qico_*'
Expand Down
2 changes: 1 addition & 1 deletion assets/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ org.gradle.parallel=true
#org.gradle.caching=true

# Specifies the Java home (path to JDK home) for the Gradle build process
#org.gradle.java.home=/usr/lib/jvm/java-11-openjdk
#org.gradle.java.home=/usr/lib/jvm/java-17-openjdk

android.useAndroidX=true

Expand Down
3 changes: 3 additions & 0 deletions qml/ComponentLibrary/ThemeEngine.qml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Item {
// App specific (toolBLEx)
property color colorBox: "white"
property color colorBoxBorder: "#f4f4f4"
property color colorBoxShadow: "#20000000"
property color colorGrid: "#ebebeb"
property color colorLVheader: "#fafafa"
property color colorLVpair: "white"
Expand Down Expand Up @@ -577,6 +578,7 @@ Item {
// (app)
colorBox = "white"
colorBoxBorder = "#f4f4f4"
colorBoxShadow = "#20000000"
colorGrid = "#ebebeb"
colorLVheader = "#fafafa"
colorLVpair = "white"
Expand Down Expand Up @@ -644,6 +646,7 @@ Item {
// (app)
colorBox = "#252024"
colorBoxBorder = "#333"
colorBoxShadow = "#aa000000"
colorGrid = "#333"
colorLVheader = "#252024"
colorLVpair = "#302b2e"
Expand Down
29 changes: 0 additions & 29 deletions qml/ComponentLibrary/deprecated/ButtonImage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -58,35 +58,6 @@ T.Button {
////////////////

contentItem: Item {
/*
MultiEffect {
source: contentImage
anchors.fill: contentImage
//anchors.margins: -4
autoPaddingEnabled: true
//maskEnabled: true
//maskInverted: false
//maskThresholdMin: 0.5
//maskSpreadAtMin: 1.0
//maskSpreadAtMax: 0.0
//maskSource: ShaderEffectSource {
// sourceItem: contentImage
//}
shadowEnabled: (control.hoverMode === "glow")
shadowScale: 1.1
//shadowColor: "blue"
//shadowColor: Theme.colorPrimary
//shadowColor: Qt.rgba(control.colorHighlight.r, control.colorHighlight.g, control.colorHighlight.b, 1.0)
colorization: 1.0
colorizationColor: Theme.colorPrimary
opacity: control.hovered ? 1.0 : 0
Behavior on opacity { NumberAnimation { duration: 233 } }
}
*/
Image {
id: contentImage
anchors.centerIn: parent
Expand Down
8 changes: 6 additions & 2 deletions qml/ScreenBarcodeDetails.qml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ Item {

Rectangle { // barcode content // multiple lines
width: parent.width
height: barcodedata2.contentHeight + Theme.componentMargin
height: barcodecontent.contentHeight + Theme.componentMargin
radius: Theme.componentRadius
color: Theme.colorComponentBackground
border.width: 2
Expand All @@ -235,12 +235,14 @@ Item {
visible: barcode.isMatrix

IconSvg {
id: barcodecontent_icon
width: 24
height: 24
anchors.right: parent.right
anchors.rightMargin: 8
anchors.verticalCenter: parent.verticalCenter

color: Theme.colorIcon
source: {
if (barcode.content === "URL") return "qrc:/assets/icons/material-icons/duotone/launch.svg"
if (barcode.content === "WiFi") return "qrc:/assets/icons/material-symbols/wifi.svg"
Expand All @@ -253,9 +255,11 @@ Item {
}

Text {
id: barcodedata2
id: barcodecontent
anchors.left: parent.left
anchors.leftMargin: Theme.componentMargin
anchors.right: parent.right
anchors.rightMargin: Theme.componentMargin + 24
anchors.verticalCenter: parent.verticalCenter
anchors.margins: Theme.componentMargin

Expand Down
88 changes: 44 additions & 44 deletions qml/components/WidgetBarcodeResult.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,61 +19,61 @@ Item {
opacity: 0.33
}

IconSvg {
id: barcodeImg
width: parent.height * 0.666
height: parent.height * 0.666
anchors.left: parent.left
anchors.leftMargin: Theme.componentMargin
anchors.verticalCenter: parent.verticalCenter
color: "white"
source: barcode.isMatrix ? "qrc:/assets/icons/material-symbols/qr_code_2.svg" :
"qrc:/assets/icons/material-symbols/barcode.svg"

Rectangle {
width: 12
height: 12
radius: 12
z: -1
color: barcode.color

opacity: barcode.isOnScreen ? 0.80 : 0
Behavior on opacity { NumberAnimation { duration: 133 } }
MouseArea {
anchors.fill: parent
onClicked: {
Qt.openUrlExternally(barcode.data)
}
}

Text {
id: barcodeTxt
anchors.left: barcodeImg.right
RowLayout {
anchors.left: parent.left
anchors.leftMargin: Theme.componentMargin
anchors.right: parent.right
anchors.rightMargin: Theme.componentMargin
anchors.verticalCenter: parent.verticalCenter

text: barcode.data
color: "white"
font.pixelSize: Theme.fontSizeContent
elide: Text.ElideRight
//wrapMode: Text.WordWrap
}
IconSvg { // barcodeImg
Layout.preferredWidth: widgetBarcodeResult.height * 0.666
Layout.preferredHeight: widgetBarcodeResult.height * 0.666
Layout.alignment: Qt.AlignVCenter

Text {
anchors.right: parent.right
anchors.rightMargin: Theme.componentMargin
anchors.verticalCenter: parent.verticalCenter
color: "white"
source: barcode.isMatrix ? "qrc:/assets/icons/material-symbols/qr_code_2.svg" :
"qrc:/assets/icons/material-symbols/barcode.svg"

text: barcode.format
color: "white"
opacity: 0.66
font.pixelSize: Theme.fontSizeContentSmall
elide: Text.ElideRight
//wrapMode: Text.WordWrap
}
Rectangle {
width: 12
height: 12
radius: 12
z: -1
color: barcode.color

MouseArea {
anchors.fill: parent
onClicked: {
Qt.openUrlExternally(barcode.data)
opacity: barcode.isOnScreen ? 0.80 : 0
Behavior on opacity { NumberAnimation { duration: 133 } }
}
}

Text { // barcodeTxt
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter

text: barcode.data
color: "white"
font.pixelSize: Theme.fontSizeContent
elide: Text.ElideRight
//wrapMode: Text.WordWrap
}

Text { // barcodeFormat
Layout.alignment: Qt.AlignVCenter

text: barcode.format
color: "white"
opacity: 0.66
font.pixelSize: Theme.fontSizeContentSmall
elide: Text.ElideRight
//wrapMode: Text.WordWrap
}
}
}
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ int main(int argc, char *argv[])
BarcodeManager *bch = BarcodeManager::getInstance();
if (!bch) return EXIT_FAILURE;

// Init utils
// Init app utils
UtilsScreen *utilsScreen = UtilsScreen::getInstance();
if (!utilsScreen) return EXIT_FAILURE;

Expand Down

0 comments on commit d507245

Please sign in to comment.