[PATCH}Re: Konqueror throbber size -- too small and doesn't resize
David Faure
faure at kde.org
Thu Jun 12 00:13:34 BST 2008
On Thursday 12 June 2008, James Richard Tyrer wrote:
> David Faure wrote:
> > On Wednesday 11 June 2008, James Richard Tyrer wrote:
> >> I don't know why I am getting 30 pixels.
> >>
> >> So, I tried different font sizes for the Menu font and it does not
> >> change the throbber size. So, the problem is probably as you said that
> >> the layout hasn't been done yet and the 30 pixels is probably the
> >> default height.
> >
> > Yes. Please read the code in svn, I fixed all this already. But fredrikh made
> > me realize that setting an icon size to 18x18 or 19x19 was a bad idea,
> > the pixmap gets scaled, so now I understand your if()s that round to a known
> > icon size. I'll merge this in, but I'll also force the button size so that it gets
> > vertically centered, this is what was bothering me most.
> >
> I was having build problems so didn't get to try this till now. It
> doesn't seem to work for me. I get a 21x21 icon with a 12 pt. Menu font
> and the same with a 24 pt..
Did you update again after I committed 819749 (only a few minutes before your mail) ?
Should be better now.
> Yes, the icons sizes should be set to one of the standard values as my
> patch does. We have KDE throbber icons in 16x16, 22x22, 32x32 & 48x48.
> So, somewhere after 48 we should go to variable size. The code in my
> patch:
Yep I put that in, now.
> + if ( size < KIconLoader::SizeSmallMedium )
> + size = KIconLoader::SizeSmall;
> + else if ( size < KIconLoader::SizeMedium )
> + size = KIconLoader::SizeSmallMedium;
> + else if ( size < KIconLoader::SizeLarge )
> + size = KIconLoader::SizeMedium ;
> + else if ( size < KIconLoader::SizeHuge )
> + size = KIconLoader::SizeLarge;
>
> does this for sizes greater than or equal to "SizeHuge" -- that is,
> "SizeHuge" or larger drops through the If-Else structure unchanged. I
> don't suppose that we really need to worry about a throbber larger than
> 48x48 but I was asked to also make an SVG which I have put on my to-do list.
Ah so my initial value is wrong, I should set iconSize to buttonSize by default, OK.
> Your code is rather complex.
It asks the style, which is the only proper solution :)
> Should we consider it a bug in Qt that
> using: "(menuBar()->contentsRect()).height()" doesn't provide us with
> the correct number?
Nope. There's no layouting before the window is shown.
> Thanks for working on this. It seemed like it would be simple when I started.
Yeah :-)
But anyway I'm starting to consider making it a QLabel instead. This way we can get rid
of that internal padding that all styles want to use for a toolbutton. And if we really want
to still have some click action [broken in 4.x], we can still do it, the feature (well, easter egg :)
is just as hidden if it's a qlabel than it was with a qtoolbutton anyway :)
--
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