chore: add weather icon
This commit is contained in:
parent
2118e6d73e
commit
01fdc09393
3 changed files with 10 additions and 3 deletions
src
|
@ -43,7 +43,10 @@ Singleton {
|
||||||
return day ? "weather-few-clouds" : "weather-few-clouds-night";
|
return day ? "weather-few-clouds" : "weather-few-clouds-night";
|
||||||
case "122":
|
case "122":
|
||||||
return "weather-overcast";
|
return "weather-overcast";
|
||||||
|
case "296":
|
||||||
|
return day ? "weather-showers-scattered" : "weather-showers-scattered-night";
|
||||||
default:
|
default:
|
||||||
|
console.log("Unknown weather code: ", weatherCode);
|
||||||
return "weather-none-available";
|
return "weather-none-available";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,11 +95,13 @@ MouseArea {
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
font.pointSize: 12.5
|
font.pointSize: 12.5
|
||||||
|
|
||||||
Component.onCompleted: () => {
|
onImplicitHeightChanged: {
|
||||||
if (text.implicitHeight < bodyBox.height) {
|
if (text.implicitHeight < bodyBox.height) {
|
||||||
bodyBox.height = text.implicitHeight;
|
bodyBox.height = text.implicitHeight;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: () => {
|
||||||
bodyBox.maxHeight = Qt.binding(() => text.implicitHeight);
|
bodyBox.maxHeight = Qt.binding(() => text.implicitHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ BRectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
|
Layout.margins: 10
|
||||||
Repeater {
|
Repeater {
|
||||||
|
|
||||||
model: Weather.lastFetch?.weather
|
model: Weather.lastFetch?.weather
|
||||||
|
@ -50,9 +50,11 @@ BRectangle {
|
||||||
property string maxtempC: modelData.maxtempC
|
property string maxtempC: modelData.maxtempC
|
||||||
property string date: modelData.date
|
property string date: modelData.date
|
||||||
|
|
||||||
|
color: "#D7B4F3"
|
||||||
|
radius: 5
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.margins: 5
|
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
Loading…
Add table
Reference in a new issue