Bug 469576 - In Volume OSD, "100%" volume string is a multi-line string
Summary: In Volume OSD, "100%" volume string is a multi-line string
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Theme - Breeze (show other bugs)
Version: 5.27.5
Platform: Other Linux
: HI normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression
: 469759 469943 470377 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-05-10 11:24 UTC by Maximilian Böhm
Modified: 2023-08-05 03:46 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.8


Attachments
Double rowed 100% indicator (41.86 KB, image/png)
2023-05-10 11:24 UTC, Maximilian Böhm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maximilian Böhm 2023-05-10 11:24:37 UTC
Created attachment 158826 [details]
Double rowed 100% indicator

Right after the Plasma 5.27.5 release I found that the 100% volume indicator notification now is double-rowed. I’m using 162,5% UI scale on X.org. See the screenshot.
Apart from this visual bug, the auditive plop sound is missing too but I guess this is such a striking issue that someone will fix this without a separate bug report.

KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.9
Comment 1 Maximilian Böhm 2023-05-13 01:20:35 UTC
(My second problem in this ticket with missing plop sound is resolved: Notification sound was set silent.)
Comment 2 Patrick Silva 2023-05-14 20:31:02 UTC
*** Bug 469759 has been marked as a duplicate of this bug. ***
Comment 3 Nate Graham 2023-05-15 17:55:20 UTC
Well that's weird. Never seen that before. Probably a width calculation rounding error somewhere that only happens when using certain fractional scale factors.
Comment 4 postix 2023-05-15 18:49:36 UTC
Not only 162,5% is affected but also simple integer 200% scaling as I mentioned in my dup bug report.
Comment 5 Nate Graham 2023-05-15 18:51:12 UTC
I use 200% scale myself and FWIW, have never seen this with either 10pt Noto Sans or 11pt Noto Sans, on either X11 or Wayland.
Comment 6 postix 2023-05-15 20:30:06 UTC
(In reply to Nate Graham from comment #5)
> I use 200% scale myself and FWIW, have never seen this with either 10pt Noto
> Sans or 11pt Noto Sans, on either X11 or Wayland.

200% scale, 10pt Noto Sans and to go sure it's not a caching issue, I have emptied `~/.cache/` and rebooted, but the issue still persists. 
However, I can reproduce it with any scaling, e.g. 100% or 150%. Thus it doesn't seem to be related to _a_ scaling factor.

Also cannot remember to have ever seen it on 5.27.4 or prior, therefore I have added the regression keyword.
Comment 7 postix 2023-05-15 20:34:03 UTC
I cannot reproduce the issue when having a 200% scaling and Noto Sans <= 5pt, but for Noto Sans >= 6 pt.
My comments only regard the Wayland session.
Comment 8 Nicolas Fella 2023-05-18 13:11:30 UTC
*** Bug 469943 has been marked as a duplicate of this bug. ***
Comment 9 Nicolas Fella 2023-05-18 16:58:45 UTC
This is caused by https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2795

With the translations fixed the string now is e.g. "110 %" while before the untranslated string was "110%" (note the space between the number and percent). Whether you are affected by this therefore depends on your language
Comment 10 Bug Janitor Service 2023-05-18 17:08:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2935
Comment 11 Ismael Asensio 2023-05-20 20:06:48 UTC
(In reply to Nicolas Fella from comment #9)
> This is caused by
> https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2795
> 
> With the translations fixed the string now is e.g. "110 %" while before the
> untranslated string was "110%" (note the space between the number and
> percent). Whether you are affected by this therefore depends on your language

In case the translation has both a space in the actual string and the fixed "maximum string" "100 %" (which is a fair assumption), it might be an issue with `TextMetrics.width`, which has shown some problems in the past, specially when measuring whitespaces (example: https://bugs.kde.org/show_bug.cgi?id=421973 and https://invent.kde.org/system/dolphin/-/merge_requests/22). Usually `advanceWidth` provides a better value
Comment 12 Nicolas Fella 2023-05-28 21:51:47 UTC
*** Bug 470377 has been marked as a duplicate of this bug. ***
Comment 13 Kai Uwe Broulik 2023-08-01 19:38:22 UTC
Git commit 9737efa79440b65db303030f34f0039f1c9cd6a0 by Kai Uwe Broulik.
Committed on 01/08/2023 at 21:24.
Pushed by broulik into branch 'master'.

OSD: Fix size calculation for progress value

Use a common function for formatting the percent, so placeholder 100% label will
use the exact formatting used by the label next to the progress bar.

Also use font advanceWidth, which is the appropriate means of calculating the
bounding box of text in this case. Also ceil it to avoid subpixel alignment.

And to be absolutely sure disable word wrapping.

M  +8    -3    lookandfeel/org.kde.breeze/contents/osd/OsdItem.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/9737efa79440b65db303030f34f0039f1c9cd6a0
Comment 14 Kai Uwe Broulik 2023-08-01 20:06:00 UTC
Git commit 94b2c3d1d4a72d70d487513954601c2cf723e673 by Kai Uwe Broulik.
Committed on 01/08/2023 at 21:41.
Pushed by fvogt into branch 'Plasma/5.27'.

OSD: Fix size calculation for progress value

Use a common function for formatting the percent, so placeholder 100% label will
use the exact formatting used by the label next to the progress bar.

Also use font advanceWidth, which is the appropriate means of calculating the
bounding box of text in this case. Also ceil it to avoid subpixel alignment.

And to be absolutely sure disable word wrapping.
(cherry picked from commit 9737efa79440b65db303030f34f0039f1c9cd6a0)

M  +8    -3    lookandfeel/org.kde.breeze/contents/osd/OsdItem.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/94b2c3d1d4a72d70d487513954601c2cf723e673