Bug 417852 - Date in vertical panels is too big until panel is manually resized
Summary: Date in vertical panels is too big until panel is manually resized
Status: CLOSED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Digital Clock (show other bugs)
Version: 5.18.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression
: 417728 418589 418886 420607 425870 429693 431029 432003 432708 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-02-19 00:08 UTC by Christian Muehlhaeuser
Modified: 2022-09-08 17:00 UTC (History)
13 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.21


Attachments
Date font size changing upon resizing the panel (1.65 MB, video/x-matroska)
2020-02-21 02:54 UTC, Christian Muehlhaeuser
Details
Screenie of resized panel (28.49 KB, image/png)
2020-03-20 18:32 UTC, groot
Details
Width after resizing differs from initial width (3.88 MB, video/x-matroska)
2020-03-21 00:16 UTC, Christian Muehlhaeuser
Details
fix for custom date format (2.47 KB, patch)
2021-01-14 19:30 UTC, Piotr Mierzwinski
Details
How my date would initially look before this change (48.68 KB, image/png)
2021-01-27 00:56 UTC, Paul McAuley
Details
How my time and date looks now (113.34 KB, image/png)
2021-01-27 01:00 UTC, Paul McAuley
Details
Date with seconds added (107.59 KB, image/png)
2021-01-27 02:31 UTC, Paul McAuley
Details
The same panel in Plasma 5.20 and 5.21 right before and after the upgrade (23.03 KB, image/png)
2021-02-18 10:39 UTC, Frank Steinmetzger
Details
Dante incorrectly scaled (30.99 KB, image/png)
2021-03-21 22:43 UTC, Piotr Mierzwinski
Details
Date-scalled corectly (28.54 KB, image/png)
2021-03-22 20:55 UTC, Piotr Mierzwinski
Details
System fonts settings (29.21 KB, image/png)
2021-08-16 22:29 UTC, Piotr Mierzwinski
Details
Vertical_Panel-Date.-1_70px (37.56 KB, image/png)
2021-08-16 22:30 UTC, Piotr Mierzwinski
Details
ertical_Panel-Date.-2_68pix (42.45 KB, image/png)
2021-08-16 22:31 UTC, Piotr Mierzwinski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Muehlhaeuser 2020-02-19 00:08:03 UTC
SUMMARY

Since the 5.18 update the date in a vertical panel uses to fully available width. This can look very odd on wider panels, as the date suddenly uses a font 4 or 8 times as big as the time-label.

Interestingly, lowering the panel's width makes the date font snap back to a sensible default, even if you increase the width again afterwards. This breaks on the next login again, though.
Comment 1 Nate Graham 2020-02-20 23:39:32 UTC
Could you attach a screenshot? Or even better, a screen recording? The time string is supposed to grow and shrink dynamically as well.
Comment 2 Christian Muehlhaeuser 2020-02-21 02:54:01 UTC
Created attachment 126237 [details]
Date font size changing upon resizing the panel

Find a screen recording attached!
Comment 3 Bug Janitor Service 2020-03-07 04:33:12 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Christoph Feck 2020-03-20 17:23:02 UTC
Requested information was added with comment 2; changing status for inspection.
Comment 5 groot 2020-03-20 18:32:50 UTC
Created attachment 126912 [details]
Screenie of resized panel

Can reproduce on 5.18, FreeBSD, X11, frameworks 5.66
Comment 6 Nate Graham 2020-03-20 22:44:54 UTC
Patch: https://phabricator.kde.org/D28172
Comment 7 Nate Graham 2020-03-20 22:44:59 UTC
*** Bug 418886 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2020-03-20 22:45:27 UTC
*** Bug 417728 has been marked as a duplicate of this bug. ***
Comment 9 Christian Muehlhaeuser 2020-03-21 00:16:45 UTC
Created attachment 126918 [details]
Width after resizing differs from initial width
Comment 10 Christian Muehlhaeuser 2020-03-21 00:16:55 UTC
@ngraham: Your patch indeed makes the date behave like in previous releases again! However I noticed it's still not quite consistent in its behavior: when I start plasmashell freshly, the date is a lot wider than after resizing it to roughly the same width. I've added a new attachment, which hopefully explains what I'm trying to say.
Comment 11 Nate Graham 2020-03-24 15:26:35 UTC
Git commit 01691632b5238ac993b59eebe693fefc88130b8f by Nate Graham.
Committed on 24/03/2020 at 15:26.
Pushed by ngraham into branch 'Plasma/5.18'.

