Skip to content

Commit

Permalink
Various fixes and cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Jun 24, 2022
1 parent 3fd82d2 commit 82fd422
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 26 deletions.
1 change: 1 addition & 0 deletions assets/assets.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
<file>icons_material/outline-add_circle-24px.svg</file>
<file>icons_material/outline-info-24px.svg</file>
<file>icons_material/outline-local_florist-24px.svg</file>
<file>icons_material/outline-lock-24px.svg</file>
<file>icons_material/outline-new_releases-24px.svg</file>
<file>icons_material/outline-remove_circle-24px.svg</file>
<file>icons_material/outline-settings_remote-24px.svg</file>
Expand Down
2 changes: 1 addition & 1 deletion qml/DeviceList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Item {
if (!deviceManager.bluetooth) {
itemStatus.source = "ItemNoBluetooth.qml"
} else if (!deviceManager.bluetoothPermissions) {
itemStatus.source = "ItemNoPermissions.qml"
itemStatus.source = "ItemNoPermission.qml"
} else {
itemStatus.source = "ItemNoDevice.qml"
}
Expand Down
2 changes: 1 addition & 1 deletion qml/components/ItemNoBluetooth.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Item {

Rectangle {
anchors.centerIn: parent
anchors.verticalCenterOffset: -appHeader.height
anchors.verticalCenterOffset: -32

width: appWindow.singleColumn ? (parent.width*0.5) : (parent.height*0.4)
height: width
Expand Down
66 changes: 43 additions & 23 deletions qml/components/ItemNoDevice.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ Item {
anchors.fill: parent

Column {
id: column
anchors.left: parent.left
anchors.leftMargin: 32
anchors.right: parent.right
anchors.rightMargin: 32
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: -20
anchors.verticalCenterOffset: -32

IconSvg { // imageSearch
width: (isDesktop || isTablet || (isPhone && appWindow.screenOrientation === Qt.LandscapeOrientation)) ? 256 : (parent.width*0.666)
Expand Down Expand Up @@ -99,37 +100,56 @@ Item {

////////

Row {
Grid {
anchors.horizontalCenter: parent.horizontalCenter
spacing: 16

ButtonWireframeIcon {
visible: (Qt.platform.os === "android" || Qt.platform.os === "ios")
rows: 2
columns: singleColumn ? 1 : 2

text: qsTr("Official information")
primaryColor: Theme.colorSubText
sourceSize: 20
source: "qrc:/assets/icons_material/duotone-launch-24px.svg"
Item {
width: singleColumn ? column.width : btn1.width
height: 40

onClicked: {
if (Qt.platform.os === "android") {
Qt.openUrlExternally("https://developer.android.com/guide/topics/connectivity/bluetooth/permissions#declare-android11-or-lower")
} else if (Qt.platform.os === "ios") {
Qt.openUrlExternally("https://support.apple.com/HT210578")
ButtonWireframeIcon {
id: btn1
anchors.horizontalCenter: parent.horizontalCenter
//visible: (Qt.platform.os === "android" || Qt.platform.os === "ios")

text: qsTr("Official information")
primaryColor: Theme.colorSubText
sourceSize: 20
source: "qrc:/assets/icons_material/duotone-launch-24px.svg"

onClicked: {
if (Qt.platform.os === "android") {
Qt.openUrlExternally("https://developer.android.com/guide/topics/connectivity/bluetooth/permissions#declare-android11-or-lower")
} else if (Qt.platform.os === "ios") {
Qt.openUrlExternally("https://support.apple.com/HT210578")
}
}
}
}

ButtonWireframe {
text: qsTr("Launch detection")
fullColor: true
primaryColor: Theme.colorPrimary
onClicked: {
if (!deviceManager.updating) {
if (deviceManager.scanning) {
deviceManager.scanDevices_stop()
} else {
deviceManager.scanDevices_start()
Item {
width: singleColumn ? column.width : btn2.width
height: 40

ButtonWireframe {
id: btn2
anchors.horizontalCenter: parent.horizontalCenter

text: qsTr("Launch detection")
fullColor: true
primaryColor: Theme.colorPrimary

onClicked: {
if (!deviceManager.updating) {
if (deviceManager.scanning) {
deviceManager.scanDevices_stop()
} else {
deviceManager.scanDevices_start()
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion qml/components/ItemNoPermission.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Item {

Rectangle {
anchors.centerIn: parent
anchors.verticalCenterOffset: -appHeader.height
anchors.verticalCenterOffset: -32

width: appWindow.singleColumn ? (parent.width*0.5) : (parent.height*0.4)
height: width
Expand Down
1 change: 1 addition & 0 deletions qml/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
<file alias="ItemNoData.qml">components/ItemNoData.qml</file>
<file alias="ItemNoDevice.qml">components/ItemNoDevice.qml</file>
<file alias="ItemNoDeviceNearby.qml">components/ItemNoDeviceNearby.qml</file>
<file alias="ItemNoPermission.qml">components/ItemNoPermission.qml</file>
<file alias="ItemNoPlant.qml">components/ItemNoPlant.qml</file>
<file alias="ItemNoPlants.qml">components/ItemNoPlants.qml</file>
<file alias="ItemNoJournal.qml">components/ItemNoJournal.qml</file>
Expand Down

0 comments on commit 82fd422

Please sign in to comment.