From d2f738ba7d3a9e016ee4d2f10a585e4325c72354 Mon Sep 17 00:00:00 2001 From: Carlo Baratto Date: Wed, 2 Sep 2026 14:20:27 +0200 Subject: [PATCH] menu Impostazioni anche nella home; Sea state spostato in alto nel dettaglio (sotto la card porto vicino) --- qml/pages/DetailPage.qml | 18 +++++++++--------- qml/pages/MainPage.qml | 12 ++++++++++++ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/qml/pages/DetailPage.qml b/qml/pages/DetailPage.qml index 4bcea53..a9606cb 100644 --- a/qml/pages/DetailPage.qml +++ b/qml/pages/DetailPage.qml @@ -230,6 +230,15 @@ Page { } } + // Stato del mare (scala Douglas, previsione onde Open-Meteo) + Item { width: parent.width; height: Theme.itemSizeSmall + Label { text: "🌊 " + qsTranslate("Sea", "Sea state"); color: Theme.secondaryColor; anchors.left: parent.left; anchors.leftMargin: Theme.horizontalPageMargin; anchors.verticalCenter: parent.verticalCenter } + Label { id: seaLabel; text: "…"; anchors.left: parent.left; anchors.leftMargin: Theme.horizontalPageMargin + 130; anchors.right: parent.right; anchors.rightMargin: Theme.horizontalPageMargin; anchors.verticalCenter: parent.verticalCenter; horizontalAlignment: Text.AlignRight; truncationMode: TruncationMode.Fade } + } + Item { width: parent.width; height: Theme.itemSizeSmall + Label { id: seaSub; anchors.left: parent.left; anchors.leftMargin: Theme.horizontalPageMargin + 130; anchors.right: parent.right; anchors.rightMargin: Theme.horizontalPageMargin; anchors.verticalCenter: parent.verticalCenter; horizontalAlignment: Text.AlignRight; font.pixelSize: Theme.fontSizeSmall; truncationMode: TruncationMode.Fade } + } + // Intervallo (chips 24/48/72) Row { spacing: Theme.paddingMedium @@ -367,15 +376,6 @@ Page { Label { id: rangeLabel; anchors.right: parent.right; anchors.rightMargin: Theme.horizontalPageMargin; anchors.verticalCenter: parent.verticalCenter } } - // Stato del mare (scala Douglas, previsione onde Open-Meteo) - Item { width: parent.width; height: Theme.itemSizeSmall - Label { text: "🌊 " + qsTranslate("Sea", "Sea state"); color: Theme.secondaryColor; anchors.left: parent.left; anchors.leftMargin: Theme.horizontalPageMargin; anchors.verticalCenter: parent.verticalCenter } - Label { id: seaLabel; text: "…"; anchors.left: parent.left; anchors.leftMargin: Theme.horizontalPageMargin + 130; anchors.right: parent.right; anchors.rightMargin: Theme.horizontalPageMargin; anchors.verticalCenter: parent.verticalCenter; horizontalAlignment: Text.AlignRight; truncationMode: TruncationMode.Fade } - } - Item { width: parent.width; height: Theme.itemSizeSmall - Label { id: seaSub; anchors.left: parent.left; anchors.leftMargin: Theme.horizontalPageMargin + 130; anchors.right: parent.right; anchors.rightMargin: Theme.horizontalPageMargin; anchors.verticalCenter: parent.verticalCenter; horizontalAlignment: Text.AlignRight; font.pixelSize: Theme.fontSizeSmall; truncationMode: TruncationMode.Fade } - } - Item { width: parent.width; height: Theme.paddingLarge } } } diff --git a/qml/pages/MainPage.qml b/qml/pages/MainPage.qml index 6a45a38..f16b68f 100644 --- a/qml/pages/MainPage.qml +++ b/qml/pages/MainPage.qml @@ -6,6 +6,13 @@ import "../js/comuni.js" as Comuni Page { id: page + PullDownMenu { + MenuItem { + text: qsTr("Settings") + onClicked: page.openSettings() + } + } + // Campi di ricerca FUORI dall'header della lista: gli id dichiarati nel // componente header hanno scope chiuso e le funzioni del Page non li // vedono (ReferenceError "filter is not defined"). @@ -174,6 +181,11 @@ Page { page.openDetail([name, qsTr("Italy"), lat, lon, cost, flag], -1, true) } + function openSettings() { + console.log("[tide] openSettings") + pageStack.push(Qt.resolvedUrl("SettingsPage.qml")) + } + // --- Ricerca online (geocoding Photon) per città estere / non trovate --- function geoFound(name, lat, lon, src) { console.log("[tide] geoFound:", name, lat, lon, src)