[applets/digital-clock] Fix date sizing in vertical panel

Summary:
This patch fixes several errors in the code:
- The property is named `font.minimumPixelSize`, not `minimumPixelSize`
- The calculation in `minimumPixelSize` did not make sense
- Setting the height to `dateLabel.paintedHeight` is nonsensical
FIXED-IN: 5.18.4

Test Plan: {F8186873}

Reviewers: #vdg, #plasma, cblack, davidedmundson

Reviewed By: #vdg, #plasma, cblack, davidedmundson

Subscribers: davidedmundson, cblack, muesli, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D28172

M  +1    -2    applets/digital-clock/package/contents/ui/DigitalClock.qml

https://commits.kde.org/plasma-workspace/01691632b5238ac993b59eebe693fefc88130b8f
Comment 12 Nate Graham 2020-07-13 20:34:09 UTC
Re-opening as it's not fully fixed yet.
Comment 13 Aaron Wolf 2020-10-17 20:42:32 UTC
I am seeing this issue myself on KDE Neon 5.20.0

Specifically, I had the two parts of date (in my case the format `ddd d`) split on two lines, both big font. Resizing down and then back fixed it. But I found another fix as well: By switching the ISO date format, it was just on one line. When I then switched back to `ddd d` it stayed on one line correctly.

This is annoying though, and I hope it gets fixed. I also found these likely duplicate tickets:

https://bugs.kde.org/show_bug.cgi?id=418589
https://bugs.kde.org/show_bug.cgi?id=420607
https://bugs.kde.org/show_bug.cgi?id=425870

and these are not the same but are related because they involve the question of font size and of single vs multiple lines:

