Bug 493344 - If alternate calendar is enabled with large font size, the date heading overflows
Summary: If alternate calendar is enabled with large font size, the date heading overf...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Digital Clock (show other bugs)
Version: master
Platform: Other Linux
: LO minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-19 01:34 UTC by tusooa
Modified: 2024-09-26 15:29 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.2.0
Sentry Crash Report:


Attachments
text overflow (166.58 KB, image/png)
2024-09-19 01:34 UTC, tusooa
Details
can't reproduce (166.75 KB, image/png)
2024-09-19 10:51 UTC, Marco Martin
Details
Full view of Moe (565.51 KB, image/png)
2024-09-19 23:02 UTC, tusooa
Details
Full view of Breeze (321.68 KB, image/png)
2024-09-19 23:03 UTC, tusooa
Details
13pt font; missing bottom spacing (1.83 MB, image/png)
2024-09-24 16:56 UTC, tusooa
Details
14pt font; overflow (2.14 MB, image/png)
2024-09-24 16:57 UTC, tusooa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tusooa 2024-09-19 01:34:40 UTC
Created attachment 173848 [details]
text overflow

SUMMARY
If alternate calendar is enabled, the date heading overflows

STEPS TO REPRODUCE
1. Create a digital clock widget
2. In settings -> calendar -> available plugins, turn on Alternate Calendar.
3. Click on the widget

OBSERVED RESULT
The text overflows on the date heading.

EXPECTED RESULT
The text should not overflow.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 6.6.38 / master
KDE Plasma Version: master
KDE Frameworks Version: master
Qt Version: 6.7.2

ADDITIONAL INFORMATION
Comment 1 Marco Martin 2024-09-19 10:51:55 UTC
Created attachment 173857 [details]
can't reproduce

might be an issue of that chinese font in particular? (i assume the selected alternalte calendal plugin is chinese lunar calendar?) here is how it renders locally
Comment 2 Nate Graham 2024-09-19 18:48:40 UTC
Are you using a custom Plasma theme, Tusooa? Can you share a screenshot that shows more context? Does it reproduce in a new clean user account, with the only customization being that Alternate Calendar is enabled?
Comment 3 tusooa 2024-09-19 23:02:42 UTC
Created attachment 173898 [details]
Full view of Moe
Comment 4 tusooa 2024-09-19 23:03:01 UTC
Created attachment 173899 [details]
Full view of Breeze
Comment 5 tusooa 2024-09-19 23:05:26 UTC
(In reply to Nate Graham from comment #2)
> Are you using a custom Plasma theme, Tusooa? Can you share a screenshot that
> shows more context? Does it reproduce in a new clean user account, with the
> only customization being that Alternate Calendar is enabled?

Using Moe, the version I have can be downloaded at https://f.tusooa.xyz/moe.tar .

Judging from the code, the events view just uses the header height of the month view, and hope it would be enough. Sadly, this is not true for all themes.

It is unrelated to Chinese font, as the Julian calendar suffers from the same problem.
Comment 6 Nate Graham 2024-09-20 18:11:13 UTC
I notice your font size is quite large, and that's likely the  indirect cause of the issue, which triggers the bug due to the code issue you found. I can reproduce this with an alternate calendar set and both the Moe and Breeze Plasma themes with 16pt Noto Sans. It's more obvious with Moe, but still clearly an issue with Breeze too.

What font and font size are you using?
Comment 7 tusooa 2024-09-20 18:50:34 UTC
(In reply to Nate Graham from comment #6)
> I notice your font size is quite large, and that's likely the  indirect
> cause of the issue, which triggers the bug due to the code issue you found.
> I can reproduce this with an alternate calendar set and both the Moe and
> Breeze Plasma themes with 16pt Noto Sans. It's more obvious with Moe, but
> still clearly an issue with Breeze too.
> 
> What font and font size are you using?

Sans Serif 15pt (which is DejaVu Sans configured by fontconfig), small font being 13pt. Monospace is 13 pt, being Ubuntu Mono by fontconfig.
Comment 8 Nate Graham 2024-09-24 15:21:07 UTC
I'm tempted to close this as RESOLVED INTENTIONAL since it appears you're drastically changing the font size as a way to avoid using the normal scaling system, which is not formally supported, and the Fonts KCM even shows a warning about this when you set the font size to 14pt or larger. :) 

However I could be persuaded to keep the Bugzilla ticker open if you plan to submit a patch that fixes it. Are you planning to do so?
Comment 9 tusooa 2024-09-24 16:56:01 UTC
(In reply to Nate Graham from comment #8)
> I'm tempted to close this as RESOLVED INTENTIONAL since it appears you're
> drastically changing the font size as a way to avoid using the normal
> scaling system, which is not formally supported, and the Fonts KCM even
> shows a warning about this when you set the font size to 14pt or larger. :) 
> 
> However I could be persuaded to keep the Bugzilla ticker open if you plan to
> submit a patch that fixes it. Are you planning to do so?

> 14pt or larger
except that it still does not look correct when I set the font to 13pt; the spacing does not look correct.
I will try to fix it.
Comment 10 tusooa 2024-09-24 16:56:44 UTC
Created attachment 174033 [details]
13pt font; missing bottom spacing
Comment 11 tusooa 2024-09-24 16:57:09 UTC
Created attachment 174034 [details]
14pt font; overflow
Comment 12 Nate Graham 2024-09-24 18:53:27 UTC
Yes, I can confirm that with the MOE theme.
Comment 13 Bug Janitor Service 2024-09-24 22:56:54 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4746
Comment 14 Bug Janitor Service 2024-09-24 22:56:56 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4746
Comment 15 Nate Graham 2024-09-26 15:24:05 UTC
Git commit c083f4674fe09aeaad4fc129604749ee5e710f80 by Nate Graham, on behalf of tusooa the west wind.
Committed on 26/09/2024 at 15:07.
Pushed by ngraham into branch 'master'.

Fix potential overflow of agenda heading of digital clock

The original approach to determining the heading height is to just use
the height of the MonthView and hope it would be enough. This
assumption is untrue for many font/theme combinations and can cause
spacing issues even if the height happens to be enough.

We fix this by synchronizing the height of both headers to be the
larger one.

M  +6    -1    applets/digital-clock/package/contents/ui/CalendarView.qml
M  +3    -1    components/calendar/qml/MonthViewHeader.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/c083f4674fe09aeaad4fc129604749ee5e710f80
Comment 16 Nate Graham 2024-09-26 15:29:16 UTC
Git commit fead85fc2245864af2b6f0bb3ec36c8f12d3fda1 by Nate Graham.
Committed on 26/09/2024 at 15:29.
Pushed by ngraham into branch 'Plasma/6.2'.

Fix potential overflow of agenda heading of digital clock

The original approach to determining the heading height is to just use
the height of the MonthView and hope it would be enough. This
assumption is untrue for many font/theme combinations and can cause
spacing issues even if the height happens to be enough.

We fix this by synchronizing the height of both headers to be the
larger one.


(cherry picked from commit c083f4674fe09aeaad4fc129604749ee5e710f80)

Co-authored-by: tusooa the west wind <tusooa@kazv.moe>

M  +6    -1    applets/digital-clock/package/contents/ui/CalendarView.qml
M  +3    -1    components/calendar/qml/MonthViewHeader.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/fead85fc2245864af2b6f0bb3ec36c8f12d3fda1