From 9af0705257c08a2e31473eb069bc8e4a99cfd76f Mon Sep 17 00:00:00 2001 From: Emeric Date: Tue, 16 Apr 2024 12:51:15 +0200 Subject: [PATCH] Various fixes --- qml/About.qml | 57 ++++++++++++++------------ qml/DeviceEnvironmental.qml | 2 +- qml/DevicePlantSensorCare.qml | 24 +++++------ qml/DevicePlantSensorHistory.qml | 24 +++++------ qml/MobileDrawer.qml | 6 +-- qml/components/ActionMenuFixed.qml | 23 +++++++++++ qml/components/AirQualityIndicator.qml | 3 +- qml/popups/PopupBackgroundUpdates.qml | 2 +- qml/widgets/SunAndMoonWidget.qml | 18 ++++---- src/NotificationManager.h | 2 +- 10 files changed, 94 insertions(+), 67 deletions(-) diff --git a/qml/About.qml b/qml/About.qml index e8e32ee1..e1240599 100644 --- a/qml/About.qml +++ b/qml/About.qml @@ -198,7 +198,7 @@ Loader { ListItem { // description width: parent.width text: qsTr("A plant monitoring application that reads and plots data from compatible Bluetooth sensors and thermometers like Xiaomi 'Flower Care' or Parrot 'Flower Power'.") - source: "qrc:/assets/icons/material-symbols/info-fill.svg" + source: "qrc:/assets/icons/material-symbols/info.svg" } IconSvg { // image devices @@ -242,57 +242,58 @@ Loader { } } - ListItemClickable { // tutorial + ListItemClickable { // release notes width: parent.width - text: qsTr("Open the tutorial") - source: "qrc:/assets/icons/material-symbols/import_contacts-fill.svg" + text: qsTr("Release notes") + source: "qrc:/assets/icons/material-symbols/new_releases.svg" sourceSize: 28 - indicatorSource: "qrc:/assets/icons/material-symbols/chevron_right.svg" + indicatorSource: "qrc:/assets/icons/material-icons/duotone/launch.svg" - onClicked: screenTutorial.loadScreenFrom("About") + onClicked: Qt.openUrlExternally("https://github.com/emericg/WatchFlower/releases") } - //////// - ListSeparator { visible: (Qt.platform.os === "android" || Qt.platform.os === "ios") } - - ListItemClickable { // permissions + ListItemClickable { // supported sensors width: parent.width - visible: (Qt.platform.os === "android" || Qt.platform.os === "ios") - text: qsTr("About app permissions") - source: "qrc:/assets/icons/material-symbols/flaky.svg" - sourceSize: 24 - indicatorSource: "qrc:/assets/icons/material-symbols/chevron_right.svg" + text: qsTr("Supported sensors") + source: "qrc:/assets/icons/material-symbols/check_circle.svg" + sourceSize: 28 + indicatorSource: "qrc:/assets/icons/material-icons/duotone/launch.svg" - onClicked: screenAboutPermissions.loadScreenFrom("About") + onClicked: Qt.openUrlExternally("https://github.com/emericg/WatchFlower/blob/master/docs/README.md") } + //////// + ListSeparator { } - ListItemClickable { // release notes + ListItemClickable { // tutorial width: parent.width - text: qsTr("Release notes") - source: "qrc:/assets/icons/material-symbols/new_releases.svg" + text: qsTr("Open the tutorial") + source: "qrc:/assets/icons/material-symbols/import_contacts-fill.svg" sourceSize: 24 - indicatorSource: "qrc:/assets/icons/material-icons/duotone/launch.svg" + indicatorSource: "qrc:/assets/icons/material-symbols/chevron_right.svg" - onClicked: Qt.openUrlExternally("https://github.com/emericg/WatchFlower/releases") + onClicked: screenTutorial.loadScreenFrom("About") } - ListSeparator { } + //////// - ListItemClickable { // supported sensors + ListSeparator { visible: (Qt.platform.os === "android" || Qt.platform.os === "ios") } + + ListItemClickable { // permissions width: parent.width + visible: (Qt.platform.os === "android" || Qt.platform.os === "ios") - text: qsTr("Supported sensors") - source: "qrc:/assets/icons/material-symbols/check_circle.svg" + text: qsTr("About app permissions") + source: "qrc:/assets/icons/material-symbols/flaky.svg" sourceSize: 24 - indicatorSource: "qrc:/assets/icons/material-icons/duotone/launch.svg" + indicatorSource: "qrc:/assets/icons/material-symbols/chevron_right.svg" - onClicked: Qt.openUrlExternally("https://github.com/emericg/WatchFlower/blob/master/docs/README.md") + onClicked: screenAboutPermissions.loadScreenFrom("About") } ListSeparator { } @@ -434,6 +435,8 @@ Loader { } } + ListSeparator { } + //////// } } diff --git a/qml/DeviceEnvironmental.qml b/qml/DeviceEnvironmental.qml index c3edc1cf..2f9bd8f0 100644 --- a/qml/DeviceEnvironmental.qml +++ b/qml/DeviceEnvironmental.qml @@ -1100,7 +1100,7 @@ Loader { title: qsTr("Temperature") legend: "°" + settingsManager.tempUnit - icon: "qrc:/assets/gfx/icons/thermometer.svg" + icon: "qrc:/assets/gfx/icons/thermometer-24px.svg" value: currentDevice.temperature precision: 1 onSensorSelection: primary = "hygrometer" diff --git a/qml/DevicePlantSensorCare.qml b/qml/DevicePlantSensorCare.qml index e203ab73..c2800b61 100644 --- a/qml/DevicePlantSensorCare.qml +++ b/qml/DevicePlantSensorCare.qml @@ -120,13 +120,13 @@ Item { anchors.verticalCenter: parent.verticalCenter spacing: Theme.componentMargin - ButtonWireframe { + ButtonClear { width: 100 height: isPhone ? 32 : 36 - //fullColor: (plantInfos.visible) - //primaryColor: Theme.colorPrimary - //secondaryColor: Theme.colorBackground + color: Theme.colorPrimary + colorBackground: plantInfos.visible ? color : Qt.rgba(color.r, color.g, color.b, 0.2) + colorText: plantInfos.visible ? "white" : color text: qsTr("Plant") onClicked: { @@ -137,13 +137,13 @@ Item { } } - ButtonWireframe { + ButtonClear { width: 100 height: isPhone ? 32 : 36 - //fullColor: (plantLimits.visible) - //primaryColor: Theme.colorPrimary - //secondaryColor: Theme.colorBackground + color: Theme.colorPrimary + colorBackground: plantLimits.visible ? color : Qt.rgba(color.r, color.g, color.b, 0.2) + colorText: plantLimits.visible ? "white" : color text: qsTr("Limits") onClicked: { @@ -153,13 +153,13 @@ Item { } } - ButtonWireframe { + ButtonClear { width: 100 height: isPhone ? 32 : 36 - //fullColor: (plantJournal.visible) - //primaryColor: Theme.colorPrimary - //secondaryColor: Theme.colorBackground + color: Theme.colorPrimary + colorBackground: plantJournal.visible ? color : Qt.rgba(color.r, color.g, color.b, 0.2) + colorText: plantJournal.visible ? "white" : color text: qsTr("Journal") onClicked: { diff --git a/qml/DevicePlantSensorHistory.qml b/qml/DevicePlantSensorHistory.qml index e04957b8..2a5b9586 100644 --- a/qml/DevicePlantSensorHistory.qml +++ b/qml/DevicePlantSensorHistory.qml @@ -282,13 +282,13 @@ Item { anchors.verticalCenter: parent.verticalCenter spacing: Theme.componentMargin - ButtonWireframe { + ButtonClear { width: 100 height: isPhone ? 32 : 36 - //fullColor: (settingsManager.graphHistory === "monthly") - //primaryColor: Theme.colorPrimary - //secondaryColor: Theme.colorBackground + color: Theme.colorPrimary + colorBackground: (settingsManager.graphHistory === "monthly") ? color : Qt.rgba(color.r, color.g, color.b, 0.2) + colorText: (settingsManager.graphHistory === "monthly") ? "white" : color text: qsTr("Month") onClicked: { @@ -301,13 +301,13 @@ Item { } } - ButtonWireframe { + ButtonClear { width: 100 height: isPhone ? 32 : 36 - //fullColor: (settingsManager.graphHistory === "weekly") - //primaryColor: Theme.colorPrimary - //secondaryColor: Theme.colorBackground + color: Theme.colorPrimary + colorBackground: (settingsManager.graphHistory === "weekly") ? color : Qt.rgba(color.r, color.g, color.b, 0.2) + colorText: (settingsManager.graphHistory === "weekly") ? "white" : color text: qsTr("Week") onClicked: { @@ -320,13 +320,13 @@ Item { } } - ButtonWireframe { + ButtonClear { width: 100 height: isPhone ? 32 : 36 - //fullColor: (settingsManager.graphHistory === "daily") - //primaryColor: Theme.colorPrimary - //secondaryColor: Theme.colorBackground + color: Theme.colorPrimary + colorBackground: (settingsManager.graphHistory === "daily") ? color : Qt.rgba(color.r, color.g, color.b, 0.2) + colorText: (settingsManager.graphHistory === "daily") ? "white" : color text: qsTr("Day") onClicked: { diff --git a/qml/MobileDrawer.qml b/qml/MobileDrawer.qml index 6855710c..46734aa3 100644 --- a/qml/MobileDrawer.qml +++ b/qml/MobileDrawer.qml @@ -98,7 +98,7 @@ DrawerThemed { DrawerItem { highlighted: (appContent.state === "Settings" || appContent.state === "SettingsAdvanced") text: qsTr("Settings") - source: "qrc:/assets/icons/material-symbols/settings.svg" + source: "qrc:/assets/icons/material-icons/duotone/tune.svg" onClicked: { screenSettings.loadScreen() @@ -109,7 +109,7 @@ DrawerThemed { DrawerItem { highlighted: (appContent.state === "About" || appContent.state === "AboutPermissions") text: qsTr("About") - source: "qrc:/assets/icons/material-symbols/info-fill.svg" + source: "qrc:/assets/icons/material-icons/duotone/info.svg" onClicked: { screenAbout.loadScreen() @@ -201,7 +201,7 @@ DrawerThemed { DrawerButton { text: qsTr("Sync sensors history") - source: "qrc:/assets/gfx/icons/duotone-date_all-24px.svg" + source: "qrc:/assets/icons/material-symbols/merge_type.svg" iconAnimation: "fade" iconAnimated: deviceManager.syncing diff --git a/qml/components/ActionMenuFixed.qml b/qml/components/ActionMenuFixed.qml index b8b9dc6d..b626bae9 100644 --- a/qml/components/ActionMenuFixed.qml +++ b/qml/components/ActionMenuFixed.qml @@ -54,6 +54,29 @@ T.Popup { //////// + ActionMenuItem { + id: actionClose + width: parent.width + + index: -1 + text: qsTr("Close") + source: "qrc:/assets/icons/material-symbols/close.svg" + layoutDirection: actionMenu.layoutDirection + opacity: 0.8 + + onClicked: { + close() + } + } + + ListSeparatorPadded { + anchors.leftMargin: Theme.componentMargin + anchors.rightMargin: Theme.componentMargin + height: 9 + } + + //////// + ActionMenuItem { id: actionUpdate width: parent.width diff --git a/qml/components/AirQualityIndicator.qml b/qml/components/AirQualityIndicator.qml index 7f8f0aca..f5b6cdd6 100644 --- a/qml/components/AirQualityIndicator.qml +++ b/qml/components/AirQualityIndicator.qml @@ -106,7 +106,8 @@ Item { color: indicatorAirQuality.color smooth: true opacity: 0.6 - source: "qrc:/assets/icons_fontawesome/lungs-solid.svg" + source: "qrc:/assets/icons/fontawesome/lungs-solid.svg" + //source: "qrc:/assets/icons/material-symbols/sensors/pulmonology.svg" property real minOpacity: 0.4 property real maxOpacity: 0.85 diff --git a/qml/popups/PopupBackgroundUpdates.qml b/qml/popups/PopupBackgroundUpdates.qml index 26875e7a..168733c9 100644 --- a/qml/popups/PopupBackgroundUpdates.qml +++ b/qml/popups/PopupBackgroundUpdates.qml @@ -164,7 +164,7 @@ Popup { height: 64 anchors.horizontalCenter: parent.horizontalCenter - source: "qrc:/assets/icons/material-symbols/battery_alert.svg" + source: "qrc:/assets/icons/material-icons/duotone/battery_alert.svg" color: Theme.colorText } diff --git a/qml/widgets/SunAndMoonWidget.qml b/qml/widgets/SunAndMoonWidget.qml index ff168219..7b6bee41 100644 --- a/qml/widgets/SunAndMoonWidget.qml +++ b/qml/widgets/SunAndMoonWidget.qml @@ -103,14 +103,14 @@ Item { } */ source: { - if (sunAndMoon.moonphaseName === "New") return "qrc:/assets/gfx/icons/moon_1.svg" - if (sunAndMoon.moonphaseName === "Evening Crescent") return "qrc:/assets/gfx/icons/moon_2.svg" - if (sunAndMoon.moonphaseName === "First Quarter") return "qrc:/assets/gfx/icons/moon_3.svg" - if (sunAndMoon.moonphaseName === "Waxing Gibbous") return "qrc:/assets/gfx/icons/moon_3.svg" - if (sunAndMoon.moonphaseName === "Full") return "qrc:/assets/gfx/icons/moon_4.svg" - if (sunAndMoon.moonphaseName === "Waning Gibbous") return "qrc:/assets/gfx/icons/moon_3.svg" - if (sunAndMoon.moonphaseName === "Last Quarter") return "qrc:/assets/gfx/icons/moon_3.svg" - if (sunAndMoon.moonphaseName === "Morning Crescent") return "qrc:/assets/gfx/icons/moon_2.svg" + if (sunAndMoon.moonphaseName === "New") return "qrc:/assets/icons/material-symbols/weather/brightness_1-fill.svg" + if (sunAndMoon.moonphaseName === "Evening Crescent") return "qrc:/assets/icons/material-symbols/weather/brightness_3.svg" + if (sunAndMoon.moonphaseName === "First Quarter") return "qrc:/assets/icons/material-symbols/weather/brightness_2.svg" + if (sunAndMoon.moonphaseName === "Waxing Gibbous") return "qrc:/assets/icons/material-symbols/weather/brightness_2.svg" + if (sunAndMoon.moonphaseName === "Full") return "qrc:/assets/icons/material-symbols/weather/brightness_1.svg" + if (sunAndMoon.moonphaseName === "Waning Gibbous") return "qrc:/assets/icons/material-symbols/weather/brightness_2.svg" + if (sunAndMoon.moonphaseName === "Last Quarter") return "qrc:/assets/icons/material-symbols/weather/brightness_3.svg" + if (sunAndMoon.moonphaseName === "Morning Crescent") return "qrc:/assets/icons/material-symbols/weather/brightness_2.svg" } color: Theme.colorIcon } @@ -258,7 +258,7 @@ Item { IconSvg { width: 40 height: 40 - source: "qrc:/assets/icons/material-symbols/weather/brightness_5.svg" + source: "qrc:/assets/icons/material-symbols/weather/sunny.svg" color: Theme.colorIcon } Column { diff --git a/src/NotificationManager.h b/src/NotificationManager.h index dfa667c7..cb18911d 100644 --- a/src/NotificationManager.h +++ b/src/NotificationManager.h @@ -50,7 +50,7 @@ class NotificationManager : public QObject bool hasPermissionOS() const { return m_permOS; } #if defined(Q_OS_IOS) - UtilsIOSNotifications m_iosnotifier; + //UtilsIOSNotifications m_iosnotifier; #endif // Singleton