Bug 501166 - When placed in panel with multiple spacers, the Media Player widget is almost always slightly too small for the text to fit
Summary: When placed in panel with multiple spacers, the Media Player widget is almost...
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Media Player widget (show other bugs)
Version: 6.3.2
Platform: Fedora RPMs Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-07 00:14 UTC by darxoon
Modified: 2025-03-09 04:58 UTC (History)
4 users (show)

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


Attachments
A screenshot of the widget displaying "Alpha" by C418, but the word Alpha is cut off to "Alp..." (6.49 KB, image/png)
2025-03-07 00:14 UTC, darxoon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description darxoon 2025-03-07 00:14:38 UTC
Created attachment 179193 [details]
A screenshot of the widget displaying "Alpha" by C418, but the word Alpha is cut off to "Alp..."

SUMMARY
When the Media Player widget is placed in a panel with 2 or more spacers, the title on the widget is always slightly cut off, no matter how long the text is.

STEPS TO REPRODUCE
1. Create a panel
2. Add the Media Player widget to it
3. Add 2 or more spacers with flexible size to the panel
4. Play a video or song

OBSERVED RESULT
Even if there is enough space for the full title, the last few characters are always cut off behind an ellipsis ("...")

EXPECTED RESULT
If there is enough space for the full video/song/etc title to fit, then it should display the entire title

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 41
KDE Plasma Version: 6.3.2
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2

ADDITIONAL INFORMATION
Comment 1 TraceyC 2025-03-07 16:39:58 UTC
I confirmed this on git-master
Comment 2 Nate Graham 2025-03-09 04:33:35 UTC
I can only sometimes reproduce this; it seems to depend on the actual text. For example:

With a song named, "Void Obsidian: NGC 2244", it works fine.
With a song named, "Void Obsidian: NGC 2246", the text gets cut off.
Comment 3 Nate Graham 2025-03-09 04:49:57 UTC
This fixes it for everything in my testing:

diff --git applets/mediacontroller/package/contents/ui/CompactRepresentation.qml applets/mediacontroller/package/contents/ui/CompactRepresentation.qml
index 2bf97b116c..72b71b3666 100644
--- applets/mediacontroller/package/contents/ui/CompactRepresentation.qml
+++ applets/mediacontroller/package/contents/ui/CompactRepresentation.qml
@@ -25,7 +25,7 @@ Loader {
         switch (compactRepresentation.layoutForm) {
         case CompactRepresentation.LayoutType.HorizontalPanel:
         case CompactRepresentation.LayoutType.HorizontalDesktop:
-            return implicitWidth;
+            return implicitWidth + 10;
         default:
             return -1;
         }

That's obviously the wrong change to fix it, but it shows that the Loader's implicitWidth is being set to something slightly too narrow.
Comment 4 Nate Graham 2025-03-09 04:52:54 UTC
Actually, even just +1 is enough.
Comment 5 Nate Graham 2025-03-09 04:58:05 UTC
Can't figure out why; giving up for now. Somebody smarter than me might be able to fix it.