QML: Bluetooth patch to limit device name length 97/11797/5
authorLiPengKun <pengkun.li@jp.alps.com>
Fri, 10 Nov 2017 00:21:19 +0000 (09:21 +0900)
committerLiPengKun <pengkun.li@jp.alps.com>
Mon, 13 Nov 2017 00:03:14 +0000 (09:03 +0900)
This is a patch to fix the Bluetooth issue that
long device name may cover pair button

Change-Id: Ida0fd980cf3308be959eb74ea30e11beeffd5453
Signed-off-by: LiPengKun <pengkun.li@jp.alps.com>
app/bluetooth/Bluetooth.qml

index 7d0778a..04c9284 100644 (file)
@@ -265,9 +265,16 @@ SettingPage {
                  Column {
                      anchors.left: parent.left
                      anchors.leftMargin: 80
+                     TextMetrics {
+                        id: textMetrics
+                        font.family: "Arial"
+                        elide: Text.ElideRight
+                        elideWidth: 140
+                        text: deviceName
+                     }
                      Text {
                         id: btName
-                        text: deviceName
+                        text: textMetrics.elidedText
                         color: '#66FF99'
                         font.pixelSize: 48
                      }