Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/20.08' into make-weather-great-a…
Browse files Browse the repository at this point in the history
…gain

# Conflicts:
#	ui/DailyDelegateScalable.qml
#	ui/highlow.qml
#	ui/weather.qml
  • Loading branch information
chrisveilleux committed May 12, 2021
2 parents 054c9b2 + 2036533 commit d3e4293
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
43 changes: 25 additions & 18 deletions ui/DailyDelegateScalable.qml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
import QtQuick.Layouts 1.4
import QtQuick 2.4
import QtQuick.Controls 2.0
import org.kde.kirigami 2.4 as Kirigami

import Mycroft 1.0 as Mycroft
import org.kde.lottie 1.0

// Copyright 2021, Mycroft AI Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -26,6 +18,14 @@ Re-usable code to display two days forecast.
This code written to be scalable for different screen sizes. It can be used on any
device not conforming to the Mark II screen's form factor.
*/
import QtQuick.Layouts 1.4
import QtQuick 2.4
import QtQuick.Controls 2.0
import org.kde.kirigami 2.4 as Kirigami

import Mycroft 1.0 as Mycroft
import org.kde.lottie 1.0

WeatherDelegateScalable {
id: root

Expand All @@ -34,43 +34,50 @@ WeatherDelegateScalable {
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(modelData.weatherCondition)
loops: Animation.Infinite
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
Layout.preferredHeight: proportionalGridUnit * 30
font.pixelSize: height * 0.90
text: modelData.date
}

Mycroft.AutoFitLabel {
Label {
font.weight: Font.Bold
Layout.fillWidth: true
Layout.preferredHeight: proportionalGridUnit * 20
Layout.preferredHeight: proportionalGridUnit * 30
rightPadding: -font.pixelSize * 0.1
font.pixelSize: height * 0.90
horizontalAlignment: Text.AlignHCenter
text: modelData.highTemperature + "°"
}

Mycroft.AutoFitLabel {
Label {
font.styleName: "Thin"
Layout.fillWidth: true
Layout.preferredHeight: proportionalGridUnit * 20
Layout.preferredHeight: proportionalGridUnit * 30
rightPadding: -font.pixelSize * 0.1
text: modelData.lowTemperature + "°"
font.pixelSize: height * 0.90
horizontalAlignment: Text.AlignHCenter
text: modelData.lowTemperature + "°"
}
}
}
Expand Down
1 change: 1 addition & 0 deletions ui/WeatherDelegateScalable.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import Mycroft 1.0 as Mycroft

Mycroft.ProportionalDelegate {
id: root
skillBackgroundColorOverlay: Qt.rgba(0, 0, 0, 1)

function getWeatherImagery(weathercode) {
switch(weathercode) {
Expand Down

0 comments on commit d3e4293

Please sign in to comment.