Bug 453615 - More compact Weather Report tray widget
Summary: More compact Weather Report tray widget
Status: RESOLVED FIXED
Alias: None
Product: kdeplasma-addons
Classification: Unclassified
Component: Weather (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-10 08:47 UTC by Slavi
Modified: 2022-05-13 04:19 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.25


Attachments
If the degree number is rounded and the units are removed, the widget could take roughly half the space. (2.42 KB, image/png)
2022-05-10 08:47 UTC, Slavi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Slavi 2022-05-10 08:47:24 UTC
Created attachment 148698 [details]
If the degree number is rounded and the units are removed, the widget could take roughly half the space.

SUMMARY

This is a **feature request** about the Weather Report tray widget. Not sure if I've categorized this issue correctly.

The widget currently shows degrees with 1-digit precision (e.g. `15.0`). It also shows the unit (e.g. `°C` to `°F`).
Both of these take space for not much benefit. Surely, by default, the unit should be there, so that new users could more easily figure out what it is and configure it accordingly.

But on my own desktop, I know that I'm using `°C`, so I don't need to see it there all the time. Similarly, `15.0` takes up 2 more characters than necessary (compared to just `15`). I (and possibly most other people) don't need sub-degree precision.

The Weather Report wiget could introduce some compact mode which:

- hides the unit (`°C` to `°F`)
- rounds the numbers (`15.0` -> `15`)

Doing this, the widget's horizontal space could be cut in half, saving useful space in the tray.

Instead of a "compact mode", checkboxes may be introduced for each of the above (unit hiding / number-rounding), so they can be controlled separately.
Comment 1 Nate Graham 2022-05-10 15:55:31 UTC
If we removed the unit, it wouldn't be obvious what the number is, or even what applet is belongs to.

If we removed the trailing ".0" then the applet would grow and shrink anytime the temperature changed from an integer to a decimal number, and people really don't like that.

If we simply rounded the number to the nearest integer, then we'd be losing precision since 14C and 15C are rather different temperatures.

I think we have to keep this the way it is, sorry.
Comment 2 Slavi 2022-05-10 16:04:06 UTC
I didn't mean to just cut off the `.0` part, but to always round to the nearest integer if configured that way.

14C and 15C are somewhat different temperatures (1 degree), but rounding (instead of just cutting off the decimal part) only loses half a degree of precision.

To me, and I believe to many others, half a degree rounding in any direction is pretty much the same thing. In fact, popular weather services around here always use integer numbers for degrees. I'm not sure the BBC weather API is even returning anything else besides `.0` anyway.

Looking at AccuWeather's website, it seems like it doesn't use fractions either, so I don't think people expect to see fractions in their tray widget.
Comment 3 Nate Graham 2022-05-10 16:06:05 UTC
That being the case, I wonder if we should simply always round it.
Comment 4 Nate Graham 2022-05-10 19:26:56 UTC
Yeah, I think we can consider rounding the temperature.
Comment 5 Nate Graham 2022-05-10 19:31:54 UTC
Submitted https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/156 to do that.
Comment 6 Nate Graham 2022-05-13 04:19:58 UTC
Git commit c5d274b8efe1992d3eb523d931b9631bbe09a7b0 by Nate Graham.
Committed on 13/05/2022 at 04:13.
Pushed by ngraham into branch 'master'.

applets/weather: Always Round temperature

None of the weather providers still provide decimals for the
temperature, so we just always end up displaying "25.0" as the
temperature. So let's round it to get rid of the unnecessary decimal.
FIXED-IN: 5.25

M  +1    -1    applets/weather/package/contents/ui/IconAndTextItem.qml
M  +1    -1    applets/weather/package/contents/ui/main.qml

https://invent.kde.org/plasma/kdeplasma-addons/commit/c5d274b8efe1992d3eb523d931b9631bbe09a7b0