Bug 448541 - KCapacityBar width is shorter than it should (using Breeze theme)
Summary: KCapacityBar width is shorter than it should (using Breeze theme)
Status: REPORTED
Alias: None
Product: frameworks-kwidgetsaddons
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Christoph Feck
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-15 17:43 UTC by nttkde
Modified: 2022-01-15 17:45 UTC (History)
2 users (show)

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


Attachments
example (15.31 KB, image/jpeg)
2022-01-15 17:43 UTC, nttkde
Details

Note You need to log in before you can comment on or make changes to this bug.
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 )