summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/lowenergyscanner/assets
diff options
context:
space:
mode:
Diffstat (limited to 'examples/bluetooth/lowenergyscanner/assets')
-rw-r--r--examples/bluetooth/lowenergyscanner/assets/Characteristics.qml9
-rw-r--r--examples/bluetooth/lowenergyscanner/assets/Dialog.qml22
-rw-r--r--examples/bluetooth/lowenergyscanner/assets/busy_dark.pngbin0 -> 1130 bytes
-rw-r--r--examples/bluetooth/lowenergyscanner/assets/main.qml20
4 files changed, 45 insertions, 6 deletions
diff --git a/examples/bluetooth/lowenergyscanner/assets/Characteristics.qml b/examples/bluetooth/lowenergyscanner/assets/Characteristics.qml
index 4a7db471..ac3b7151 100644
--- a/examples/bluetooth/lowenergyscanner/assets/Characteristics.qml
+++ b/examples/bluetooth/lowenergyscanner/assets/Characteristics.qml
@@ -62,10 +62,13 @@ Rectangle {
target: device
onCharacteristicsUpdated: {
menu.menuText = "Back"
- if (characteristicview.count === 0)
+ if (characteristicview.count === 0) {
info.dialogText = "No characteristic found"
- else
- info.visible = false;
+ info.busyImage = false
+ } else {
+ info.visible = false
+ info.busyImage = true
+ }
}
onDisconnected: {
diff --git a/examples/bluetooth/lowenergyscanner/assets/Dialog.qml b/examples/bluetooth/lowenergyscanner/assets/Dialog.qml
index be5388b5..2b8580f3 100644
--- a/examples/bluetooth/lowenergyscanner/assets/Dialog.qml
+++ b/examples/bluetooth/lowenergyscanner/assets/Dialog.qml
@@ -41,21 +41,39 @@
import QtQuick 2.0
Rectangle {
- width: parent.width/2
+ width: parent.width/3*2
height: 62
z: 50
property string dialogText: ""
+ property bool busyImage: true
border.width: 1
border.color: "#363636"
radius: 10
Text {
+ id: dialogTextId
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
- anchors.fill: parent
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.top;
+ anchors.topMargin: 10
+
elide: Text.ElideMiddle
text: dialogText
color: "#363636"
wrapMode: Text.Wrap
}
+
+ Image {
+ id: background
+
+ width:20
+ height:20
+ anchors.top: dialogTextId.bottom
+ anchors.horizontalCenter: dialogTextId.horizontalCenter
+ visible: parent.busyImage
+ source: "busy_dark.png"
+ fillMode: Image.PreserveAspectFit
+ NumberAnimation on rotation { duration: 3000; from:0; to: 360; loops: Animation.Infinite}
+ }
}
diff --git a/examples/bluetooth/lowenergyscanner/assets/busy_dark.png b/examples/bluetooth/lowenergyscanner/assets/busy_dark.png
new file mode 100644
index 00000000..3a105953
--- /dev/null
+++ b/examples/bluetooth/lowenergyscanner/assets/busy_dark.png
Binary files differ
diff --git a/examples/bluetooth/lowenergyscanner/assets/main.qml b/examples/bluetooth/lowenergyscanner/assets/main.qml
index 9f0395d5..e135d699 100644
--- a/examples/bluetooth/lowenergyscanner/assets/main.qml
+++ b/examples/bluetooth/lowenergyscanner/assets/main.qml
@@ -69,7 +69,7 @@ Rectangle {
clip: true
anchors.top: header.bottom
- anchors.bottom: menu.top
+ anchors.bottom: connectToggle.top
model: device.devicesList
delegate: Rectangle {
@@ -112,6 +112,24 @@ Rectangle {
}
Menu {
+ id: connectToggle
+
+ menuWidth: parent.width
+ anchors.bottom: menu.top
+ menuText: { if (device.devicesList.length)
+ visible = true
+ else
+ visible = false
+ if (device.useRandomAddress)
+ "Address type: Random"
+ else
+ "Address type: Public"
+ }
+
+ onButtonClick: device.useRandomAddress = !device.useRandomAddress;
+ }
+
+ Menu {
id: menu
anchors.bottom: parent.bottom
menuWidth: parent.width