From c6b5855b446c73f8a60cc3d4427fc445e0ba400d Mon Sep 17 00:00:00 2001 From: Kimmo Ollila Date: Tue, 23 Feb 2016 09:13:21 +0200 Subject: Migrate settings UI to use Qt Quick Controls 2 Task-number: QTEE-1057 Change-Id: I389d784241d4b68384765dfde4b572e7652eb76c Reviewed-by: Teemu Holappa --- src/settingsui/network/WifiSelectorDelegate.qml | 61 +++++++++---------------- 1 file changed, 21 insertions(+), 40 deletions(-) (limited to 'src/settingsui/network/WifiSelectorDelegate.qml') diff --git a/src/settingsui/network/WifiSelectorDelegate.qml b/src/settingsui/network/WifiSelectorDelegate.qml index 72216a6..17ec931 100644 --- a/src/settingsui/network/WifiSelectorDelegate.qml +++ b/src/settingsui/network/WifiSelectorDelegate.qml @@ -33,58 +33,39 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import QtQuick 2.5 -import QtQuick.Layouts 1.1 -import QtQuick.Controls 1.4 -import "../common" +import QtQuick 2.6 +import QtQuick.Layouts 1.3 +import Qt.labs.controls 1.0 +import Qt.labs.controls.material 1.0 +import Qt.labs.controls.universal 1.0 import com.theqtcompany.settings.network 1.0 -import QtQuick.Controls.Styles.Flat 1.0 as Flat -Item { +ItemDelegate { id: root - property bool checkable: true - property bool checked: false - property bool pressed: false + autoExclusive: true + checkable: true property bool connect: modelData["connected"] - signal clicked() + width: parent.width + contentItem: Item { + width: root.width - MouseArea { - id: delegateButton - anchors.fill: parent - hoverEnabled: true - onPressed: root.pressed = true - onClicked: root.clicked() - onEntered: checked = !checked - - Rectangle { - anchors.fill: parent - color: root.checked ? Flat.FlatStyle.disabledColor : "transparent" - opacity: root.checked ? 0.15 : 1.0 - } - Rectangle { - color: Flat.FlatStyle.darkFrameColor - width: parent.width - height: Flat.FlatStyle.onePixel - anchors.bottom: parent.bottom - } - TextLabel { + Label { id: text + leftPadding: root.indicator.width + root.spacing anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.margins: Math.round(10 * Flat.FlatStyle.scaleFactor) + anchors.top:parent.top + anchors.right: signalMonitor.left + anchors.bottom:parent.bottom + elide: Text.ElideRight horizontalAlignment: Text.AlignLeft - text: modelData["name"] + verticalAlignment: Text.AlignVCenter + text:modelData["name"] } WifiSignalMonitor { - anchors.verticalCenter: parent.verticalCenter + id: signalMonitor anchors.right: parent.right - anchors.margins: Math.round(10 * Flat.FlatStyle.scaleFactor) - height: Math.round(parent.height * .8) + height: parent.height width: height - signalStrength: modelData["signalStrength"] - connected: modelData["connected"] } } } -- cgit v1.2.3