From 5b7028def1e6a25c7d85e34fa125dee4644224c0 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Fri, 4 Dec 2020 00:38:06 +0100 Subject: [PATCH 1/2] Move main view configuration into menu --- nymea-app/ui/MainMenu.qml | 12 ++++++++++++ nymea-app/ui/MainPage.qml | 12 +++++------- nymea-app/ui/Nymea.qml | 1 + nymea-app/ui/RootItem.qml | 5 +++++ nymea-app/ui/devicepages/DevicePageBase.qml | 2 +- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/nymea-app/ui/MainMenu.qml b/nymea-app/ui/MainMenu.qml index 6da8c48f..1164507f 100644 --- a/nymea-app/ui/MainMenu.qml +++ b/nymea-app/ui/MainMenu.qml @@ -13,6 +13,7 @@ Drawer { signal openMagicSettings(); signal openAppSettings(); signal openSystemSettings(); + signal configureMainView(); signal startWirelessSetup(); signal startManualConnection(); @@ -161,6 +162,17 @@ Drawer { root.close(); } } + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("Configure main view") + iconName: "../images/configure.svg" + progressive: false + visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost + onClicked: { + root.configureMainView(); + root.close(); + } + } NymeaItemDelegate { diff --git a/nymea-app/ui/MainPage.qml b/nymea-app/ui/MainPage.qml index a699a761..d0b6353a 100644 --- a/nymea-app/ui/MainPage.qml +++ b/nymea-app/ui/MainPage.qml @@ -43,13 +43,17 @@ import "mainviews" Page { id: root + function configureViews() { + d.configOverlay = configComponent.createObject(contentContainer) + } + header: ToolBar { id: mainHeader RowLayout { anchors.fill: parent HeaderButton { - imageSource: "qrc:/styles/%1/logo.svg".arg(styleController.currentStyle) + imageSource: "../images/navigation-menu.svg" onClicked: { if (d.configOverlay != null) { d.configOverlay.destroy(); @@ -64,12 +68,6 @@ Page { qsTr("Configure main view") : swipeView.currentItem.item.title.length > 0 ? swipeView.currentItem.item.title : filteredContentModel.data(swipeView.currentIndex, "displayName") } - - HeaderButton { - imageSource: "../images/settings.svg" - visible: d.configOverlay == null - onClicked: d.configOverlay = configComponent.createObject(contentContainer) - } } } diff --git a/nymea-app/ui/Nymea.qml b/nymea-app/ui/Nymea.qml index 470716d4..f016ac9f 100644 --- a/nymea-app/ui/Nymea.qml +++ b/nymea-app/ui/Nymea.qml @@ -109,6 +109,7 @@ ApplicationWindow { onOpenMagicSettings: rootItem.openMagicSettings(); onOpenAppSettings: rootItem.openAppSettings(); onOpenSystemSettings: rootItem.openSystemSettings(); + onConfigureMainView: rootItem.configureMainView(); onStartManualConnection: rootItem.startManualConnection(); onStartWirelessSetup: rootItem.startWirelessSetup(); onStartDemoMode: rootItem.startDemoMode(); diff --git a/nymea-app/ui/RootItem.qml b/nymea-app/ui/RootItem.qml index 4c99d049..dc610b44 100644 --- a/nymea-app/ui/RootItem.qml +++ b/nymea-app/ui/RootItem.qml @@ -72,6 +72,11 @@ Item { function openSystemSettings() { d.pushSettingsPage("SettingsPage.qml") } + function configureMainView() { + swipeView.currentItem.pageStack.pop(null) + swipeView.currentItem.pageStack.currentItem.configureViews() + } + function startManualConnection() { d.pushSettingsPage("connection/ManualConnectPage.qml") } diff --git a/nymea-app/ui/devicepages/DevicePageBase.qml b/nymea-app/ui/devicepages/DevicePageBase.qml index 0c732ac2..b256a7fd 100644 --- a/nymea-app/ui/devicepages/DevicePageBase.qml +++ b/nymea-app/ui/devicepages/DevicePageBase.qml @@ -91,7 +91,7 @@ Page { if (root.showDetailsButton) { thingMenu.addItem(menuEntryComponent.createObject(thingMenu, {text: qsTr("Details"), iconSource: "../images/info.svg", functionName: "openGenericDevicePage"})) } - thingMenu.addItem(menuEntryComponent.createObject(thingMenu, {text: qsTr("Settings"), iconSource: "../images/configure.svg", functionName: "openThingSettingsPage"})) +// thingMenu.addItem(menuEntryComponent.createObject(thingMenu, {text: qsTr("Settings"), iconSource: "../images/configure.svg", functionName: "openThingSettingsPage"})) if (root.showLogsButton) { thingMenu.addItem(menuEntryComponent.createObject(thingMenu, {text: qsTr("Logs"), iconSource: "../images/logs.svg", functionName: "openDeviceLogPage"})) } From be3834eb1d2ac70bf37c24e24684e204697e5b54 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Fri, 4 Dec 2020 13:16:06 +0100 Subject: [PATCH 2/2] Some more entries in the main menu --- nymea-app/images.qrc | 3 + nymea-app/ui/MainMenu.qml | 47 ++++++--- nymea-app/ui/images/discord.svg | 67 ++++++++++++ nymea-app/ui/images/facebook.svg | 34 +++++++ nymea-app/ui/images/help.svg | 168 +++++++++++++++++++++++++++++++ 5 files changed, 305 insertions(+), 14 deletions(-) create mode 100644 nymea-app/ui/images/discord.svg create mode 100644 nymea-app/ui/images/facebook.svg create mode 100644 nymea-app/ui/images/help.svg diff --git a/nymea-app/images.qrc b/nymea-app/images.qrc index 0c6a5287..3782deca 100644 --- a/nymea-app/images.qrc +++ b/nymea-app/images.qrc @@ -246,5 +246,8 @@ ui/images/twitter.svg ui/images/discourse.svg ui/images/telegram.svg + ui/images/facebook.svg + ui/images/help.svg + ui/images/discord.svg diff --git a/nymea-app/ui/MainMenu.qml b/nymea-app/ui/MainMenu.qml index 1164507f..855070fe 100644 --- a/nymea-app/ui/MainMenu.qml +++ b/nymea-app/ui/MainMenu.qml @@ -141,6 +141,17 @@ Drawer { root.close(); } } + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("Configure main view") + iconName: "../images/configure.svg" + progressive: false + visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost + onClicked: { + root.configureMainView(); + root.close(); + } + } NymeaItemDelegate { Layout.fillWidth: true text: qsTr("App settings") @@ -162,22 +173,18 @@ Drawer { root.close(); } } - NymeaItemDelegate { - Layout.fillWidth: true - text: qsTr("Configure main view") - iconName: "../images/configure.svg" - progressive: false - visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost - onClicked: { - root.configureMainView(); - root.close(); - } - } NymeaItemDelegate { Layout.fillWidth: true Layout.topMargin: app.margins + text: qsTr("Help") + iconName: "../images/help.svg" + progressive: false + onClicked: Qt.openUrlExternally("https://nymea.io/documentation/users/usage/first-steps") + } + NymeaItemDelegate { + Layout.fillWidth: true text: qsTr("Forum") iconName: "../images/discourse.svg" progressive: false @@ -190,6 +197,13 @@ Drawer { progressive: false onClicked: Qt.openUrlExternally("https://t.me/nymeacommunity") } + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("Discord") + iconName: "../images/discord.svg" + progressive: false + onClicked: Qt.openUrlExternally("https://discord.gg/tX9YCpD") + } NymeaItemDelegate { Layout.fillWidth: true text: qsTr("Twitter") @@ -197,10 +211,15 @@ Drawer { progressive: false onClicked: Qt.openUrlExternally("https://twitter.com/nymea_io") } + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("Facebook") + iconName: "../images/facebook.svg" + progressive: false + onClicked: Qt.openUrlExternally("https://m.facebook.com/groups/nymea") + } } - } - } - + } } diff --git a/nymea-app/ui/images/discord.svg b/nymea-app/ui/images/discord.svg new file mode 100644 index 00000000..4fec6dd0 --- /dev/null +++ b/nymea-app/ui/images/discord.svg @@ -0,0 +1,67 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/nymea-app/ui/images/facebook.svg b/nymea-app/ui/images/facebook.svg new file mode 100644 index 00000000..b8863f4a --- /dev/null +++ b/nymea-app/ui/images/facebook.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/nymea-app/ui/images/help.svg b/nymea-app/ui/images/help.svg new file mode 100644 index 00000000..efeda013 --- /dev/null +++ b/nymea-app/ui/images/help.svg @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + +