Skip to content

Commit

Permalink
fix scaling for forecast delegate and weather page text alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
AIIX committed May 3, 2021
1 parent aeb638a commit 96ae297
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
19 changes: 10 additions & 9 deletions ui/ForecastDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -34,29 +35,29 @@ 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 + "°"
}

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 + "°"
}
}
}
Expand Down
1 change: 1 addition & 0 deletions ui/weather.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 96ae297

Please sign in to comment.