diff --git a/libnymea-app/connection/nymeaconnection.cpp b/libnymea-app/connection/nymeaconnection.cpp index 9ed2c2bd..1648b2d5 100644 --- a/libnymea-app/connection/nymeaconnection.cpp +++ b/libnymea-app/connection/nymeaconnection.cpp @@ -248,6 +248,7 @@ void NymeaConnection::onConnected() if (!m_currentTransport) { m_currentTransport = newTransport; qDebug() << "NymeaConnection: Connected to" << m_currentHost->name() << "via" << m_currentTransport->url(); + emit currentConnectionChanged(); emit connectedChanged(true); return; } diff --git a/libnymea-app/devicemanager.cpp b/libnymea-app/devicemanager.cpp index a1ac1532..ce0a07a7 100644 --- a/libnymea-app/devicemanager.cpp +++ b/libnymea-app/devicemanager.cpp @@ -195,7 +195,7 @@ void DeviceManager::notificationReceived(const QVariantMap &data) m_devices->addDevice(dev); } else if (notification == "Devices.DeviceRemoved") { QUuid deviceId = data.value("params").toMap().value("deviceId").toUuid(); - qDebug() << "JsonRpc: Notification: Device removed" << deviceId.toString(); +// qDebug() << "JsonRpc: Notification: Device removed" << deviceId.toString(); Device *device = m_devices->getDevice(deviceId); if (!device) { qWarning() << "Received a DeviceRemoved notification for a device we don't know!"; @@ -205,7 +205,7 @@ void DeviceManager::notificationReceived(const QVariantMap &data) device->deleteLater(); } else if (notification == "Devices.DeviceChanged") { QUuid deviceId = data.value("params").toMap().value("device").toMap().value("id").toUuid(); - qDebug() << "Device changed notification" << deviceId << data.value("params").toMap(); +// qDebug() << "Device changed notification" << deviceId << data.value("params").toMap(); Device *oldDevice = m_devices->getDevice(deviceId); if (!oldDevice) { qWarning() << "Received a device changed notification for a device we don't know"; @@ -215,12 +215,11 @@ void DeviceManager::notificationReceived(const QVariantMap &data) qWarning() << "Error parsing device changed notification"; return; } - qDebug() << "*** device unpacked" << oldDevice->stateValue("98e4476f-e745-4a7f-b795-19269cb70c40"); } else if (notification == "Devices.DeviceSettingChanged") { QUuid deviceId = data.value("params").toMap().value("deviceId").toUuid(); QString paramTypeId = data.value("params").toMap().value("paramTypeId").toString(); QVariant value = data.value("params").toMap().value("value"); - qDebug() << "Device settings changed notification for device" << deviceId << data.value("params").toMap().value("settings").toList(); +// qDebug() << "Device settings changed notification for device" << deviceId << data.value("params").toMap().value("settings").toList(); Device *dev = m_devices->getDevice(deviceId); if (!dev) { qWarning() << "Device settings changed notification for a device we don't know" << deviceId.toString(); diff --git a/nymea-app/images.qrc b/nymea-app/images.qrc index c9423e13..0c6a5287 100644 --- a/nymea-app/images.qrc +++ b/nymea-app/images.qrc @@ -243,5 +243,8 @@ ui/images/like.svg ui/images/zigbee.svg ui/images/stock_usb.svg + ui/images/twitter.svg + ui/images/discourse.svg + ui/images/telegram.svg diff --git a/nymea-app/resources.qrc b/nymea-app/resources.qrc index ccd269f7..0b796e7a 100644 --- a/nymea-app/resources.qrc +++ b/nymea-app/resources.qrc @@ -31,7 +31,6 @@ ui/components/ErrorDialog.qml ui/components/ShutterControls.qml ui/components/MeaDialog.qml - ui/components/NymeaListItemDelegate.qml ui/components/MainPageTabButton.qml ui/components/AutoSizeMenu.qml ui/components/EmptyViewPlaceholder.qml @@ -229,5 +228,8 @@ ui/system/ZigbeeAddNetworkPage.qml ui/system/ZigbeeNetworkPage.qml ui/system/ZigbeeNetworkInfoPage.qml + ui/MainMenu.qml + ui/components/NymeaItemDelegate.qml + ui/components/NymeaSwipeDelegate.qml diff --git a/nymea-app/translations/nymea-app-de.ts b/nymea-app/translations/nymea-app-de.ts index 1596c603..e488e4db 100644 --- a/nymea-app/translations/nymea-app-de.ts +++ b/nymea-app/translations/nymea-app-de.ts @@ -5317,7 +5317,7 @@ Möchtest Du fortfahren? - NymeaListItemDelegate + NymeaSwipeDelegate Delete Löschen diff --git a/nymea-app/translations/nymea-app-en.ts b/nymea-app/translations/nymea-app-en.ts index 01c05e09..a121798a 100644 --- a/nymea-app/translations/nymea-app-en.ts +++ b/nymea-app/translations/nymea-app-en.ts @@ -4121,7 +4121,7 @@ Please try again. - NymeaListItemDelegate + NymeaSwipeDelegate Delete diff --git a/nymea-app/translations/nymea-app-en_US.ts b/nymea-app/translations/nymea-app-en_US.ts index dc72e545..f6f5aae7 100644 --- a/nymea-app/translations/nymea-app-en_US.ts +++ b/nymea-app/translations/nymea-app-en_US.ts @@ -4121,7 +4121,7 @@ Please try again. - NymeaListItemDelegate + NymeaSwipeDelegate Delete diff --git a/nymea-app/translations/nymea-app-it.ts b/nymea-app/translations/nymea-app-it.ts index 78169b46..76832f62 100644 --- a/nymea-app/translations/nymea-app-it.ts +++ b/nymea-app/translations/nymea-app-it.ts @@ -4130,7 +4130,7 @@ Please try again. - NymeaListItemDelegate + NymeaSwipeDelegate Delete diff --git a/nymea-app/translations/nymea-app-ko.ts b/nymea-app/translations/nymea-app-ko.ts index 17d6f737..d5b12980 100644 --- a/nymea-app/translations/nymea-app-ko.ts +++ b/nymea-app/translations/nymea-app-ko.ts @@ -4450,7 +4450,7 @@ Please try again. - NymeaListItemDelegate + NymeaSwipeDelegate Delete diff --git a/nymea-app/ui/MagicPage.qml b/nymea-app/ui/MagicPage.qml index e1902535..c0456591 100644 --- a/nymea-app/ui/MagicPage.qml +++ b/nymea-app/ui/MagicPage.qml @@ -137,7 +137,7 @@ Page { id: rulesProxy rules: engine.ruleManager.rules } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { id: ruleDelegate width: parent.width iconName: "../images/" + (model.executable ? (iconTag.value.length > 0 ? iconTag.value : "slideshow") : "magic") + ".svg" diff --git a/nymea-app/ui/MainMenu.qml b/nymea-app/ui/MainMenu.qml new file mode 100644 index 00000000..07b84517 --- /dev/null +++ b/nymea-app/ui/MainMenu.qml @@ -0,0 +1,198 @@ +import QtQuick 2.9 +import QtQuick.Controls 2.1 +import QtQuick.Layouts 1.1 +import "components" +import Nymea 1.0 + +Drawer { + id: root + + property Engine currentEngine: null + + signal openThingSettings(); + signal openMagicSettings(); + signal openAppSettings(); + signal openSystemSettings(); + + signal startWirelessSetup(); + signal startManualConnection(); + signal startDemoMode(); + + background: Rectangle { + color: app.backgroundColor + } + + + ColumnLayout { + anchors.fill: parent + spacing: 0 + + Rectangle { + Layout.fillWidth: true + Layout.preferredHeight: topSectionLayout.implicitHeight + app.margins * 2 + color: Qt.tint(app.backgroundColor, Qt.rgba(app.foregroundColor.r, app.foregroundColor.g, app.foregroundColor.b, 0.05)) + ColumnLayout { + id: topSectionLayout + anchors { left: parent.left; top: parent.top; right: parent.right; margins: app.margins } + + Image { + Layout.preferredHeight: app.hugeIconSize + Layout.preferredWidth: height + sourceSize.width: width + sourceSize.height: height + source: "qrc:/styles/%1/logo.svg".arg(styleController.currentStyle) + MouseArea { + anchors.fill: parent + onClicked: Qt.openUrlExternally("https://nymea.io") + } + } + + RowLayout { + ColumnLayout { + Label { + Layout.fillWidth: true + text: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost ? root.currentEngine.jsonRpcClient.currentHost.name : app.systemName + } + Label { + Layout.fillWidth: true + text: root.currentEngine.jsonRpcClient.currentConnection.url + font.pixelSize: app.extraSmallFont + enabled: false + visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost + } + } + ProgressButton { + longpressEnabled: false + imageSource: "../images/close.svg" + visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost + onClicked: { + root.currentEngine.jsonRpcClient.disconnectFromHost(); + root.close(); + } + } + } + } + } + + Flickable { + Layout.fillWidth: true + Layout.fillHeight: true + contentHeight: contentColumn.implicitHeight + interactive: contentHeight > height + clip: true + + ScrollBar.vertical: ScrollBar {} + + ColumnLayout { + id: contentColumn + width: parent.width + spacing: 0 + + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("Wireless setup") + iconName: "../images/connections/bluetooth.svg" + progressive: false + visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost == null + onClicked: { + root.startWirelessSetup(); + root.close(); + } + } + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("Manual connection") + iconName: "../images/connections/network-vpn.svg" + progressive: false + visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost == null + onClicked: { + root.startManualConnection(); + root.close(); + } + } + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("Demo mode") + iconName: "../images/private-browsing.svg" + progressive: false + visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost == null + onClicked: { + root.startDemoMode(); + root.close(); + } + } + + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("Configure things") + iconName: "../images/things.svg" + visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost + progressive: false + onClicked: { + root.openThingSettings() + root.close(); + } + } + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("Magic") + iconName: "../images/magic.svg" + progressive: false + visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost + onClicked: { + root.openMagicSettings(); + root.close(); + } + } + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("App settings") + iconName: "../images/stock_application.svg" + progressive: false + onClicked: { + root.openAppSettings(); + root.close(); + } + } + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("System settings") + iconName: "../images/settings.svg" + progressive: false + visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost + onClicked: { + root.openSystemSettings(); + root.close(); + } + } + + + NymeaItemDelegate { + Layout.fillWidth: true + Layout.topMargin: app.margins + text: qsTr("Forum") + iconName: "../images/discourse.svg" + progressive: false + onClicked: Qt.openUrlExternally("https://forum.nymea.io") + } + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("Telegram") + iconName: "../images/telegram.svg" + progressive: false + onClicked: Qt.openUrlExternally("https://t.me/nymeacommunity") + } + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("Twitter") + iconName: "../images/twitter.svg" + progressive: false + onClicked: Qt.openUrlExternally("https://twitter.com/nymea_io") + } + } + } + + } + +} + diff --git a/nymea-app/ui/MainPage.qml b/nymea-app/ui/MainPage.qml index 119d92a0..a699a761 100644 --- a/nymea-app/ui/MainPage.qml +++ b/nymea-app/ui/MainPage.qml @@ -43,52 +43,33 @@ import "mainviews" Page { id: root - header: FancyHeader { + header: ToolBar { id: mainHeader - title: d.configOverlay !== null ? - qsTr("Configure main view") - : swipeView.currentItem.item.title.length > 0 ? swipeView.currentItem.item.title : filteredContentModel.data(swipeView.currentIndex, "displayName") - leftButtonVisible: true - leftButtonImageSource: { - if (app.hasOwnProperty("headerIcon")) { - return app.headerIcon - } + RowLayout { + anchors.fill: parent - switch (engine.jsonRpcClient.currentConnection.bearerType) { - case Connection.BearerTypeLan: - case Connection.BearerTypeWan: - if (engine.jsonRpcClient.availableBearerTypes & NymeaConnection.BearerTypeEthernet != NymeaConnection.BearerTypeNone) { - return "../images/connections/network-wired.svg" + HeaderButton { + imageSource: "qrc:/styles/%1/logo.svg".arg(styleController.currentStyle) + onClicked: { + if (d.configOverlay != null) { + d.configOverlay.destroy(); + } + app.mainMenu.open() } - return "../images/connections/network-wifi.svg"; - case Connection.BearerTypeBluetooth: - return "../images/connections/network-wifi.svg"; - case Connection.BearerTypeCloud: - return "../images/connections/cloud.svg" - case Connection.BearerTypeLoopback: - return "qrc:/styles/%1/logo.svg".arg(styleController.currentStyle) } - return "" - } - onLeftButtonClicked: { - var dialog = connectionDialogComponent.createObject(root) - dialog.open(); - } - onMenuOpenChanged: { - if (menuOpen && d.configOverlay) { - d.configOverlay.destroy() + + Label { + Layout.fillWidth: true + text: d.configOverlay !== null ? + qsTr("Configure main view") + : swipeView.currentItem.item.title.length > 0 ? swipeView.currentItem.item.title : filteredContentModel.data(swipeView.currentIndex, "displayName") } - } - model: ListModel { - ListElement { iconSource: "../images/things.svg"; text: qsTr("Configure things"); page: "thingconfiguration/EditThingsPage.qml" } - ListElement { iconSource: "../images/magic.svg"; text: qsTr("Magic"); page: "MagicPage.qml" } - ListElement { iconSource: "../images/stock_application.svg"; text: qsTr("App settings"); page: "appsettings/AppSettingsPage.qml" } - ListElement { iconSource: "../images/settings.svg"; text: qsTr("System settings"); page: "SettingsPage.qml" } - } - - onClicked: { - pageStack.push(model.get(index).page) + HeaderButton { + imageSource: "../images/settings.svg" + visible: d.configOverlay == null + onClicked: d.configOverlay = configComponent.createObject(contentContainer) + } } } @@ -211,55 +192,6 @@ Page { } } -// Pane { -// Layout.fillWidth: true -// Layout.preferredHeight: shownHeight -// property int shownHeight: shown ? contentRow.implicitHeight : 0 -// property bool shown: updatesModel.count > 0 || engine.systemController.updateRunning -// visible: shownHeight > 0 -// Behavior on shownHeight { NumberAnimation { easing.type: Easing.InOutQuad; duration: 150 } } -// Material.elevation: 2 -// padding: 0 - -// MouseArea { -// anchors.fill: parent -// onClicked: pageStack.push(Qt.resolvedUrl("system/SystemUpdatePage.qml")) -// } - -// Rectangle { -// color: app.accentColor -// anchors.fill: parent - -// PackagesFilterModel { -// id: updatesModel -// packages: engine.systemController.packages -// updatesOnly: true -// } - -// RowLayout { -// id: contentRow -// anchors { left: parent.left; top: parent.top; right: parent.right; leftMargin: app.margins; rightMargin: app.margins } -// Item { -// Layout.fillWidth: true -// height: app.iconSize -// } - -// Label { -// text: engine.systemController.updateRunning ? qsTr("System update in progress...") : qsTr("%n system update(s) available", "", updatesModel.count) -// color: "white" -// font.pixelSize: app.smallFont -// } -// ColorIcon { -// height: app.iconSize / 2 -// width: height -// color: "white" -// name: "../images/system-update.svg" -// RotationAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; running: engine.systemController.updateRunning } -// } -// } -// } -// } - Item { id: contentContainer Layout.fillWidth: true @@ -363,7 +295,6 @@ Page { } else { PlatformHelper.vibrate(PlatformHelper.HapticsFeedbackSelection) d.configOverlay = configComponent.createObject(contentContainer) - mainHeader.menuOpen = false; } } } diff --git a/nymea-app/ui/Nymea.qml b/nymea-app/ui/Nymea.qml index 509b1fab..470716d4 100644 --- a/nymea-app/ui/Nymea.qml +++ b/nymea-app/ui/Nymea.qml @@ -62,8 +62,8 @@ ApplicationWindow { property int smallIconSize: 16 property int iconSize: 24 - property int largeIconSize: 32 - property int hugeIconSize: 40 + property int largeIconSize: 40 + property int hugeIconSize: 64 property int delegateHeight: 60 property color backgroundColor: Material.background @@ -98,6 +98,22 @@ ApplicationWindow { value: settings.units === "metric" ? Types.UnitSystemMetric : Types.UnitSystemImperial } + property alias mainMenu: m + MainMenu { + id: m + height: app.height + width: Math.min(300, app.width) +// z: 1000 + currentEngine: rootItem.currentEngine + onOpenThingSettings: rootItem.openThingSettings(); + onOpenMagicSettings: rootItem.openMagicSettings(); + onOpenAppSettings: rootItem.openAppSettings(); + onOpenSystemSettings: rootItem.openSystemSettings(); + onStartManualConnection: rootItem.startManualConnection(); + onStartWirelessSetup: rootItem.startWirelessSetup(); + onStartDemoMode: rootItem.startDemoMode(); + } + RootItem { id: rootItem anchors.fill: parent diff --git a/nymea-app/ui/RootItem.qml b/nymea-app/ui/RootItem.qml index 990f14e9..fc23ed6c 100644 --- a/nymea-app/ui/RootItem.qml +++ b/nymea-app/ui/RootItem.qml @@ -40,10 +40,35 @@ import "connection" Item { id: root + readonly property Engine currentEngine: swipeView.currentItem ? swipeView.currentItem.engine : null + function handleAndroidBackButton() { return swipeView.currentItem.handleAndroidBackButton() } + function openThingSettings() { + swipeView.currentItem.pageStack.push("thingconfiguration/EditThingsPage.qml") + } + function openMagicSettings() { + swipeView.currentItem.pageStack.push("MagicPage.qml") + } + function openAppSettings() { + swipeView.currentItem.pageStack.push("appsettings/AppSettingsPage.qml") + } + function openSystemSettings() { + swipeView.currentItem.pageStack.push("SettingsPage.qml") + } + function startManualConnection() { + swipeView.currentItem.pageStack.push("connection/ManualConnectPage.qml") + } + function startWirelessSetup() { + swipeView.currentItem.pageStack.push("connection/wifisetup/BluetoothDiscoveryPage.qml"); + } + function startDemoMode() { + var host = discovery.nymeaHosts.createWanHost("Demo server", "nymea://nymea.nymea.io:2222") + root.currentEngine.jsonRpcClient.connectToHost(host) + } + ListModel { id: tabModel @@ -125,8 +150,9 @@ Item { value: engine.jsonRpcClient.currentHost === null } + readonly property alias pageStack: _pageStack StackView { - id: pageStack + id: _pageStack objectName: "pageStack" anchors.fill: parent initialItem: Page {} diff --git a/nymea-app/ui/SettingsPage.qml b/nymea-app/ui/SettingsPage.qml index 36fffc8e..f1137d3f 100644 --- a/nymea-app/ui/SettingsPage.qml +++ b/nymea-app/ui/SettingsPage.qml @@ -59,7 +59,7 @@ Page { Layout.fillWidth: true Material.elevation: layout.isGrid ? 1 : 0 padding: 0 - NymeaListItemDelegate { + NymeaSwipeDelegate { width: parent.width iconName: "../images/configure.svg" text: qsTr("General") @@ -76,7 +76,7 @@ Page { padding: 0 visible: engine.jsonRpcClient.ensureServerVersion("4.2") && engine.jsonRpcClient.authenticated - NymeaListItemDelegate { + NymeaSwipeDelegate { width: parent.width iconName: "../images/account.svg" text: qsTr("User settings") @@ -92,7 +92,7 @@ Page { Material.elevation: layout.isGrid ? 1 : 0 padding: 0 - NymeaListItemDelegate { + NymeaSwipeDelegate { width: parent.width iconName: "../images/connections/network-wifi.svg" text: qsTr("Networking") @@ -109,7 +109,7 @@ Page { visible: engine.jsonRpcClient.ensureServerVersion("1.9") padding: 0 - NymeaListItemDelegate { + NymeaSwipeDelegate { width: parent.width iconName: "../images/connections/cloud.svg" text: qsTr("Cloud") @@ -125,7 +125,7 @@ Page { Material.elevation: layout.isGrid ? 1 : 0 padding: 0 - NymeaListItemDelegate { + NymeaSwipeDelegate { width: parent.width iconName: "../images/connections/network-vpn.svg" text: qsTr("API interfaces") @@ -142,7 +142,7 @@ Page { visible: engine.jsonRpcClient.ensureServerVersion("1.11") padding: 0 - NymeaListItemDelegate { + NymeaSwipeDelegate { width: parent.width iconName: "../images/mqtt.svg" text: qsTr("MQTT broker") @@ -159,7 +159,7 @@ Page { visible: engine.jsonRpcClient.ensureServerVersion("5.3") padding: 0 - NymeaListItemDelegate { + NymeaSwipeDelegate { width: parent.width iconName: "../images/zigbee.svg" text: qsTr("ZigBee") @@ -175,7 +175,7 @@ Page { Material.elevation: layout.isGrid ? 1 : 0 padding: 0 - NymeaListItemDelegate { + NymeaSwipeDelegate { width: parent.width iconName: "../images/stock_website.svg" text: qsTr("Web server") @@ -192,7 +192,7 @@ Page { Material.elevation: layout.isGrid ? 1 : 0 padding: 0 - NymeaListItemDelegate { + NymeaSwipeDelegate { width: parent.width iconName: "../images/plugin.svg" text: qsTr("Plugins") @@ -208,7 +208,7 @@ Page { Material.elevation: layout.isGrid ? 1 : 0 padding: 0 - NymeaListItemDelegate { + NymeaSwipeDelegate { width: parent.width iconName: "../images/sdk.svg" text: qsTr("Developer tools") @@ -225,7 +225,7 @@ Page { visible: engine.jsonRpcClient.ensureServerVersion("2.1") && engine.systemController.updateManagementAvailable padding: 0 - NymeaListItemDelegate { + NymeaSwipeDelegate { width: parent.width iconName: "../images/system-update.svg" text: qsTr("System update") @@ -241,7 +241,7 @@ Page { Material.elevation: layout.isGrid ? 1 : 0 padding: 0 - NymeaListItemDelegate { + NymeaSwipeDelegate { width: parent.width iconName: "../images/logs.svg" text: qsTr("Log viewer") @@ -257,7 +257,7 @@ Page { Material.elevation: layout.isGrid ? 1 : 0 padding: 0 - NymeaListItemDelegate { + NymeaSwipeDelegate { width: parent.width iconName: "../images/info.svg" text: qsTr("About %1:core").arg(app.systemName) diff --git a/nymea-app/ui/appsettings/AboutPage.qml b/nymea-app/ui/appsettings/AboutPage.qml index c39d014e..1ed44ab8 100644 --- a/nymea-app/ui/appsettings/AboutPage.qml +++ b/nymea-app/ui/appsettings/AboutPage.qml @@ -53,14 +53,14 @@ SettingsPageBase { githubLink: "https://github.com/nymea/nymea-app" - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("App version:") subText: appVersion progressive: false prominentSubText: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Qt version:") subText: qtVersion + (qtBuildVersion !== qtVersion ? " (" + qsTr("Built with %1").arg(qtBuildVersion) + ")" : "") diff --git a/nymea-app/ui/appsettings/AppSettingsPage.qml b/nymea-app/ui/appsettings/AppSettingsPage.qml index 9e049395..ffe6a278 100644 --- a/nymea-app/ui/appsettings/AppSettingsPage.qml +++ b/nymea-app/ui/appsettings/AppSettingsPage.qml @@ -59,7 +59,7 @@ Page { Layout.fillWidth: true Material.elevation: layout.isGrid ? 1 : 0 padding: 0 - NymeaListItemDelegate { + NymeaSwipeDelegate { width: parent.width text: qsTr("Look & feel") subText: qsTr("Customize the app's look and behavior") @@ -74,7 +74,7 @@ Page { Layout.fillWidth: true Material.elevation: layout.isGrid ? 1 : 0 padding: 0 - NymeaListItemDelegate { + NymeaSwipeDelegate { width: parent.width text: qsTr("Cloud login") subText: qsTr("Log into %1:cloud and manage connected %1:core systems").arg(app.systemName) @@ -88,7 +88,7 @@ Page { Layout.fillWidth: true Material.elevation: layout.isGrid ? 1 : 0 padding: 0 - NymeaListItemDelegate { + NymeaSwipeDelegate { width: parent.width text: qsTr("Developer options") subText: qsTr("Access tools for debugging and error reporting") @@ -102,7 +102,7 @@ Page { Layout.fillWidth: true Material.elevation: layout.isGrid ? 1 : 0 padding: 0 - NymeaListItemDelegate { + NymeaSwipeDelegate { width: parent.width text: qsTr("About %1").arg(app.appName) subText: qsTr("Find app versions and licence information") diff --git a/nymea-app/ui/appsettings/CloudLoginPage.qml b/nymea-app/ui/appsettings/CloudLoginPage.qml index 595e72a2..2079a00b 100644 --- a/nymea-app/ui/appsettings/CloudLoginPage.qml +++ b/nymea-app/ui/appsettings/CloudLoginPage.qml @@ -113,7 +113,7 @@ SettingsPageBase { Repeater { model: AWSClient.awsDevices - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { Layout.fillWidth: true text: model.name subText: model.id diff --git a/nymea-app/ui/appsettings/DeveloperOptionsPage.qml b/nymea-app/ui/appsettings/DeveloperOptionsPage.qml index 321aad28..6e56c392 100644 --- a/nymea-app/ui/appsettings/DeveloperOptionsPage.qml +++ b/nymea-app/ui/appsettings/DeveloperOptionsPage.qml @@ -50,7 +50,7 @@ SettingsPageBase { Layout.fillWidth: true } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("View log") onClicked: pageStack.push(Qt.resolvedUrl("../appsettings/AppLogPage.qml")) diff --git a/nymea-app/ui/components/BrowserContextMenu.qml b/nymea-app/ui/components/BrowserContextMenu.qml index 318a952a..44ff0377 100644 --- a/nymea-app/ui/components/BrowserContextMenu.qml +++ b/nymea-app/ui/components/BrowserContextMenu.qml @@ -59,7 +59,7 @@ MeaDialog { interactive: contentHeight > height clip: true - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { width: parent.width text: actionType.displayName progressive: false diff --git a/nymea-app/ui/components/Imprint.qml b/nymea-app/ui/components/Imprint.qml index 249fecc1..ec405368 100644 --- a/nymea-app/ui/components/Imprint.qml +++ b/nymea-app/ui/components/Imprint.qml @@ -124,7 +124,7 @@ Item { ColumnLayout { Layout.fillWidth: true - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true iconName: "../images/stock_website.svg" text: qsTr("Visit the nymea website") @@ -136,7 +136,7 @@ Item { } } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true iconName: "../images/stock_website.svg" text: qsTr("Visit GitHub page") @@ -148,7 +148,7 @@ Item { } } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("View privacy policy") iconName: "../images/stock_website.svg" @@ -159,7 +159,7 @@ Item { Qt.openUrlExternally(app.privacyPolicyUrl) } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Software license") iconName: "../images/stock_website.svg" @@ -171,7 +171,7 @@ Item { } } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Additional software licenses") iconName: "../images/logs.svg" @@ -207,7 +207,7 @@ Item { wrapMode: Text.WordWrap } } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true iconName: "../images/stock_website.svg" text: qsTr("Visit the Qt website") @@ -236,7 +236,7 @@ Item { Repeater { model: root.additionalLicenses - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { Layout.fillWidth: true text: model.component subText: model.infoText diff --git a/nymea-app/ui/components/MainPageTile.qml b/nymea-app/ui/components/MainPageTile.qml index 8c466eba..250ea509 100644 --- a/nymea-app/ui/components/MainPageTile.qml +++ b/nymea-app/ui/components/MainPageTile.qml @@ -132,7 +132,7 @@ Item { ColorIcon { id: colorIcon anchors.centerIn: parent - height: app.hugeIconSize + height: app.largeIconSize width: height ColorIcon { id: fallbackIcon diff --git a/nymea-app/ui/components/NymeaItemDelegate.qml b/nymea-app/ui/components/NymeaItemDelegate.qml new file mode 100644 index 00000000..473063cd --- /dev/null +++ b/nymea-app/ui/components/NymeaItemDelegate.qml @@ -0,0 +1,200 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* +* Copyright 2013 - 2020, nymea GmbH +* Contact: contact@nymea.io +* +* This file is part of nymea. +* This project including source code and documentation is protected by +* copyright law, and remains the property of nymea GmbH. All rights, including +* reproduction, publication, editing and translation, are reserved. The use of +* this project is subject to the terms of a license agreement to be concluded +* with nymea GmbH in accordance with the terms of use of nymea GmbH, available +* under https://nymea.io/license +* +* GNU General Public License Usage +* Alternatively, this project may be redistributed and/or modified under the +* terms of the GNU General Public License as published by the Free Software +* Foundation, GNU version 3. This project is distributed in the hope that it +* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +* Public License for more details. +* +* You should have received a copy of the GNU General Public License along with +* this project. If not, see . +* +* For any further details and any questions please contact us under +* contact@nymea.io or see our FAQ/Licensing Information on +* https://nymea.io/license/faq +* +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +import QtQuick 2.9 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.3 +import QtQuick.Controls.Material 2.2 + +// There's a bug in QtQuick.Controls' SwipeDelegate in that it appears with wrong +// background when used in Popups/Dialogs So we need a non-swipable one for those cases + +// FIXME: Eventually consoldate this again somehow + +ItemDelegate { + id: root + implicitWidth: 200 + + property string subText + property bool progressive: true + property bool canDelete: false + + property bool wrapTexts: true + property bool prominentSubText: true + property int textAlignment: Text.AlignLeft + + property string iconName + property string thumbnail + property int iconSize: app.iconSize + property color iconColor: app.accentColor + property alias iconKeyColor: icon.keyColor + property alias secondaryIconName: secondaryIcon.name + property alias secondaryIconColor: secondaryIcon.color + property alias secondaryIconKeyColor: secondaryIcon.keyColor + property alias secondaryIconClickable: secondaryIconMouseArea.enabled + property alias tertiaryIconName: tertiaryIcon.name + property alias tertiaryIconColor: tertiaryIcon.color + property alias tertiaryIconKeyColor: tertiaryIcon.keyColor + property alias tertiaryIconClickable: tertiaryIconMouseArea.enabled + + property var contextOptions: [] + + property alias additionalItem: additionalItemContainer.children + + property alias busy: busyIndicator.running + + signal deleteClicked() + signal secondaryIconClicked() + + onPressAndHold: swipe.open(SwipeDelegate.Right) + + QtObject { + id: d + property var deleteContextOption: [{ + text: qsTr("Delete"), + icon: "../images/delete.svg", + backgroundColor: "red", + foregroundColor: "white", + visible: canDelete, + callback: function deleteClicked() { + root.deleteClicked(); + swipe.close(); + } + }] + + property var finalContextOptions: root.contextOptions.concat(d.deleteContextOption) + } + + contentItem: RowLayout { + id: innerLayout + spacing: app.margins + Item { + Layout.preferredHeight: root.iconSize + Layout.preferredWidth: height + visible: root.iconName.length > 0 || root.thumbnail.length > 0 + + ColorIcon { + id: icon + anchors.fill: parent + name: root.iconName + color: root.iconColor + visible: root.iconName && thumbnailImage.status !== Image.Ready + } + + Image { + id: thumbnailImage + anchors.fill: parent + source: root.thumbnail + visible: root.thumbnail.length > 0 + fillMode: Image.PreserveAspectFit + horizontalAlignment: Image.AlignHCenter + verticalAlignment: Image.AlignVCenter + } + + BusyIndicator { + id: busyIndicator + anchors.centerIn: parent + visible: running + running: false + } + } + + ColumnLayout { + Layout.fillWidth: true + Layout.fillHeight: true + + Label { + Layout.fillWidth: true + Layout.fillHeight: true + text: root.text + wrapMode: root.wrapTexts ? Text.WordWrap : Text.NoWrap + maximumLineCount: root.wrapTexts ? 2 : 1 + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter + horizontalAlignment: root.textAlignment + } + Label { + Layout.fillWidth: true + Layout.fillHeight: true + text: root.subText + font.pixelSize: root.prominentSubText ? app.smallFont : app.extraSmallFont + color: root.prominentSubText ? Material.foreground : Material.color(Material.Grey) + wrapMode: root.wrapTexts ? Text.WordWrap : Text.NoWrap + maximumLineCount: root.wrapTexts ? 2 : 1 + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter + visible: root.subText.length > 0 + } + } + + ColorIcon { + id: secondaryIcon + Layout.preferredHeight: app.smallIconSize + Layout.preferredWidth: height + visible: name.length > 0 + MouseArea { + id: secondaryIconMouseArea + enabled: false + anchors.fill: parent + anchors.margins: -app.margins + onClicked: root.secondaryIconClicked(); + } + } + + ColorIcon { + id: tertiaryIcon + Layout.preferredHeight: app.smallIconSize + Layout.preferredWidth: height + visible: name.length > 0 + MouseArea { + id: tertiaryIconMouseArea + enabled: false + anchors.fill: parent + anchors.margins: -app.margins + onClicked: root.tertiaryIconClicked(); + } + } + + ColorIcon { + id: progressionIcon + Layout.preferredHeight: app.smallIconSize + Layout.preferredWidth: height + name: "../images/next.svg" + visible: root.progressive + } + + Item { + id: additionalItemContainer + Layout.fillHeight: true + Layout.preferredWidth: childrenRect.width + visible: children.length > 0 + } + } +} diff --git a/nymea-app/ui/components/NymeaListItemDelegate.qml b/nymea-app/ui/components/NymeaSwipeDelegate.qml similarity index 100% rename from nymea-app/ui/components/NymeaListItemDelegate.qml rename to nymea-app/ui/components/NymeaSwipeDelegate.qml diff --git a/nymea-app/ui/components/RemoveDeviceMethodDialog.qml b/nymea-app/ui/components/RemoveDeviceMethodDialog.qml index 7842c573..6709ace5 100644 --- a/nymea-app/ui/components/RemoveDeviceMethodDialog.qml +++ b/nymea-app/ui/components/RemoveDeviceMethodDialog.qml @@ -68,7 +68,7 @@ Dialog { } ThinDivider {} - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Remove all those rules") progressive: false @@ -79,7 +79,7 @@ Dialog { } } - NymeaListItemDelegate { + NymeaSwipeDelegate { text: qsTr("Update rules, removing this thing") Layout.fillWidth: true progressive: false @@ -90,7 +90,7 @@ Dialog { } } - NymeaListItemDelegate { + NymeaSwipeDelegate { text: qsTr("Don't remove this thing") Layout.fillWidth: true progressive: false diff --git a/nymea-app/ui/connection/ConnectPage.qml b/nymea-app/ui/connection/ConnectPage.qml index 4871ba02..6d2f3b3f 100644 --- a/nymea-app/ui/connection/ConnectPage.qml +++ b/nymea-app/ui/connection/ConnectPage.qml @@ -38,24 +38,40 @@ import "../components" Page { id: root - header: FancyHeader { - title: qsTr("Connect %1").arg(app.systemName) - model: ListModel { - ListElement { iconSource: "../images/connections/network-vpn.svg"; text: qsTr("Manual connection"); page: "ManualConnectPage.qml" } - ListElement { iconSource: "../images/connections/bluetooth.svg"; text: qsTr("Wireless setup"); page: "wifisetup/BluetoothDiscoveryPage.qml"; } - ListElement { iconSource: "../images/private-browsing.svg"; text: qsTr("Demo mode"); page: "" } - ListElement { iconSource: "../images/stock_application.svg"; text: qsTr("App settings"); page: "../appsettings/AppSettingsPage.qml" } - } - onClicked: { - if (index === 2) { - var host = discovery.nymeaHosts.createWanHost("Demo server", "nymea://nymea.nymea.io:2222") - engine.jsonRpcClient.connectToHost(host) - } else { - pageStack.push(model.get(index).page, {nymeaDiscovery: discovery}); + header: ToolBar { + RowLayout { + anchors.fill: parent + + HeaderButton { + imageSource: "../images/navigation-menu.svg" + onClicked: app.mainMenu.open() + } + + Label { + Layout.fillWidth: true + text: qsTr("Connect %1").arg(app.systemName) } } } +// header: FancyHeader { +// title: qsTr("Connect %1").arg(app.systemName) +// model: ListModel { +// ListElement { iconSource: "../images/connections/network-vpn.svg"; text: qsTr("Manual connection"); page: "ManualConnectPage.qml" } +// ListElement { iconSource: "../images/connections/bluetooth.svg"; text: qsTr("Wireless setup"); page: "wifisetup/BluetoothDiscoveryPage.qml"; } +// ListElement { iconSource: "../images/private-browsing.svg"; text: qsTr("Demo mode"); page: "" } +// ListElement { iconSource: "../images/stock_application.svg"; text: qsTr("App settings"); page: "../appsettings/AppSettingsPage.qml" } +// } +// onClicked: { +// if (index === 2) { +// var host = discovery.nymeaHosts.createWanHost("Demo server", "nymea://nymea.nymea.io:2222") +// engine.jsonRpcClient.connectToHost(host) +// } else { +// pageStack.push(model.get(index).page, {nymeaDiscovery: discovery}); +// } +// } +// } + readonly property bool haveHosts: hostsProxy.count > 0 @@ -134,7 +150,7 @@ Page { model: hostsProxy clip: true - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { id: nymeaHostDelegate width: parent.width height: app.delegateHeight @@ -356,7 +372,7 @@ Page { width: parent.width Repeater { model: dialog.nymeaHost.connections - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { Layout.fillWidth: true wrapTexts: false progressive: false diff --git a/nymea-app/ui/connection/wifisetup/BluetoothDiscoveryPage.qml b/nymea-app/ui/connection/wifisetup/BluetoothDiscoveryPage.qml index 83f842c2..a68ea609 100644 --- a/nymea-app/ui/connection/wifisetup/BluetoothDiscoveryPage.qml +++ b/nymea-app/ui/connection/wifisetup/BluetoothDiscoveryPage.qml @@ -117,7 +117,7 @@ Page { model: bluetoothDiscovery.deviceInfos clip: true - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { width: parent.width iconName: Qt.resolvedUrl("../../images/connections/bluetooth.svg") text: model.name diff --git a/nymea-app/ui/connection/wifisetup/BoxInfoPage.qml b/nymea-app/ui/connection/wifisetup/BoxInfoPage.qml index 389530f3..824aa7ca 100644 --- a/nymea-app/ui/connection/wifisetup/BoxInfoPage.qml +++ b/nymea-app/ui/connection/wifisetup/BoxInfoPage.qml @@ -46,31 +46,31 @@ Page { ColumnLayout { anchors { left: parent.left; top: parent.top; right: parent.right } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true progressive: false text: qsTr("System UUID") subText: networkManagerController.manager.modelNumber } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true progressive: false text: qsTr("Manufacturer") subText: networkManagerController.manager.manufacturer } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true progressive: false text: qsTr("Software revision") subText: networkManagerController.manager.softwareRevision } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true progressive: false text: qsTr("Firmware revision") subText: networkManagerController.manager.firmwareRevision } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true progressive: false text: qsTr("Hardware revision") diff --git a/nymea-app/ui/connection/wifisetup/ConnectWiFiPage.qml b/nymea-app/ui/connection/wifisetup/ConnectWiFiPage.qml index 1621c1b8..008aedac 100644 --- a/nymea-app/ui/connection/wifisetup/ConnectWiFiPage.qml +++ b/nymea-app/ui/connection/wifisetup/ConnectWiFiPage.qml @@ -73,7 +73,7 @@ Page { } clip: true - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { width: parent.width text: model.ssid !== "" ? model.ssid : qsTr("Hidden Network") enabled: !networkManagerController.manager.working diff --git a/nymea-app/ui/customviews/GenericTypeLogView.qml b/nymea-app/ui/customviews/GenericTypeLogView.qml index 2db8bff6..5a418766 100644 --- a/nymea-app/ui/customviews/GenericTypeLogView.qml +++ b/nymea-app/ui/customviews/GenericTypeLogView.qml @@ -61,7 +61,7 @@ Item { } } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { id: logEntryDelegate width: parent.width implicitHeight: app.delegateHeight diff --git a/nymea-app/ui/delegates/BrowserItemDelegate.qml b/nymea-app/ui/delegates/BrowserItemDelegate.qml index 71dc725d..4f81dc31 100644 --- a/nymea-app/ui/delegates/BrowserItemDelegate.qml +++ b/nymea-app/ui/delegates/BrowserItemDelegate.qml @@ -35,7 +35,7 @@ import QtQuick.Layouts 1.1 import Nymea 1.0 import "../components" -NymeaListItemDelegate { +NymeaSwipeDelegate { id: root width: parent.width text: model.displayName diff --git a/nymea-app/ui/delegates/ThingDelegate.qml b/nymea-app/ui/delegates/ThingDelegate.qml index 3f5abec5..5df7ebdb 100644 --- a/nymea-app/ui/delegates/ThingDelegate.qml +++ b/nymea-app/ui/delegates/ThingDelegate.qml @@ -34,7 +34,7 @@ import QtQuick.Layouts 1.2 import "../components" import Nymea 1.0 -NymeaListItemDelegate { +NymeaSwipeDelegate { id: root width: parent.width iconName: thing && thing.thingClass ? app.interfacesToIcon(thing.thingClass.interfaces) : "" diff --git a/nymea-app/ui/devicepages/DoorbellDevicePage.qml b/nymea-app/ui/devicepages/DoorbellDevicePage.qml index 1a00fe54..549fd165 100644 --- a/nymea-app/ui/devicepages/DoorbellDevicePage.qml +++ b/nymea-app/ui/devicepages/DoorbellDevicePage.qml @@ -128,7 +128,7 @@ DevicePageBase { deviceId: root.device.id typeIds: [root.doorbellPressedType.id] } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { width: parent.width text: Qt.formatDateTime(model.timestamp) progressive: false diff --git a/nymea-app/ui/devicepages/FingerprintReaderDevicePage.qml b/nymea-app/ui/devicepages/FingerprintReaderDevicePage.qml index 7a66d13d..16c17bbf 100644 --- a/nymea-app/ui/devicepages/FingerprintReaderDevicePage.qml +++ b/nymea-app/ui/devicepages/FingerprintReaderDevicePage.qml @@ -76,7 +76,7 @@ DevicePageBase { typeIds: [root.accessGrantedEventType.id, root.accessDeniedEventType.id]; } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { width: parent.width iconName: accessGranted ? "../images/tick.svg" : "../images/dialog-error-symbolic.svg" iconColor: accessGranted ? "green" : "red" @@ -125,7 +125,7 @@ DevicePageBase { clip: true model: root.usersState.value - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { text: modelData width: parent.width progressive: false diff --git a/nymea-app/ui/devicepages/InputTriggerDevicePage.qml b/nymea-app/ui/devicepages/InputTriggerDevicePage.qml index cdc63288..a07ee807 100644 --- a/nymea-app/ui/devicepages/InputTriggerDevicePage.qml +++ b/nymea-app/ui/devicepages/InputTriggerDevicePage.qml @@ -51,7 +51,7 @@ DevicePageBase { typeIds: [root.deviceClass.eventTypes.findByName("triggered").id]; } -// delegate: NymeaListItemDelegate { +// delegate: NymeaSwipeDelegate { // width: parent.width // iconName: app.interfaceToIcon("inputtrigger") // text: model.value.trim() diff --git a/nymea-app/ui/devicepages/NotificationsDevicePage.qml b/nymea-app/ui/devicepages/NotificationsDevicePage.qml index c426efb8..8530a367 100644 --- a/nymea-app/ui/devicepages/NotificationsDevicePage.qml +++ b/nymea-app/ui/devicepages/NotificationsDevicePage.qml @@ -76,7 +76,7 @@ DevicePageBase { typeIds: [root.deviceClass.actionTypes.findByName("notify").id]; } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { width: parent.width iconName: app.interfaceToIcon("notifications") text: model.value.trim() diff --git a/nymea-app/ui/images/discourse.svg b/nymea-app/ui/images/discourse.svg new file mode 100644 index 00000000..6ee4506f --- /dev/null +++ b/nymea-app/ui/images/discourse.svg @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/nymea-app/ui/images/telegram.svg b/nymea-app/ui/images/telegram.svg new file mode 100644 index 00000000..5d961e4c --- /dev/null +++ b/nymea-app/ui/images/telegram.svg @@ -0,0 +1,23 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/nymea-app/ui/images/twitter.svg b/nymea-app/ui/images/twitter.svg new file mode 100644 index 00000000..ad453a3e --- /dev/null +++ b/nymea-app/ui/images/twitter.svg @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/nymea-app/ui/magic/CalendarItemDelegate.qml b/nymea-app/ui/magic/CalendarItemDelegate.qml index 652002bc..5652a7a3 100644 --- a/nymea-app/ui/magic/CalendarItemDelegate.qml +++ b/nymea-app/ui/magic/CalendarItemDelegate.qml @@ -34,7 +34,7 @@ import QtQuick.Layouts 1.3 import Nymea 1.0 import "../components" -NymeaListItemDelegate { +NymeaSwipeDelegate { id: root implicitHeight: app.delegateHeight progressive: false diff --git a/nymea-app/ui/magic/DeviceRulesPage.qml b/nymea-app/ui/magic/DeviceRulesPage.qml index b3c84b23..c8e2013b 100644 --- a/nymea-app/ui/magic/DeviceRulesPage.qml +++ b/nymea-app/ui/magic/DeviceRulesPage.qml @@ -141,7 +141,7 @@ Page { filterDeviceId: root.device.id } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { width: parent.width iconName: "../images/magic.svg" iconColor: !model.enabled ? "red" : (model.active ? app.accentColor : "grey") diff --git a/nymea-app/ui/magic/EditRulePage.qml b/nymea-app/ui/magic/EditRulePage.qml index c7b1400f..0e893108 100644 --- a/nymea-app/ui/magic/EditRulePage.qml +++ b/nymea-app/ui/magic/EditRulePage.qml @@ -750,7 +750,7 @@ Page { minimumJsonRpcVersion: "1.0" } } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { Layout.fillWidth: true iconName: model.iconName text: model.text @@ -800,7 +800,7 @@ Page { minimumJsonRpcVersion: "1.0" } } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { Layout.fillWidth: true iconName: model.iconName text: model.text @@ -863,7 +863,7 @@ Page { minimumJsonRpcVersion: "1.5" } } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { Layout.fillWidth: true iconName: model.iconName text: model.text diff --git a/nymea-app/ui/magic/EventDescriptorDelegate.qml b/nymea-app/ui/magic/EventDescriptorDelegate.qml index b891521e..30cef77d 100644 --- a/nymea-app/ui/magic/EventDescriptorDelegate.qml +++ b/nymea-app/ui/magic/EventDescriptorDelegate.qml @@ -34,7 +34,7 @@ import QtQuick.Layouts 1.3 import Nymea 1.0 import "../components" -NymeaListItemDelegate { +NymeaSwipeDelegate { id: root implicitHeight: app.delegateHeight canDelete: true diff --git a/nymea-app/ui/magic/NewMagicPage.qml b/nymea-app/ui/magic/NewMagicPage.qml index 6d81c91d..20500dae 100644 --- a/nymea-app/ui/magic/NewMagicPage.qml +++ b/nymea-app/ui/magic/NewMagicPage.qml @@ -58,7 +58,7 @@ Page { ruleTemplates: ruleTemplates } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { width: parent.width text: model.description } diff --git a/nymea-app/ui/magic/NewScenePage.qml b/nymea-app/ui/magic/NewScenePage.qml index 01d936be..59cd13fb 100644 --- a/nymea-app/ui/magic/NewScenePage.qml +++ b/nymea-app/ui/magic/NewScenePage.qml @@ -56,7 +56,7 @@ Page { } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { text: model.description } } diff --git a/nymea-app/ui/magic/NewThingMagicPage.qml b/nymea-app/ui/magic/NewThingMagicPage.qml index 9618c217..0315709e 100644 --- a/nymea-app/ui/magic/NewThingMagicPage.qml +++ b/nymea-app/ui/magic/NewThingMagicPage.qml @@ -522,7 +522,7 @@ Page { filterInterfaceNames: root.device ? root.device.deviceClass.interfaces : [] } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { width: parent.width text: model.description iconName: app.interfacesToIcon(model.interfaces) diff --git a/nymea-app/ui/magic/RuleActionDelegate.qml b/nymea-app/ui/magic/RuleActionDelegate.qml index 9e2e43aa..ee7587d1 100644 --- a/nymea-app/ui/magic/RuleActionDelegate.qml +++ b/nymea-app/ui/magic/RuleActionDelegate.qml @@ -34,7 +34,7 @@ import QtQuick.Layouts 1.3 import Nymea 1.0 import "../components" -NymeaListItemDelegate { +NymeaSwipeDelegate { id: root implicitHeight: app.delegateHeight canDelete: true diff --git a/nymea-app/ui/magic/ScriptsPage.qml b/nymea-app/ui/magic/ScriptsPage.qml index 0e75da5c..b5b14ee1 100644 --- a/nymea-app/ui/magic/ScriptsPage.qml +++ b/nymea-app/ui/magic/ScriptsPage.qml @@ -64,7 +64,7 @@ Page { ListView { anchors.fill: parent model: engine.scriptManager.scripts - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { width: parent.width text: model.name iconName: "../images/script.svg" diff --git a/nymea-app/ui/magic/SelectRuleActionPage.qml b/nymea-app/ui/magic/SelectRuleActionPage.qml index eb92a319..f6f18168 100644 --- a/nymea-app/ui/magic/SelectRuleActionPage.qml +++ b/nymea-app/ui/magic/SelectRuleActionPage.qml @@ -118,7 +118,7 @@ Page { anchors.fill: parent ScrollBar.vertical: ScrollBar {} - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { id: delegate text: model.displayName width: parent.width diff --git a/nymea-app/ui/magic/SelectRuleActionParamsPage.qml b/nymea-app/ui/magic/SelectRuleActionParamsPage.qml index 4cd0d767..55b94455 100644 --- a/nymea-app/ui/magic/SelectRuleActionParamsPage.qml +++ b/nymea-app/ui/magic/SelectRuleActionParamsPage.qml @@ -157,7 +157,7 @@ Page { } } - NymeaListItemDelegate { + NymeaSwipeDelegate { id: statePickerDelegate Layout.fillWidth: true text: deviceId === null || stateTypeId === null diff --git a/nymea-app/ui/magic/SelectStatePage.qml b/nymea-app/ui/magic/SelectStatePage.qml index 60e32ecb..3c9792ff 100644 --- a/nymea-app/ui/magic/SelectStatePage.qml +++ b/nymea-app/ui/magic/SelectStatePage.qml @@ -51,7 +51,7 @@ Page { model: device.deviceClass.stateTypes - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { width: parent.width iconName: "../images/state.svg" text: model.displayName diff --git a/nymea-app/ui/magic/SelectThingPage.qml b/nymea-app/ui/magic/SelectThingPage.qml index 69a7bee5..8e89fcda 100644 --- a/nymea-app/ui/magic/SelectThingPage.qml +++ b/nymea-app/ui/magic/SelectThingPage.qml @@ -88,7 +88,7 @@ Page { Layout.fillWidth: true } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Any %1").arg(app.interfaceToDisplayName(root.shownInterfaces[0])) visible: root.allowSelectAny @@ -116,7 +116,7 @@ Page { print("new checked state;", newCache[deviceId]) } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { width: parent.width text: root.selectInterface ? model.displayName : model.name iconName: root.selectInterface ? app.interfaceToIcon(model.name) : app.interfacesToIcon(model.interfaces) diff --git a/nymea-app/ui/magic/StateEvaluatorDelegate.qml b/nymea-app/ui/magic/StateEvaluatorDelegate.qml index 4671d6cb..e18d2139 100644 --- a/nymea-app/ui/magic/StateEvaluatorDelegate.qml +++ b/nymea-app/ui/magic/StateEvaluatorDelegate.qml @@ -153,7 +153,7 @@ ItemDelegate { method: "editInterfaceStateDescriptor" } } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { Layout.fillWidth: true iconName: model.iconName text: model.text diff --git a/nymea-app/ui/magic/TimeEventDelegate.qml b/nymea-app/ui/magic/TimeEventDelegate.qml index 98812f9c..81a39974 100644 --- a/nymea-app/ui/magic/TimeEventDelegate.qml +++ b/nymea-app/ui/magic/TimeEventDelegate.qml @@ -34,7 +34,7 @@ import QtQuick.Layouts 1.3 import Nymea 1.0 import "../components" -NymeaListItemDelegate{ +NymeaSwipeDelegate{ id: root implicitHeight: app.delegateHeight progressive: false diff --git a/nymea-app/ui/system/AboutNymeaPage.qml b/nymea-app/ui/system/AboutNymeaPage.qml index cbbc9757..308d6a67 100644 --- a/nymea-app/ui/system/AboutNymeaPage.qml +++ b/nymea-app/ui/system/AboutNymeaPage.qml @@ -45,35 +45,35 @@ SettingsPageBase { title: qsTr("%1:core").arg(app.systemName) githubLink: "https://github.com/nymea/nymea" - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Connection:") subText: engine.jsonRpcClient.currentConnection.url progressive: false prominentSubText: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Server UUID:") subText: engine.jsonRpcClient.serverUuid progressive: false prominentSubText: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Server version:") subText: engine.jsonRpcClient.serverVersion progressive: false prominentSubText: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("JSON-RPC version:") subText: engine.jsonRpcClient.jsonRpcVersion progressive: false prominentSubText: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Qt version:") visible: engine.jsonRpcClient.ensureServerVersion("4.1") diff --git a/nymea-app/ui/system/CloudSettingsPage.qml b/nymea-app/ui/system/CloudSettingsPage.qml index 48225289..dd7f2c27 100644 --- a/nymea-app/ui/system/CloudSettingsPage.qml +++ b/nymea-app/ui/system/CloudSettingsPage.qml @@ -163,7 +163,7 @@ SettingsPageBase { text: qsTr("In order to remotely connect to this %1:core, %2 needs to be logged into %1:cloud as well.").arg(app.systemName).arg(app.appName) } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Go to app settings") subText: qsTr("Set up cloud connection for %1").arg(app.appName) diff --git a/nymea-app/ui/system/ConnectionInterfaceDelegate.qml b/nymea-app/ui/system/ConnectionInterfaceDelegate.qml index 78b0b48d..e1a7158e 100644 --- a/nymea-app/ui/system/ConnectionInterfaceDelegate.qml +++ b/nymea-app/ui/system/ConnectionInterfaceDelegate.qml @@ -34,7 +34,7 @@ import QtQuick.Layouts 1.3 import Nymea 1.0 import "../components" -NymeaListItemDelegate { +NymeaSwipeDelegate { text: qsTr("Interface: %1").arg(model.address === "0.0.0.0" ? qsTr("Any") : model.address === "127.0.0.1" ? qsTr("localhost") : model.address) subText: qsTr("Port: %1").arg(model.port) iconName: "../images/connections/network-vpn.svg" diff --git a/nymea-app/ui/system/MqttBrokerSettingsPage.qml b/nymea-app/ui/system/MqttBrokerSettingsPage.qml index 02fe7d35..b1fb511c 100644 --- a/nymea-app/ui/system/MqttBrokerSettingsPage.qml +++ b/nymea-app/ui/system/MqttBrokerSettingsPage.qml @@ -91,7 +91,7 @@ SettingsPageBase { Repeater { model: engine.nymeaConfiguration.mqttPolicies - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { Layout.fillWidth: true iconName: "../images/account.svg" text: qsTr("Client ID: %1").arg(model.clientId) diff --git a/nymea-app/ui/system/MqttPolicyPage.qml b/nymea-app/ui/system/MqttPolicyPage.qml index a093ed52..7e851808 100644 --- a/nymea-app/ui/system/MqttPolicyPage.qml +++ b/nymea-app/ui/system/MqttPolicyPage.qml @@ -149,7 +149,7 @@ SettingsPageBase { Repeater { model: root.policy.allowedPublishTopicFilters - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { Layout.fillWidth: true text: modelData canDelete: true @@ -195,7 +195,7 @@ SettingsPageBase { } Repeater { model: root.policy.allowedSubscribeTopicFilters - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { Layout.fillWidth: true text: modelData canDelete: true diff --git a/nymea-app/ui/system/NetworkSettingsPage.qml b/nymea-app/ui/system/NetworkSettingsPage.qml index f7865de5..34cbc0b2 100644 --- a/nymea-app/ui/system/NetworkSettingsPage.qml +++ b/nymea-app/ui/system/NetworkSettingsPage.qml @@ -154,7 +154,7 @@ SettingsPageBase { visible: networkManager.available } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Current connection state") prominentSubText: false @@ -203,7 +203,7 @@ SettingsPageBase { } } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Networking enabled") subText: qsTr("Enable or disable networking altogether") @@ -257,7 +257,7 @@ SettingsPageBase { Repeater { model: networkManager.wiredNetworkDevices - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true iconName: model.pluggedIn ? "../images/connections/network-wired.svg" : "../images/connections/network-wired-offline.svg" text: model.interface + " (" + model.macAddress + ")" @@ -277,7 +277,7 @@ SettingsPageBase { visible: networkManager.available && networkManager.networkingEnabled } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Enabled") subText: qsTr("Enable or disable WiFi") @@ -326,7 +326,7 @@ SettingsPageBase { Repeater { model: networkManager.wirelessNetworkDevices - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true visible: networkManager.available && networkManager.networkingEnabled iconName: { @@ -430,7 +430,7 @@ SettingsPageBase { Repeater { id: listView model: apProxy - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { Layout.fillWidth: true text: model.ssid !== "" ? model.ssid : qsTr("Hidden Network") subText: "%1 (%2)".arg(model.macAddress).arg(model.frequency < 3 ? "2.4GHz" : "5GHz") @@ -527,39 +527,39 @@ SettingsPageBase { text: wirelessNetworkDevice.wirelessMode === WirelessNetworkDevice.WirelessModeAccessPoint ? qsTr("Hosting access point") : qsTr("Connected to") } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("SSID") subText: currentApPage.wirelessNetworkDevice.currentAccessPoint.ssid progressive: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("IPv4 Address") subText: currentApPage.wirelessNetworkDevice.ipv4Addresses.join(", ") progressive: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("IPv6 Address") subText: currentApPage.wirelessNetworkDevice.ipv6Addresses.join(", ") visible: subText.length > 0 progressive: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("MAC Address") subText: currentApPage.wirelessNetworkDevice.currentAccessPoint.macAddress progressive: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Signal strength") subText: currentApPage.wirelessNetworkDevice.currentAccessPoint.signalStrength + " %" progressive: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("WiFi frequency") subText: currentApPage.wirelessNetworkDevice.currentAccessPoint.frequency + " GHz" diff --git a/nymea-app/ui/system/PluginsPage.qml b/nymea-app/ui/system/PluginsPage.qml index 992cca66..3344eee1 100644 --- a/nymea-app/ui/system/PluginsPage.qml +++ b/nymea-app/ui/system/PluginsPage.qml @@ -64,7 +64,7 @@ SettingsPageBase { plugins: engine.deviceManager.plugins } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { Layout.fillWidth: true property var plugin: pluginsProxy.get(index) iconName: "../images/plugin.svg" diff --git a/nymea-app/ui/system/SystemUpdatePage.qml b/nymea-app/ui/system/SystemUpdatePage.qml index b43526fd..6a7cbf7e 100644 --- a/nymea-app/ui/system/SystemUpdatePage.qml +++ b/nymea-app/ui/system/SystemUpdatePage.qml @@ -185,7 +185,7 @@ Page { visible: count > 0 model: updatesModel clip: true - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { width: parent.width text: model.displayName subText: model.candidateVersion @@ -205,7 +205,7 @@ Page { ThinDivider {} - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Install or remove software") onClicked: { @@ -276,7 +276,7 @@ Page { id: filterModel packages: packageListPage.packages } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { width: parent.width text: model.displayName subText: model.candidateVersion @@ -337,14 +337,14 @@ Page { wrapMode: Text.WordWrap } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Installed version:") subText: packageDetailsPage.pkg.installedVersion.length > 0 ? packageDetailsPage.pkg.installedVersion : qsTr("Not installed") progressive: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Candidate version:") subText: packageDetailsPage.pkg.candidateVersion diff --git a/nymea-app/ui/system/UsersSettingsPage.qml b/nymea-app/ui/system/UsersSettingsPage.qml index 51ec3e48..74be0b27 100644 --- a/nymea-app/ui/system/UsersSettingsPage.qml +++ b/nymea-app/ui/system/UsersSettingsPage.qml @@ -42,7 +42,7 @@ SettingsPageBase { text: qsTr("User info") } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: userManager.userInfo.username subText: qsTr("Username") @@ -51,7 +51,7 @@ SettingsPageBase { iconName: "../images/account.svg" } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Change password") iconName: "../images/key.svg" @@ -70,7 +70,7 @@ SettingsPageBase { Repeater { model: userManager.tokenInfos - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { Layout.fillWidth: true text: model.deviceName subText: qsTr("Created on %1").arg(Qt.formatDateTime(model.creationTime, Qt.DefaultLocaleShortDate)) diff --git a/nymea-app/ui/system/ZigbeeAddNetworkPage.qml b/nymea-app/ui/system/ZigbeeAddNetworkPage.qml index 0ead853f..4e3dac0d 100644 --- a/nymea-app/ui/system/ZigbeeAddNetworkPage.qml +++ b/nymea-app/ui/system/ZigbeeAddNetworkPage.qml @@ -125,7 +125,7 @@ SettingsPageBase { onlyUnused: true } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { Layout.fillWidth: true iconName: "../images/zigbee.svg" text: model.backend + " - " + model.description + " - " + model.serialPort @@ -155,7 +155,7 @@ SettingsPageBase { onlyUnused: true } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { Layout.fillWidth: true property ZigbeeAdapter adapter: root.zigbeeManager.adapters.get(index) iconName: "../images/stock_usb.svg" diff --git a/nymea-app/ui/system/ZigbeeNetworkInfoPage.qml b/nymea-app/ui/system/ZigbeeNetworkInfoPage.qml index 0b1ecd68..2f986171 100644 --- a/nymea-app/ui/system/ZigbeeNetworkInfoPage.qml +++ b/nymea-app/ui/system/ZigbeeNetworkInfoPage.qml @@ -52,7 +52,7 @@ SettingsPageBase { text: qsTr("Hardware information") } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("MAC address:") subText: root.network.macAddress @@ -60,7 +60,7 @@ SettingsPageBase { prominentSubText: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Serial port") subText: root.network.serialPort @@ -68,7 +68,7 @@ SettingsPageBase { prominentSubText: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Baud rate") subText: root.network.baudRate @@ -76,7 +76,7 @@ SettingsPageBase { prominentSubText: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Controller backend") subText: root.network.backend @@ -84,7 +84,7 @@ SettingsPageBase { prominentSubText: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Controller firmware version") subText: root.network.firmwareVersion diff --git a/nymea-app/ui/system/ZigbeeNetworkPage.qml b/nymea-app/ui/system/ZigbeeNetworkPage.qml index d3ee2247..b451d0e5 100644 --- a/nymea-app/ui/system/ZigbeeNetworkPage.qml +++ b/nymea-app/ui/system/ZigbeeNetworkPage.qml @@ -57,7 +57,7 @@ SettingsPageBase { text: qsTr("Network information") } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Network state") subText: { @@ -78,14 +78,14 @@ SettingsPageBase { progressive: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Channel") subText: root.network.channel progressive: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Network PAN ID") subText: root.network.panId @@ -96,7 +96,7 @@ SettingsPageBase { text: qsTr("Network control") } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: root.network.permitJoiningEnabled ? qsTr("The network is open") : qsTr("The network is closed") subText: root.network.permitJoiningEnabled ? qsTr("Devices can join this network") : qsTr("Devices are not allowed to join this network") diff --git a/nymea-app/ui/system/ZigbeeSettingsPage.qml b/nymea-app/ui/system/ZigbeeSettingsPage.qml index a100936c..c0003e9f 100644 --- a/nymea-app/ui/system/ZigbeeSettingsPage.qml +++ b/nymea-app/ui/system/ZigbeeSettingsPage.qml @@ -59,7 +59,7 @@ SettingsPageBase { // text: qsTr("General") // } -// NymeaListItemDelegate { +// NymeaSwipeDelegate { // Layout.fillWidth: true // text: qsTr("Zigbee enabled") // subText: qsTr("Enable or disable Zigbee altogether") @@ -84,7 +84,7 @@ SettingsPageBase { Repeater { model: zigbeeManager.networks - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { Layout.fillWidth: true property var network: zigbeeManager.networks.get(index) iconName: "../images/zigbee.svg" diff --git a/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml b/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml index 0966dc98..5e635673 100644 --- a/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml +++ b/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml @@ -121,20 +121,20 @@ SettingsPageBase { text: qsTr("Information") } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Vendor:") subText: engine.deviceManager.vendors.getVendor(root.deviceClass.vendorId).displayName progressive: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Type:") subText: root.deviceClass.displayName progressive: false } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("ID:") subText: root.device.id.toString().replace(/[{}]/g, "") @@ -145,7 +145,7 @@ SettingsPageBase { } } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: qsTr("Thing class") subText: qsTr("View the type definition for this thing") @@ -184,7 +184,7 @@ SettingsPageBase { } Repeater { model: ioModel - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { Layout.fillWidth: true iconName: "../images/io-connections.svg" diff --git a/nymea-app/ui/thingconfiguration/NewThingPage.qml b/nymea-app/ui/thingconfiguration/NewThingPage.qml index 0a6c120d..50d94d76 100644 --- a/nymea-app/ui/thingconfiguration/NewThingPage.qml +++ b/nymea-app/ui/thingconfiguration/NewThingPage.qml @@ -158,7 +158,7 @@ Page { groupByInterface: true } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { id: deviceClassDelegate width: parent.width text: model.displayName diff --git a/nymea-app/ui/thingconfiguration/SetupWizard.qml b/nymea-app/ui/thingconfiguration/SetupWizard.qml index 83c2170e..967fcf8b 100644 --- a/nymea-app/ui/thingconfiguration/SetupWizard.qml +++ b/nymea-app/ui/thingconfiguration/SetupWizard.qml @@ -263,7 +263,7 @@ Page { showNew: root.device === null filterDeviceId: root.device ? root.device.id : "" } - delegate: NymeaListItemDelegate { + delegate: NymeaSwipeDelegate { width: parent.width height: app.delegateHeight text: model.name diff --git a/nymea-app/ui/thingconfiguration/ThingClassDetailsPage.qml b/nymea-app/ui/thingconfiguration/ThingClassDetailsPage.qml index 5b7236c8..75fbbe88 100644 --- a/nymea-app/ui/thingconfiguration/ThingClassDetailsPage.qml +++ b/nymea-app/ui/thingconfiguration/ThingClassDetailsPage.qml @@ -49,7 +49,7 @@ SettingsPageBase { text: qsTr("Type") } - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: root.thingClass.displayName subText: root.thingClass.id.toString().replace(/[{}]/g, "") @@ -63,7 +63,7 @@ SettingsPageBase { Repeater { model: root.thingClass.paramTypes - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: root.thingClass.paramTypes.get(index).displayName subText: root.thingClass.paramTypes.get(index).id.toString().replace(/[{}]/g, "") @@ -82,7 +82,7 @@ SettingsPageBase { Repeater { model: root.thingClass.settingsTypes - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: root.thingClass.settingsTypes.get(index).displayName subText: root.thingClass.settingsTypes.get(index).id.toString().replace(/[{}]/g, "") @@ -101,7 +101,7 @@ SettingsPageBase { Repeater { model: root.thingClass.eventTypes - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: root.thingClass.eventTypes.get(index).displayName subText: root.thingClass.eventTypes.get(index).id.toString().replace(/[{}]/g, "") @@ -120,7 +120,7 @@ SettingsPageBase { Repeater { model: root.thingClass.stateTypes - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: root.thingClass.stateTypes.get(index).displayName subText: root.thingClass.stateTypes.get(index).id.toString().replace(/[{}]/g, "") @@ -139,7 +139,7 @@ SettingsPageBase { Repeater { model: root.thingClass.actionTypes - NymeaListItemDelegate { + NymeaSwipeDelegate { Layout.fillWidth: true text: root.thingClass.actionTypes.get(index).displayName subText: root.thingClass.actionTypes.get(index).id.toString().replace(/[{}]/g, "")