[PATCH}Re: Konqueror throbber size -- too small and doesn't resize

David Faure faure at kde.org
Mon Jun 9 10:59:53 BST 2008


On Saturday 07 June 2008, James Richard Tyrer wrote:
> 17 pixels is correct for 12 points @ 100 DPI but where does the extra 3 
> pixels come from and is there a way to obtain this value?
 
It comes from the widget style. QMenuBar::sizeHint adds:

QStyle::SH_MainWindow_SpaceBelowMenuBar + 2 * (QStyle::PM_MenuBarPanelWidth + QStyle::PM_MenuBarVMargin)

to the action's text, but then it looks at the corner widgets (like the throbber), and
calculates that the same margin as the one above will be above/below the corner widget.

So there's no way for the corner widget to be as high as the menubar, it can only be as
high as the text inside the menubar.

(and then style()->sizeFromContents(QStyle::CT_MenuBar) is called, which can make the
menubar higher than the above calculation, e.g. qplastiquestyle adds 2 pixels)

> There is clearly room for a larger throbber

There is, but not with Qt adding the above margin to the corner widget's height.
We're lucky setCornerWidget exists in the first place (it's still marked as \internal,
i.e. it wasn't meant to be used out of Qt...), I think we'll have to make do with the
inability to use a few pixels (I filed a request for setCornerWidget to be real public
API with more alignment options some time ago already; TT task 200779).

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kfm-devel mailing list