mirror of
https://github.com/OpenVoiceOS/OpenVoiceOS
synced 2025-04-14 18:42:11 +02:00
Switch skill-weather over to ovos version
This commit is contained in:
parent
ee95057f56
commit
6a99a48c07
@ -1,210 +0,0 @@
|
||||
From 4980419c2cbc39c521e171d101a661ad9b21b057 Mon Sep 17 00:00:00 2001
|
||||
From: Aditya Mehra <aix.m@outlook.com>
|
||||
Date: Fri, 30 Apr 2021 15:47:51 +0530
|
||||
Subject: [PATCH 1/3] Fix text resizing issue remove autofit label
|
||||
|
||||
---
|
||||
ui/ForecastDelegate.qml | 13 +++++++++----
|
||||
ui/highlow.qml | 8 ++++++--
|
||||
ui/weather.qml | 3 ++-
|
||||
3 files changed, 17 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/ui/ForecastDelegate.qml b/ui/ForecastDelegate.qml
|
||||
index a4db1ce..a989714 100644
|
||||
--- a/ui/ForecastDelegate.qml
|
||||
+++ b/ui/ForecastDelegate.qml
|
||||
@@ -30,27 +30,32 @@ WeatherDelegate {
|
||||
fillMode: Image.PreserveAspectFit
|
||||
running: true
|
||||
}
|
||||
- Mycroft.AutoFitLabel {
|
||||
+ Label {
|
||||
font.weight: Font.Bold
|
||||
- horizontalAlignment: Text.AlignLeft
|
||||
+ horizontalAlignment: Text.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: proportionalGridUnit * 15
|
||||
+ font.pixelSize: parent.height * 0.50
|
||||
text: modelData.date
|
||||
}
|
||||
|
||||
- Mycroft.AutoFitLabel {
|
||||
+ Label {
|
||||
font.weight: Font.Bold
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: proportionalGridUnit * 20
|
||||
rightPadding: -font.pixelSize * 0.1
|
||||
+ font.pixelSize: parent.height * 0.50
|
||||
+ horizontalAlignment: Text.AlignHCenter
|
||||
text: modelData.max + "°"
|
||||
}
|
||||
|
||||
- Mycroft.AutoFitLabel {
|
||||
+ Label {
|
||||
font.styleName: "Thin"
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: proportionalGridUnit * 20
|
||||
rightPadding: -font.pixelSize * 0.1
|
||||
+ font.pixelSize: parent.height * 0.50
|
||||
+ horizontalAlignment: Text.AlignHCenter
|
||||
text: modelData.min + "°"
|
||||
}
|
||||
}
|
||||
diff --git a/ui/highlow.qml b/ui/highlow.qml
|
||||
index 60d638d..33e2030 100644
|
||||
--- a/ui/highlow.qml
|
||||
+++ b/ui/highlow.qml
|
||||
@@ -9,23 +9,27 @@ import org.kde.lottie 1.0
|
||||
WeatherDelegate {
|
||||
id: root
|
||||
|
||||
- Mycroft.AutoFitLabel {
|
||||
+ Label {
|
||||
id: maxTemp
|
||||
font.weight: Font.Bold
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: proportionalGridUnit * 40
|
||||
+ font.pixelSize: parent.height * 0.50
|
||||
//The off-centering to balance the ° should be proportional as well, so we use the computed pixel size
|
||||
rightPadding: -font.pixelSize * 0.1
|
||||
+ horizontalAlignment: Text.AlignHCenter
|
||||
text: sessionData.max + "°"
|
||||
}
|
||||
|
||||
- Mycroft.AutoFitLabel {
|
||||
+ Label {
|
||||
id: minTemp
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: proportionalGridUnit * 40
|
||||
+ font.pixelSize: parent.height * 0.50
|
||||
rightPadding: -font.pixelSize * 0.1
|
||||
font.weight: Font.Thin
|
||||
font.styleName: "Thin"
|
||||
+ horizontalAlignment: Text.AlignHCenter
|
||||
text: sessionData.min + "°"
|
||||
}
|
||||
}
|
||||
diff --git a/ui/weather.qml b/ui/weather.qml
|
||||
index 0bd579a..a280a31 100644
|
||||
--- a/ui/weather.qml
|
||||
+++ b/ui/weather.qml
|
||||
@@ -32,11 +32,12 @@ WeatherDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
- Mycroft.AutoFitLabel {
|
||||
+ Label {
|
||||
id: temperature
|
||||
font.weight: Font.Bold
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: proportionalGridUnit * 40
|
||||
+ font.pixelSize: parent.height * 0.65
|
||||
rightPadding: -font.pixelSize * 0.1
|
||||
text: sessionData.current + "°"
|
||||
}
|
||||
|
||||
From aeb638aed01b416b1caa1d7a2639554bb9f8bfb5 Mon Sep 17 00:00:00 2001
|
||||
From: Aditya Mehra <aix.m@outlook.com>
|
||||
Date: Fri, 30 Apr 2021 17:10:52 +0530
|
||||
Subject: [PATCH 2/3] make sure the background is black
|
||||
|
||||
---
|
||||
ui/WeatherDelegate.qml | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/ui/WeatherDelegate.qml b/ui/WeatherDelegate.qml
|
||||
index 9b37739..540d8c7 100644
|
||||
--- a/ui/WeatherDelegate.qml
|
||||
+++ b/ui/WeatherDelegate.qml
|
||||
@@ -7,6 +7,7 @@ import Mycroft 1.0 as Mycroft
|
||||
|
||||
Mycroft.ProportionalDelegate {
|
||||
id: root
|
||||
+ skillBackgroundColorOverlay: Qt.rgba(0, 0, 0, 1)
|
||||
|
||||
function getWeatherImagery(weathercode) {
|
||||
switch(weathercode) {
|
||||
|
||||
From 96ae297af370e4651ef8ead58b1033bb1a5153ab Mon Sep 17 00:00:00 2001
|
||||
From: Aditya Mehra <aix.m@outlook.com>
|
||||
Date: Tue, 4 May 2021 01:24:14 +0530
|
||||
Subject: [PATCH 3/3] fix scaling for forecast delegate and weather page text
|
||||
alignment
|
||||
|
||||
---
|
||||
ui/ForecastDelegate.qml | 19 ++++++++++---------
|
||||
ui/weather.qml | 1 +
|
||||
2 files changed, 11 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/ui/ForecastDelegate.qml b/ui/ForecastDelegate.qml
|
||||
index a989714..c16452f 100644
|
||||
--- a/ui/ForecastDelegate.qml
|
||||
+++ b/ui/ForecastDelegate.qml
|
||||
@@ -14,15 +14,16 @@ WeatherDelegate {
|
||||
spacing: proportionalGridUnit * 10
|
||||
Repeater {
|
||||
id: forecastRepeater
|
||||
- model: sessionData.forecast.first
|
||||
delegate: GridLayout {
|
||||
columns: 2
|
||||
rowSpacing: proportionalGridUnit * 5
|
||||
columnSpacing: proportionalGridUnit * 5
|
||||
Layout.fillWidth: true
|
||||
+ Layout.fillHeight: true
|
||||
+
|
||||
LottieAnimation {
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
- Layout.preferredHeight: proportionalGridUnit * 20
|
||||
+ Layout.preferredHeight: proportionalGridUnit * 30
|
||||
Layout.preferredWidth: Layout.preferredHeight
|
||||
|
||||
source: Qt.resolvedUrl(getWeatherImagery(modelData.weathercode))
|
||||
@@ -34,17 +35,17 @@ WeatherDelegate {
|
||||
font.weight: Font.Bold
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
- Layout.preferredHeight: proportionalGridUnit * 15
|
||||
- font.pixelSize: parent.height * 0.50
|
||||
+ Layout.preferredHeight: proportionalGridUnit * 30
|
||||
+ font.pixelSize: height * 0.90
|
||||
text: modelData.date
|
||||
}
|
||||
|
||||
Label {
|
||||
font.weight: Font.Bold
|
||||
Layout.fillWidth: true
|
||||
- Layout.preferredHeight: proportionalGridUnit * 20
|
||||
+ Layout.preferredHeight: proportionalGridUnit * 30
|
||||
rightPadding: -font.pixelSize * 0.1
|
||||
- font.pixelSize: parent.height * 0.50
|
||||
+ font.pixelSize: height * 0.90
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: modelData.max + "°"
|
||||
}
|
||||
@@ -52,11 +53,11 @@ WeatherDelegate {
|
||||
Label {
|
||||
font.styleName: "Thin"
|
||||
Layout.fillWidth: true
|
||||
- Layout.preferredHeight: proportionalGridUnit * 20
|
||||
+ Layout.preferredHeight: proportionalGridUnit * 30
|
||||
rightPadding: -font.pixelSize * 0.1
|
||||
- font.pixelSize: parent.height * 0.50
|
||||
+ font.pixelSize: height * 0.90
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
- text: modelData.min + "°"
|
||||
+ text: modelData.min + "°"
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/ui/weather.qml b/ui/weather.qml
|
||||
index a280a31..1c7ce47 100644
|
||||
--- a/ui/weather.qml
|
||||
+++ b/ui/weather.qml
|
||||
@@ -36,6 +36,7 @@ WeatherDelegate {
|
||||
id: temperature
|
||||
font.weight: Font.Bold
|
||||
Layout.fillWidth: true
|
||||
+ horizontalAlignment: Text.AlignHCenter
|
||||
Layout.preferredHeight: proportionalGridUnit * 40
|
||||
font.pixelSize: parent.height * 0.65
|
||||
rightPadding: -font.pixelSize * 0.1
|
@ -1,7 +1,7 @@
|
||||
config BR2_PACKAGE_MYCROFT_SKILL_WEATHER
|
||||
bool "mycroft-skill-weather"
|
||||
help
|
||||
Mycroft AI official Weather Skill, providing
|
||||
OpenVoiceOS version of Weather Skill, providing
|
||||
weather conditions and forecasts.
|
||||
|
||||
https://github.com/MycroftAI/skill-weather
|
||||
https://github.com/OpenVoiceOS/skill-weather
|
||||
|
@ -4,11 +4,11 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
MYCROFT_SKILL_WEATHER_VERSION = b0194125e2e03d010949ed6c89a8cf9ce7931141
|
||||
MYCROFT_SKILL_WEATHER_SITE = git://github.com/MycroftAI/skill-weather
|
||||
MYCROFT_SKILL_WEATHER_VERSION = c0549cb6215d04504040810eb31dcd1198627fd1
|
||||
MYCROFT_SKILL_WEATHER_SITE = git://github.com/OpenVoiceOS/skill-weather
|
||||
MYCROFT_SKILL_WEATHER_SITE_METHOD = git
|
||||
MYCROFT_SKILL_WEATHER_DIRLOCATION = home/mycroft/.local/share/mycroft/skills
|
||||
MYCROFT_SKILL_WEATHER_DIRNAME = skill-weather.mycroftai
|
||||
MYCROFT_SKILL_WEATHER_DIRNAME = skill-weather.openvoiceos
|
||||
|
||||
define MYCROFT_SKILL_WEATHER_INSTALL_TARGET_CMDS
|
||||
mkdir -p $(TARGET_DIR)/$(MYCROFT_SKILL_WEATHER_DIRLOCATION)/$(MYCROFT_SKILL_WEATHER_DIRNAME)
|
||||
|
Loading…
x
Reference in New Issue
Block a user