diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-01-09 17:24:45 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-29 09:51:44 +0100 |
commit | 0f700c166e7369230763a4c6dbc10e86944669a1 (patch) | |
tree | 449e32cc89a131bb63e92c021ac7880f7bcf81a6 /examples | |
parent | 6d08ef8b9a56a35db8e21a5517a6304623129b83 (diff) |
Adjust qml scanner example to high dpi display
[ChangeLog][QtBluetooth][General] QML scanner example
has been optimized for high DPI displays. This ensures a better
user interface for Android and Blackberry devices.
Change-Id: If757cd9faddc155cbb4bb034885662abc84fc7a6
Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/bluetooth/scanner/Button.qml | 8 | ||||
-rw-r--r-- | examples/bluetooth/scanner/scanner.qml | 20 |
2 files changed, 19 insertions, 9 deletions
diff --git a/examples/bluetooth/scanner/Button.qml b/examples/bluetooth/scanner/Button.qml index a3debfca..17fb38b5 100644 --- a/examples/bluetooth/scanner/Button.qml +++ b/examples/bluetooth/scanner/Button.qml @@ -48,9 +48,7 @@ Rectangle { property alias text: label.text signal clicked() - - height: 60 - width: 105 + height: label.height*1.1 color: active ? "#1c56f3" : "white" @@ -61,9 +59,11 @@ Rectangle { id: label text: "Full Discovery" font.bold: true - anchors.fill: parent + font.pointSize: 17 + width: parent.width wrapMode: Text.WordWrap horizontalAlignment: Text.AlignHCenter + anchors.centerIn: parent } MouseArea { diff --git a/examples/bluetooth/scanner/scanner.qml b/examples/bluetooth/scanner/scanner.qml index 6341e23d..67aaecf0 100644 --- a/examples/bluetooth/scanner/scanner.qml +++ b/examples/bluetooth/scanner/scanner.qml @@ -74,7 +74,7 @@ Item { width: top.width * 0.7; anchors.horizontalCenter: parent.horizontalCenter anchors.top: top.top; - height: 30; + height: text.height*1.2; radius: 5 color: "#1c56f3" visible: btModel.running @@ -83,6 +83,7 @@ Item { id: text text: "Scanning" font.bold: true + font.pointSize: 20 anchors.centerIn: parent } @@ -127,9 +128,9 @@ Item { anchors.leftMargin: 5 Text { id: bttext - text: name; + text: deviceName ? deviceName : name font.family: "FreeSerif" - font.pointSize: 12 + font.pointSize: 16 } Text { @@ -150,7 +151,8 @@ Item { visible: opacity !== 0 opacity: btDelegate.expended ? 1 : 0.0 text: get_details(service) - font: bttext.font + font.family: "FreeSerif" + font.pointSize: 14 Behavior on opacity { NumberAnimation { duration: 200} } @@ -172,20 +174,28 @@ Item { anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter - spacing: 20 + anchors.bottomMargin: 5 + spacing: 10 Button { id: fdButton + width: top.width/3*0.9 + //mdButton has longest text + height: mdButton.height text: "Full Discovery" onClicked: btModel.discoveryMode = BluetoothDiscoveryModel.FullServiceDiscovery } Button { id: mdButton + width: top.width/3*0.9 text: "Minimal Discovery" onClicked: btModel.discoveryMode = BluetoothDiscoveryModel.MinimalServiceDiscovery } Button { id: devButton + width: top.width/3*0.9 + //mdButton has longest text + height: mdButton.height text: "Device Discovery" onClicked: btModel.discoveryMode = BluetoothDiscoveryModel.DeviceDiscovery } |