From 6415112f9ab5d7c8f4f9e000070a53c230d5c384 Mon Sep 17 00:00:00 2001 From: vini Date: Sun, 19 Jul 2026 10:52:05 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20latitude/longitude=20configur=C3=A1veis?= =?UTF-8?q?=20para=20o=20c=C3=A9u=20realista?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Padrão Toledo-PR (-24.72, -53.74); campos aceitam vírgula ou ponto. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_015HtPHsTnDcLVSCiF5FGHZj --- plugin/contents/config/main.xml | 6 ++++++ plugin/contents/ui/config.qml | 25 +++++++++++++++++++++++++ plugin/contents/ui/main.qml | 4 ++++ 3 files changed, 35 insertions(+) diff --git a/plugin/contents/config/main.xml b/plugin/contents/config/main.xml index bc52416..58bb539 100644 --- a/plugin/contents/config/main.xml +++ b/plugin/contents/config/main.xml @@ -14,5 +14,11 @@ false + + -24.72 + + + -53.74 + diff --git a/plugin/contents/ui/config.qml b/plugin/contents/ui/config.qml index 54e83e0..cc054f0 100644 --- a/plugin/contents/ui/config.qml +++ b/plugin/contents/ui/config.qml @@ -9,6 +9,8 @@ ColumnLayout { property alias cfg_ShowSkeleton: skeletonCheck.checked property alias cfg_BaladaMode: baladaCheck.checked property alias cfg_ChuvaMode: chuvaCheck.checked + property double cfg_Latitude + property double cfg_Longitude spacing: Kirigami.Units.largeSpacing @@ -34,5 +36,28 @@ ColumnLayout { text: i18n("Lua + chuva + relâmpagos") onCheckedChanged: if (checked) baladaCheck.checked = false } + + Kirigami.Separator { Kirigami.FormData.isSection: true } + + // Observador do céu realista (aceita vírgula ou ponto decimal) + TextField { + id: latField + Kirigami.FormData.label: i18n("Latitude:") + Component.onCompleted: text = root.cfg_Latitude + onTextChanged: { + const v = parseFloat(text.replace(",", ".")) + if (!isNaN(v) && v >= -90 && v <= 90) root.cfg_Latitude = v + } + } + + TextField { + id: lonField + Kirigami.FormData.label: i18n("Longitude:") + Component.onCompleted: text = root.cfg_Longitude + onTextChanged: { + const v = parseFloat(text.replace(",", ".")) + if (!isNaN(v) && v >= -180 && v <= 180) root.cfg_Longitude = v + } + } } } diff --git a/plugin/contents/ui/main.qml b/plugin/contents/ui/main.qml index 4b3c525..28fee2a 100644 --- a/plugin/contents/ui/main.qml +++ b/plugin/contents/ui/main.qml @@ -11,6 +11,8 @@ WallpaperItem { webView.runJavaScript("setShowSkeleton(" + Plasmoid.configuration.ShowSkeleton + ")") webView.runJavaScript("setBaladaMode(" + Plasmoid.configuration.BaladaMode + ")") webView.runJavaScript("setChuvaMode(" + Plasmoid.configuration.ChuvaMode + ")") + webView.runJavaScript("setObserverLocation(" + Plasmoid.configuration.Latitude + "," + + Plasmoid.configuration.Longitude + ")") } Connections { @@ -18,6 +20,8 @@ WallpaperItem { function onShowSkeletonChanged() { applyConfig() } function onBaladaModeChanged() { applyConfig() } function onChuvaModeChanged() { applyConfig() } + function onLatitudeChanged() { applyConfig() } + function onLongitudeChanged() { applyConfig() } } WebEngineView {