Lacerte / clima

MOVED TO https://codeberg.org/Lacerte/clima
Mozilla Public License 2.0
105 stars 14 forks source link

[domain, data, ui] implement wind direction #340

Closed prestosole closed 1 year ago

prestosole commented 2 years ago

Description

Implement the wind direction in the shape of an [arrow] that corresponds to the given weatherDirection weather parameter provided by OpenWeatherMap's API.

After trying and failing, I realized how difficult it is to implement one icon that rotates precisely, so I just went with the easier if else statement, even if it's not as precise as the earlier approach.

References

Fixes #289

Testing

app-release.zip

image

image

image

Checklist

triallax commented 2 years ago

After trying and failing, I realized how difficult it is to implement one icon that rotates precisely

What were the difficulties?

prestosole commented 2 years ago

What were the difficulties?

I couldn't find a way to use Transform.rotate() inside the value string of the Wind speed widget. I also don't want to have the arrow as a separate widget/text, because I don't want to get myself into the mess of adjusting the margins, alignments, and sizes of the other widgets in the same row.

triallax commented 2 years ago

I also don't want to have the arrow as a separate widget/text, because I don't want to get myself into the mess of adjusting the margins, alignments, and sizes of the other widgets in the same row.

Did you actually try this?

prestosole commented 2 years ago

Did you actually try this?

Hence the "trying and failing". Though I will really appreciate it if you can help with it, because it will be less code and more accurate information.