Bug 448541

Summary: KCapacityBar width is shorter than it should (using Breeze theme)
Product: [Frameworks and Libraries] frameworks-kwidgetsaddons Reporter: nttkde <watisthispoo>
Component: generalAssignee: Christoph Feck <cfeck>
Status: REPORTED ---    
Severity: normal CC: kde, kdelibs-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: example

Description nttkde 2022-01-15 17:43:10 UTC
Created attachment 145504 [details]
example

Not sure if this has already been reported but...

Device capacity bars at least in KFilePlacesView (eg. in various "Open" dialogs) do not extend to their full expected width (=not as wide as the text above). 

I believe the reason could be because by default the capacity bar code has textVisible=true set in KCapacityBar::drawCapacityBar() [kcapacitybar.cpp:167].
Then eg. Breeze theme's breezestyle.cpp : progressBarGrooveRect() evaluates textVisible as true and reserves space for the nonexistent text on its right side (by default padding and width of the string "100%" from progressBarLabelRect() I think ?).


Maybe KCapacityBar should test the text for isEmpty() or something and set the textVisible accordingly?
(If so, note that KCapacityBar's text may be changed after initialization too.)


I think the reason why the capacity bar isn't shorter in eg Oxygen theme is that unlike Breeze, it would render the text inside the bar, not on its right side.


(Related to the quirks in https://invent.kde.org/system/dolphin/-/merge_requests/309 )