Index: sources/gui/qml/pages/SettingsBluetooth.qml =================================================================== diff -u -r9efb7cf51c882dc1f374df0b2a8b8c20efafaa4e -r7249125bb71e6fab4139590ee777c64ece9cf3be --- sources/gui/qml/pages/SettingsBluetooth.qml (.../SettingsBluetooth.qml) (revision 9efb7cf51c882dc1f374df0b2a8b8c20efafaa4e) +++ sources/gui/qml/pages/SettingsBluetooth.qml (.../SettingsBluetooth.qml) (revision 7249125bb71e6fab4139590ee777c64ece9cf3be) @@ -35,43 +35,114 @@ onClicked: _root.clickedBack() } - TouchRect { - id: _scan_for_devices + TitleText { id: _title anchors.horizontalCenter: _root.horizontalCenter anchors.top: _root.top - anchors.topMargin: 75 + anchors.left: _root.left + anchors.topMargin: Variables.settingsBLEMargin + text: qsTr("Bluetooth") + } + + TouchRect { id: _scanForDevices + anchors.left: _root.left + anchors.top: _root.top + anchors.topMargin: 6*Variables.settingsBLEMargin + anchors.leftMargin: 2*Variables.settingsBLEMargin height: Variables.settingsBLEButtonHeight width: Variables.settingsBLEButtonWidth - text.text: "Scan for devices" + text.text: qsTr("Scan for devices") animated: true onClicked: vBluetooth.doScanForDevices() } - Rectangle { - id: _status - anchors.left: _scan_for_devices.right - anchors.top: _root.top - anchors.topMargin: 75 + Rectangle { id: _status + anchors.bottom: _scanForDevices.bottom + anchors.left: _scanForDevices.left + anchors.bottomMargin: Variables.settingsBLEMargin color: "transparent" height: Variables.settingsBLEButtonHeight width: Variables.settingsBLEButtonWidth Text { id: _status_text - anchors.centerIn: parent - text: vBluetooth.status + text: qsTr("Status: " + vBluetooth.status) color: Colors.textMain font.pixelSize: Fonts.fontPixelDialogText } } - ListView { - id: _devices + Text { id: _pairedDevicesLabel + anchors.top: _root.top + anchors.right: _devices.left + anchors.rightMargin: Variables.settingsBLEMargin + anchors.topMargin: 2*Variables.settingsBLEMargin + + font.pixelSize: Fonts.bleTitleFontSize + color: Colors.textMain + text: qsTr("My Devices") + } + + ListView { id: _paired_devices + model: vBluetooth.pairedDevices + anchors.top: _pairedDevicesLabel.bottom + anchors.topMargin: Variables.settingsBLEListViewMargin + anchors.horizontalCenter: _pairedDevicesLabel.horizontalCenter + anchors.bottom: _root.bottom + anchors.bottomMargin: Variables.mainMenuHeight + Variables.notificationHeight + width: Variables.settingsBLEButtonWidth + clip: true + spacing: 10 + + delegate: TouchRect { + id: _pairedDevicesRect + anchors.horizontalCenter: parent.horizontalCenter + height: 85 + width: parent.width + color: Colors.backgroundMain + border.color: Colors.borderButton + radius: 5 + animated: true + + Text { + id: _pairedDevice + anchors.bottom: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + text: modelData.name + color: Colors.textMain + } + + Text { + id: _pairedDevicesAddress + anchors.top: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + text: modelData.address + color: Colors.textMain + } + + onClicked: { + vBluetooth.doSelectDevice(modelData.address) + } + } + } + + Text { id: _devicesLabel + anchors.top: _root.top + anchors.right: _root.right + anchors.rightMargin: 3*Variables.settingsBLEMargin + anchors.topMargin: 2*Variables.settingsBLEMargin + + font.pixelSize: Fonts.bleTitleFontSize + color: Colors.textMain + text: qsTr("Devices") + } + + ListView { id: _devices model: vBluetooth.devices - anchors.top: _scan_for_devices.bottom - anchors.topMargin: 10 + anchors.top: _devicesLabel.bottom + anchors.topMargin: Variables.settingsBLEListViewMargin + anchors.horizontalCenter: _devicesLabel.horizontalCenter anchors.bottom: _root.bottom + anchors.bottomMargin: Variables.mainMenuHeight + Variables.notificationHeight width: Variables.settingsBLEButtonWidth - anchors.horizontalCenter: _root.horizontalCenter clip: true spacing: 10 @@ -106,10 +177,4 @@ } } } - - Connections { target: vBluetooth - onDidScanFinished: { - console.debug("Scan Finished."); - } - } }