Bug 504257 - Digital Clock and Weather widgets are not vertically aligned with each other
Summary: Digital Clock and Weather widgets are not vertically aligned with each other
Status: RESOLVED NOT A BUG
Alias: None
Product: plasmashell
Classification: Plasma
Component: Digital Clock widget (other bugs)
Version First Reported In: 6.3.5
Platform: Arch Linux Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-15 10:41 UTC by Alexandre
Modified: 2025-05-19 19:33 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Example of misaligned clock and weather widgets (6.46 KB, image/png)
2025-05-15 10:41 UTC, Alexandre
Details
Without Display font (15.59 KB, image/png)
2025-05-15 22:17 UTC, Alexandre
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre 2025-05-15 10:41:54 UTC
Created attachment 181322 [details]
Example of misaligned clock and weather widgets

SUMMARY
When side to side with the weather widget the digital clock is misaligned (possibly it is correctly aligned and the other widgets are misaligned).

STEPS TO REPRODUCE
1. Set up a Digital Clock
2. Set up a weather widget next to it
3. Set the font of the clock to that of the rest of system albeit silty lower to match the size of the widget font

OBSERVED RESULT
The text appears to be misaligned.

EXPECTED RESULT
The text should be correctly aligned.

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2025-05-15 16:55:50 UTC
It looks like you've made some other customizations too, such as changing the default panel thickness and perhaps changing the default fonts too. Can you make a list of those?
Comment 2 Alexandre 2025-05-15 21:31:35 UTC
(In reply to Nate Graham from comment #1)
> It looks like you've made some other customizations too, such as changing
> the default panel thickness and perhaps changing the default fonts too. Can
> you make a list of those?

Yes sorry, here is the list:
- Panel height: 30
- Font: Inter Display (System font set to Regular 12 pt and Clock widget set to Regular 10 pt)

I have also disabled the middle token in the qml file of the widget however using the original file did not change the alignment. Therefore I did not include these modifications.
Comment 3 Nate Graham 2025-05-15 21:38:25 UTC
Aha, that's why. Fonts with "Display" in their names aren't actually intended for use on computer screens; they're for use on physical billboards and stuff. When used on a screen, their baselines will often be wrong, causing issues like this.

Please switch to the normal Inter font and let us know if the issue still happens after a reboot.
Comment 4 Alexandre 2025-05-15 22:17:16 UTC
Created attachment 181357 [details]
Without Display font
Comment 5 Alexandre 2025-05-15 22:18:52 UTC
I had no idea ! I was using it as it is a more compact version but I would be lying if the name did not influence my decision.

Anyway I did change it to the Inter Regular version of the font and the issue still persist.
Comment 6 Nate Graham 2025-05-15 22:24:27 UTC
Ok, thanks! I'll investigate further.
Comment 7 Alexandre 2025-05-16 21:23:06 UTC
Hello

Trying to resolve the issue I figured out how to align it with the weather widget. In the `DigitalClock.qml` if you set `dateLabel` vertical anchor to track the `timeLabel` and pad the `labelsGrid` to a value of 1 the text will now be aligned. 

If that corresponds to one pixel or more I don't know I am not a qml expert nor do I know if the weather widget is correctly centered 🤷‍♂️

Hope that can help.
Comment 8 Nate Graham 2025-05-19 19:33:51 UTC
I'm pretty sure I see the problem here: you set the clock itself to use the Inter font, rather than using this font system-wide by setting it as the "General" font. I can tell because the "1" digit differs in appearance between the Digital Clock and the Weather Report widgets.

If I set the Inter font system-wide in this manner, everything looks good to me with a 30px thick panel. If I set it in just the clock, then it's off in the way you describe, but this is an artifact of the font size also being fixed, rather than adjusting with the panel thickness, as the Weather Report always does.

Therefore I think this is not a bug, and rather a subtle example of misconfiguration.

I would recommend that you resolve it using any of the following methods:
1. Set the Inter font to be uses system-wide in System Settings > Text & Fonts > Fonts
2. Keep using the Inter font for just the Digital Clock widget, but set the size to something absurdly large, like 60pt, so that it will always be as large as it can be while still fitting in the panel
3. As #2, but set the font size to something hardcoded to *exactly* match the size of the Weather Report's text, since they won't otherwise match because they'll be using different fonts