Bump date-time and weather skill patches

This commit is contained in:
j1nx 2021-05-04 10:22:32 +02:00
parent 5150f3da34
commit 7e758f7e12
2 changed files with 141 additions and 4 deletions

View File

@ -1,7 +1,7 @@
From f0870e54cdad97fdf006e2e01b84b4987a6506e0 Mon Sep 17 00:00:00 2001
From: Aditya Mehra <aix.m@outlook.com>
Date: Fri, 30 Apr 2021 14:42:43 +0530
Subject: [PATCH 1/2] refactor to using card delegate and fix graphics
Subject: [PATCH 1/3] refactor to using card delegate and fix graphics
---
ui/date.qml | 132 +++++++++++++++++++++++++++++++---------------------
@ -168,7 +168,7 @@ index a405d66..38d172c 100644
From 5c77fd3a3aba5cbbc45845d2c87566737bec2ac8 Mon Sep 17 00:00:00 2001
From: Aditya Mehra <aix.m@outlook.com>
Date: Fri, 30 Apr 2021 14:51:22 +0530
Subject: [PATCH 2/2] Refactor date ui to use card delegate and fix graphics
Subject: [PATCH 2/3] Refactor date ui to use card delegate and fix graphics
---
ui/date.qml | 4 ++--
@ -193,3 +193,56 @@ index 38d172c..ad6d70d 100644
Layout.preferredWidth: Mycroft.Units.gridUnit * 25.5
Layout.preferredHeight: Mycroft.Units.gridUnit * 19.25
From 04f13d2e416da474ffffef400780350cd3172b7d Mon Sep 17 00:00:00 2001
From: Aditya Mehra <aix.m@outlook.com>
Date: Tue, 4 May 2021 02:03:39 +0530
Subject: [PATCH 3/3] Fix date string sent to GUI because of MDY format
difference
---
__init__.py | 8 +++++++-
ui/date.qml | 4 ++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/__init__.py b/__init__.py
index 52f4c34..11f5971 100644
--- a/__init__.py
+++ b/__init__.py
@@ -666,7 +666,13 @@ def show_date_gui(self, location, day):
self.gui.clear()
self.gui['date_string'] = self.get_display_date(day, location)
self.gui['weekday_string'] = self.get_weekday(day, location)
- self.gui['month_string'] = self.get_month_date(day, location)
+ month_string = self.get_month_date(day, location).split(" ")
+ if self.config_core.get('date_format') == 'MDY':
+ self.gui['day_string'] = month_string[1]
+ self.gui['month_string'] = month_string[0]
+ else:
+ self.gui['day_string'] = month_string[0]
+ self.gui['month_string'] = month_string[1]
self.gui['year_string'] = self.get_year(day, location)
self.gui.show_page('date.qml')
diff --git a/ui/date.qml b/ui/date.qml
index ad6d70d..8266afb 100644
--- a/ui/date.qml
+++ b/ui/date.qml
@@ -63,7 +63,7 @@ Mycroft.CardDelegate {
wrapMode: Text.WordWrap
font.family: "Noto Sans Display"
font.styleName: "Bold"
- text: sessionData.month_string.split(" ")[1]
+ text: sessionData.day_string
color: "#2C3E50"
}
}
@@ -91,7 +91,7 @@ Mycroft.CardDelegate {
wrapMode: Text.WordWrap
font.family: "Noto Sans Display"
font.styleName: "Bold"
- text: sessionData.month_string.split(" ")[0]
+ text: sessionData.month_string
color: "white"
}
}

View File

@ -1,7 +1,7 @@
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/2] Fix text resizing issue remove autofit label
Subject: [PATCH 1/3] Fix text resizing issue remove autofit label
---
ui/ForecastDelegate.qml | 13 +++++++++----
@ -106,7 +106,7 @@ index 0bd579a..a280a31 100644
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/2] make sure the background is black
Subject: [PATCH 2/3] make sure the background is black
---
ui/WeatherDelegate.qml | 1 +
@ -124,3 +124,87 @@ index 9b37739..540d8c7 100644
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