Bug 486411 - Renamed sensor labels are truncated in "System monitor Sensor" widgets set to "Text Only" display style and placed in panels
Summary: Renamed sensor labels are truncated in "System monitor Sensor" widgets set to...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: System Monitor widgets (show other bugs)
Version: 6.0.4
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-01 16:44 UTC by LeopardEnthusiast
Modified: 2024-05-10 01:50 UTC (History)
3 users (show)

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


Attachments
Sensor with default name, displaying correctly (102.23 KB, image/png)
2024-05-01 16:44 UTC, LeopardEnthusiast
Details
Sensor with changed name, displaying incorrectly. The last 2 characters are replaced with an ellipsis. (107.19 KB, image/png)
2024-05-01 16:45 UTC, LeopardEnthusiast
Details

Note You need to log in before you can comment on or make changes to this bug.
Description LeopardEnthusiast 2024-05-01 16:44:39 UTC
Created attachment 169077 [details]
Sensor with default name, displaying correctly

SUMMARY
Renaming a sensor in a system monitor sensor widget on a panel causes its label to have the last 2 characters cut off.  This happens even if the new name is much shorter than the default one, but not if the new name is a single character - single-character names display normally.

STEPS TO REPRODUCE
1. Add a "System monitor Sensor" widget to a panel
2. Set the widget to the "Text Only" display style
3. Add a sensor to the widget (must be from the "Sensors" section, not Total Sensor or Text-Only Sensors - those will not display at all, which has already been reported as bug #453898) and click "Apply".
4. Click the pencil icon on the sensor, and rename it to anything except a single character.  Click "Apply" again.

OBSERVED RESULT
The last 2 characters of the changed name are replaced with an ellipsis.

EXPECTED RESULT
The name should be displayed in full.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Kinoite 40
(available in About System)
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Comment 1 LeopardEnthusiast 2024-05-01 16:45:20 UTC
Created attachment 169078 [details]
Sensor with changed name, displaying incorrectly.  The last 2 characters are replaced with an ellipsis.
Comment 2 Bug Janitor Service 2024-05-06 11:17:11 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kquickcharts/-/merge_requests/77
Comment 3 Arjen Hiemstra 2024-05-07 09:56:10 UTC
Git commit 4e2e898286e1de58bb321b71808d1bed87eff9a0 by Arjen Hiemstra.
Committed on 06/05/2024 at 11:15.
Pushed by ahiemstra into branch 'master'.

controls: Ceil all components of preferredWidth in LegendDelegate contents

Layout internally `ceil()`s all sizes, so not doing the same means we
get a slight mismatch between the preferred size the layout wants to be
at and the preferred size we calculate, leading to the label being
elided.

While we're at it, drop the Item container and FontMetrics usage which
can be done using Label's implicitWidth these days.

M  +8    -19   controls/LegendDelegate.qml

https://invent.kde.org/frameworks/kquickcharts/-/commit/4e2e898286e1de58bb321b71808d1bed87eff9a0