https://bugs.kde.org/show_bug.cgi?id=376307
https://bugs.kde.org/show_bug.cgi?id=422532
Comment 14 Nate Graham 2020-10-18 14:16:35 UTC
*** Bug 418589 has been marked as a duplicate of this bug. ***
Comment 15 Nate Graham 2020-10-18 14:16:43 UTC
*** Bug 420607 has been marked as a duplicate of this bug. ***
Comment 16 Nate Graham 2020-10-18 14:16:53 UTC
*** Bug 425870 has been marked as a duplicate of this bug. ***
Comment 17 Nate Graham 2020-10-18 14:19:01 UTC
Thanks, they are indeed.
Comment 18 Nate Graham 2020-12-01 02:08:52 UTC
*** Bug 429693 has been marked as a duplicate of this bug. ***
Comment 19 Nate Graham 2021-01-05 02:18:13 UTC
*** Bug 431029 has been marked as a duplicate of this bug. ***
Comment 20 Piotr Mierzwinski 2021-01-06 21:37:15 UTC
The strange thing here is that if we apply different date type format, like "Custom: ddd d" then just after this  activity the font is OK. Only the problem appears when we relogin or restart of the Plasma.
Comment 21 francisco_t 2021-01-07 20:36:21 UTC
(In reply to Piotr Mierzwinski from comment #20)
> The strange thing here is that if we apply different date type format, like
> "Custom: ddd d" then just after this  activity the font is OK. Only the
> problem appears when we relogin or restart of the Plasma.

I fix it changing "/" for "-" in custom date. In my case: d-M-yyyy
Comment 22 Piotr Mierzwinski 2021-01-11 00:07:12 UTC
(In reply to francisco_t from comment #21)
> (In reply to Piotr Mierzwinski from comment #20)
> > The strange thing here is that if we apply different date type format, like
> > "Custom: ddd d" then just after this  activity the font is OK. Only the
> > problem appears when we relogin or restart of the Plasma.
> 
> I fix it changing "/" for "-" in custom date. In my case: d-M-yyyy

Unfortunately this helps partially only. After restart of Plasma font still is bigger than this one in time, and bigger after very first set. 
Second issue is that after I added character between (",") date has been split onto two rows (in case of three letters name of day), of course with big font.

Simple test showing that font is too big.
1. Set "Date format" as "ISO Date" or "Short Date" and press Apply
   You will get small font (smaller than in watch)
2. Set "Date format" as "Custom" and for example "ddd d"
   You will get font size like in watch
3. Restart Plasma either relogin or restart PC
   You will get font with very big size

The worst part is that, we cannot set size this even by configuration file, I think. Or I don't know proper entry to set (and proper file).
Comment 23 groot 2021-01-13 16:14:50 UTC
Basically confirming what Piotr wrote most recently:

- on a freshly installed KaOS (because that defaults to a vertical panel) in a VM
- resize the vertical panel (it is on the right) to 110px wide
- right-mouse-click the clock, pick *Configure Digital Clock*
- in the *Appearance* tab, choose *Date format* and pick *ISO date* from the drop-down. Today is 2021-01-13. Click apply.
- Result: big text for time, smaller text for date, both approximately fill the horizontal width of the panel.
- Close settings, then logout and login again.
- The date is still shown "small".
- Do the same thing, but now pick *Custom format* and use `ddd d` as suggested by Piotr. This displays for me, today, *mie 13* but that's because I have Nicaraguan time format selected elsewhere.
- Close settings, logout, login.
- Result: huge text for the date.
- Switching back to ISO date gets me small text again, also after logout and login.

If I pick *long date*, I get teeny-tiny letters because it is hard to fit "miercoles, 13 de enero de 2021" in 110px across; it is spread on two lines. After logout and login, the letters are larger, and spread to 4 lines: "miercoles," "13 de" "enero de" "2021". I can go through the settings dance again to get the letters "back to normal".
Comment 24 groot 2021-01-13 16:26:25 UTC
Reproducing on KDE neon:
- developer edition neon-developer-20210111-1849.iso
- boot from the ISO (in VirtualBox I get a 1024x768 screen, not ideal, but it is workable)
- RMB on the panel (at the bottom) and pick *edit panel*
- drag the panel to the right edge of the screen, then resize to 110px wide (note that "dragging" in the panel-sizer-number-input box is reversed: towards the edge makes the panel wider, away from the edge smaller: I think this is reported and fixed elsewhere)
- log out; you are automatically logged in again
- date display is now huge
Comment 25 Bug Janitor Service 2021-01-14 15:42:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/572
Comment 26 Piotr Mierzwinski 2021-01-14 19:30:03 UTC
Created attachment 134860 [details]
fix for custom date format
Comment 27 Nate Graham 2021-01-14 19:37:11 UTC
Is that based on Marco's patch? Either way please submit patches via invent.kde.org, thanks! :)
Comment 28 Piotr Mierzwinski 2021-01-14 19:41:03 UTC
(In reply to Nate Graham from comment #27)
> Is that based on Marco's patch? Either way please submit patches via
> invent.kde.org, thanks! :)

Yes. This is exactly his patch. Only I didn't finish my post, and got collision because you sent yours
Comment 29 Piotr Mierzwinski 2021-01-14 19:41:22 UTC
(In reply to Bug Janitor Service from comment #25)
> A possibly relevant merge request was started @
> https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/572

I restested this patch and seems it works like a charm. Note I tested it only for issue I reported, so  related with custom date format like "ddd d". 
I attach patch file generated from merge_requests/572. If anyone needs to fix issue and retest it then let follow below short instruction (works in Arch based distro):

1. sudo cp 572.diff /usr/share/plasma/plasmoids/org.kde.plasma.digitalclock/contents/ui/
2. sudo patch < 572.diff
3 restart plasma or relogin

Thank you for fixing.
Comment 30 Nate Graham 2021-01-15 16:15:10 UTC
Git commit fcbfbcbfeca9a31c5ed39ecb6fdc43476b1cd08a by Nate Graham, on behalf of Marco Martin.
Committed on 15/01/2021 at 16:15.
Pushed by ngraham into branch 'master'.

properly size date label in vertical panels

the Text.Fit sizing policy will size the font in order to fit given a fixed
size of the label, but it can't really cause the other way around which we need:
cause a vertical resize in order to accomodate a larger font.
In order to fake that, we fix the date label to an arbitrary tall height
(will overflow outside the applet) and then size the applet based on the label contentheight instead,
leaving the invisible part of the label outside.
In order to avoid the huge text it used to have, limit the maximum size to an arbitrarly
small value, in this case
Math.min(0.7 * timeLabel.height, theme.defaultFont.pixelSize * 1.4)
FIXED-IN: 5.21

M  +14   -3    applets/digital-clock/package/contents/ui/DigitalClock.qml

https://invent.kde.org/plasma/plasma-workspace/commit/fcbfbcbfeca9a31c5ed39ecb6fdc43476b1cd08a
Comment 31 Nate Graham 2021-01-26 03:32:17 UTC
*** Bug 432003 has been marked as a duplicate of this bug. ***
Comment 32 Paul McAuley 2021-01-27 00:18:34 UTC
IMO the font, even after this fix, is still too big.

I like to have my vertical panel just wide enough to have 2 columns of system tray icons. With this configuration I used to be able to (at least initially) have the date all on one row. Now the date is too big and always wraps over 2 rows.

Could we perhaps even have an option just to set the font size manually?
Comment 33 Paul McAuley 2021-01-27 00:53:10 UTC
To clarify my previous comment, I have my date set in custom "ddd d" format.
Comment 34 Paul McAuley 2021-01-27 00:56:38 UTC
Created attachment 135225 [details]
How my date would initially look before this change

This is how my date would initially look before this change. This was fine. Perhaps the date could have been slightly larger, but not a problem
Comment 35 Paul McAuley 2021-01-27 01:00:43 UTC
Created attachment 135226 [details]
How my time and date looks now

This is a screenshot of my time and date looks now - IMO the date is too big.
Comment 36 Carlos 2021-01-27 01:05:15 UTC
Paul, unless you're still seeing this in 5.21, it's the bug reported here, not a matter of configurability, adding further options is not the right fix.
Comment 37 Paul McAuley 2021-01-27 02:31:54 UTC
Created attachment 135227 [details]
Date with seconds added

Yes, I'm talking about the fix in 5.21 beta (5.20.90) still being strange.

Ironically, if you add to display the seconds, everything displays smaller and fits OK.
Comment 38 Piotr Mierzwinski 2021-01-27 10:40:30 UTC
(In reply to Paul M from comment #37)
> Created attachment 135227 [details]
> Date with seconds added
> 
> Yes, I'm talking about the fix in 5.21 beta (5.20.90) still being strange.
> 
> Ironically, if you add to display the seconds, everything displays smaller
> and fits OK.

There is nothing strange about this. If you will add seconds then  font is reduced to fit all the numbers on the watch. Notice that a watch has more characters (+3) so there is more place for the date.
I think the matter is that the font in a watch is the same like in the date. 
In your example (screenshot) in the date there is 6 characters (Wed 27) whilst in a watch you have 5 only., and if is used the same font size then for sure one from them will don't fit.
In my opinion some solution could be decrease font for the date at least with 1 point comparing to the watch.

In my case (also format: "ddd d") this issue doesn't appear because I changed font on Italic and a bit increased of width my panel.
Comment 39 Nate Graham 2021-02-09 21:27:35 UTC
*** Bug 432708 has been marked as a duplicate of this bug. ***
Comment 40 Frank Steinmetzger 2021-02-18 10:39:58 UTC
Created attachment 135831 [details]
The same panel in Plasma 5.20 and 5.21 right before and after the upgrade

Hi Nate, I read about this in your Plasma 5.21 blog post. I just did the upgrade. One of my systems uses a vertical panel, and now its clock looks thus. There is no distance between the two lines anymore. I had to think of this bug report immediately. Could it be related?

The font actually has some metrics in it to have some padding. I know that because when I decided for it, I tried other 7-segment fonts in a horizontal panel and one of the other fonts had no padding to the edge of the panel at all, whereas this one did.
Comment 41 Nate Graham 2021-02-18 16:59:36 UTC
That regression might have been caused by the fix for this, but it would need its own bug report to be actionable. Can you file one? Also, please mention which font and style your clock is using. Thanks!
Comment 42 Frank Steinmetzger 2021-02-18 19:39:27 UTC
I double-checked the font settings. It is in fact the one without any built-in outside margin in terms of line height*. :) So this issue is probably not Plasma’s department after all, even though it worked before™.

However, the margin between the clock text and the edge of the panel is now much smaller. It was not visible on my earlier screenshot with a leading "1", but now, at "20:36", the 2 actually touches the left edge of the screen. And the trailing digit is now very close to the workspace-facing edge of the panel.

And there is of course the one nitpick that the date is now smaller than the time. This has its pros and cons, but you can’t satisfy everyone. :o)

*) The font is DSEG7 classic bold from https://www.keshikan.net/fonts-e.html
Comment 43 Piotr Mierzwinski 2021-03-21 22:42:39 UTC
Seems scaling of date still doesn't work correctly. Please look at attached screenshot.
Please notice that others day are correctly displayed.
Comment 44 Piotr Mierzwinski 2021-03-21 22:43:18 UTC
Created attachment 136932 [details]
Dante incorrectly scaled
Comment 45 Nate Graham 2021-03-21 23:50:14 UTC
What version of Plasma are you using? This looks like it might be a separate issue. Does manually resizing the panel fix it?
Comment 46 Piotr Mierzwinski 2021-03-21 23:51:32 UTC
(In reply to Nate Graham from comment #45)
> What version of Plasma are you using? This looks like it might be a separate
> issue. Does manually resizing the panel fix it?

Operating System: Antergos Linux
KDE Plasma Version: 5.21.3
KDE Frameworks Version: 5.80.0
Qt Version: 5.15.2
Kernel Version: 5.11.7-arch1-1
OS Type: 64-bit
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-6700 CPU @ 3.40GHz
Memory: 15,5 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 530
Comment 47 Piotr Mierzwinski 2021-03-21 23:53:49 UTC
Reopened due to fix doesn't work in the newest stable version.
Comment 48 Nate Graham 2021-03-21 23:57:00 UTC
It is working fine for me. Does the problem go away if you manually resize the panel, as I asked before? Can you please attach a screen recording that shows this?
Comment 49 Piotr Mierzwinski 2021-03-22 00:21:02 UTC
(In reply to Nate Graham from comment #48)
> It is working fine for me. Does the problem go away if you manually resize
> the panel, as I asked before? Can you please attach a screen recording that
> shows this?

For me also works, but only at days different than Sunday and with 1 digit in day number.
I suppose you have locale "US", so your names of day are shorter and thanks that always names fit originaly set panel width.
Please use PL, and check  date  at Sunday, then you will see date in two lines instead of one.
Suggesting increase width in my opinion is not solution only workaround. To be honest I expected decrease size of font, which still cannot be be decreased/increased in configuration.

Please notice that polish translators cannot change this name of day to be shorter, like for example with "Nie", just because this word has own meaning in our language and means "No". 
I'm not 100% sure, but I think that in calendars in an English-speaking country the short for November isn't "No", only "Nov", to avoid misleading.
Comment 50 Nate Graham 2021-03-22 00:25:21 UTC
I'm not suggesting that you increase the width as a fix; I'm trying to understand whether that workaround still works. If it does, then this bug is not fully fixed and we can re-open it. If it does not, then the issue you're seeing is in fact a slightly different bug, and we should leave this one closed and file a new one to track the fix for that.

Does that make sense to you?
Comment 51 Piotr Mierzwinski 2021-03-22 20:54:45 UTC
(In reply to Nate Graham from comment #50)
> I'm not suggesting that you increase the width as a fix; I'm trying to
> understand whether that workaround still works. If it does, then this bug is
> not fully fixed and we can re-open it. If it does not, then the issue you're
> seeing is in fact a slightly different bug, and we should leave this one
> closed and file a new one to track the fix for that.
> 
> Does that make sense to you?

Sorry for misunderstanding, now I found you asked for resize panel to check if problem still persists. I increased width and got date in one line. For example today the day is displayed correctly (with original width of panel) - check attached screenshot. The issue happens only when Sunday happen and day has number contains 2 digits for other is fine.
Comment 52 Piotr Mierzwinski 2021-03-22 20:55:40 UTC
Created attachment 136954 [details]
Date-scalled corectly
Comment 53 Nate Graham 2021-03-22 21:09:13 UTC
Ok I guess it's the same issue. :( Looks like you found an edge case we need to handle as well.
Comment 54 Nate Graham 2021-04-29 16:11:31 UTC
Reducing priority as most issues were fixed; just this little one remains.
Comment 55 Piotr Mierzwinski 2021-08-16 22:27:54 UTC
Issue still persists (for custom date: "ddd d").
When I increase panel to 70 pixels then (today date) "pon.16" fits to panel width, if it has 68 pixels width I get wrapped date, so "pon." in one line, and "16" in second  (check attached screen shot). Size of date font seems to be the same like time.
I think that date and time should be scaled when I increase and decrease panel width, just to fit panel width. It doesn't happen.
I checked this also in up-to-dated KDE Neon. and behavior is the same.

My system font is "Noto" (for more details please check screenshot)
Plasma 5.22.4
KFrameworks 5.85
Qt 5.15.2 (with kde patches)
Graphics Platform: X11
Comment 56 Piotr Mierzwinski 2021-08-16 22:29:24 UTC
Created attachment 140780 [details]
System fonts settings
Comment 57 Piotr Mierzwinski 2021-08-16 22:30:31 UTC
Created attachment 140782 [details]
Vertical_Panel-Date.-1_70px
Comment 58 Piotr Mierzwinski 2021-08-16 22:31:13 UTC
Created attachment 140783 [details]
ertical_Panel-Date.-2_68pix
Comment 59 Nate Graham 2022-01-21 05:41:53 UTC
I can't reproduce this anymore in Plasma 5.24.
Comment 60 Aaron Wolf 2022-01-21 17:10:54 UTC
(In reply to Nate Graham from comment #59)
> I can't reproduce this anymore in Plasma 5.24.

Neither can I. I'm on latest KDE Neon user edition. I haven't seen this problem in a long time. :)
Comment 61 Nate Graham 2022-01-21 17:12:56 UTC
Awesome!
Comment 62 Piotr Mierzwinski 2022-01-22 00:22:34 UTC
(In reply to Nate Graham from comment #61)
> Awesome!

Sorry, did you set locale on polish and set date as Sunday for two digits day like today?
For me issue happens for such settings. I mean date is wrapped on 2 lines. Panel width is 82 (I use default font in Neon). Please notice that fo thisr Saturday (in polish: sob.22) all is fine with mentioned width of panel. I expected that font used in date would change its size during changing width of panel. This doesn't happen at all. All time font has the same size, nothing is adjusted. In result I need to resize panel to 100 to have hole date in one line: "niedz.23".  Of course it depends on font used in system.

I tested this in recent Neon unstable edition with update done after just midnight.
Comment 63 Nate Graham 2022-09-08 17:00:06 UTC
Re-reading the issue you had that you re-opened this bug for, it's a separate issue. Please file it as a new bug report.