Bug 501166

Summary: When placed in panel with multiple spacers, the Media Player widget is almost always slightly too small for the text to fit
Product: [Plasma] plasmashell Reporter: darxoon
Component: Media Player widgetAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: minor CC: ilija.tovilo, isma.af, kde, kdedev, nate
Priority: NOR    
Version First Reported In: 6.3.2   
Target Milestone: 1.0   
Platform: Fedora RPMs   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=485540
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: A screenshot of the widget displaying "Alpha" by C418, but the word Alpha is cut off to "Alp..."

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.
Comment 6 ilutov 2025-11-13 15:21:16 UTC
Same issue here. I replicate a Windows 110 layout (task icons in the middle, media player + try on the right), which sadly triggers this bug.