PATCH: KProgress (#44279)

Maks Orlovich mo002j at mail.rochester.edu
Sat Dec 14 01:03:31 GMT 2002


(Sending here as no maintainer listed in the MAINTAINERS file, and it is to 
kdelibs)...

Hi..

In short: The attached patch tries to address  #44279 by having KProgress turn 
on centering of the indicator when a custom format string is set. 

Background: LightV2, LightV3, and some Qt styles (Qt Platinum, Qt Windows) 
draw the text string for the progressbar on the side of it, and not centered. 
That requires laying out the space for the text in advance (since otherwise 
the length of the bar section may change - ugly). That's easy when there are 
percentages - at most 4 digits will be output; but that's pretty much 
impossible with arbitrary format strings KProgress supports (and besides, 
there may simply not be enough room). Thus, right now they don't work well at 
all with the above mentionned styles. The patch just forces the indicator to 
center on the user setting a format string other then %p%. It's somewhat ugly 
in that it triggers a behavior change based on an unrelated settings, but 
it's:

a. documented in the patch.
b. A lot better than having the text cutoff.
c. Invisible in all other styles, which do the centering anyway..

Comments, suggestions?

Thanks,
Maksim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kprog.diff
Type: text/x-diff
Size: 1292 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20021213/3f683843/attachment.diff>


More information about the kde-core-devel mailing list