[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-usability
Subject:    Re: gtk+ file selector mockups
From:       Mikolaj Machowski <mikmach () wp ! pl>
Date:       2004-01-08 20:44:36
Message-ID: 200401082144.37976.mikmach () wp ! pl
[Download RAW message or body]

Dnia Thursday 08 of January 2004 17:57, Aaron J. Seigo napisał:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Wednesday 07 January 2004 06:20, Mikolaj Machowski wrote:
> > > instead of 8 hardcoded, it should be KDialog::spacingHint() ...
> >
> > Tried it but:
> > 	Looks like default setting is 0 which makes border of item can be at
> > 	border of image which can looks ugly. See
>
> the default is 6 (hardcoded)....
>
> > 	http://skawina.eu.org/mikolaj/bigsmallicons2.png
> >
> > 	Note: top of the house and 'y' in 'directory' are touching edges and
> > 	this is Ugly(tm)
>
> i just went through the code a bit more thoroughly... the poor result is
> because with the default setting of 6 that's only 3 pixels per side and
> the frame takes a couple pixels to draw and is inset one pixel on each
> side and so it runs into the words... the same is true with the larger
> icons; it seems that the author wanted a "thin" margin, but didn't make
> it wide enough...
>
> 8 pixels works (4px per side) as in your original patch, but perhaps
> KDialog::spacingHint()*2 would be nicer (6px per side) ... would have to
> look and see, i suppose =)
>
> > BTW, after 'else' is '+ 6' thus I copied existing solution.
>
> this doesn't work either, as the text will touch the border if the text
> is too wide...
>
> the text should also be truncated when painting... see attached patch...

Your forgot about #include <kstringhandler.h> and:
lb undeclared, first use in this function.

void KURLBarItem::setText( const QString& text )
{
    QString visibleText = KStringHandler::lPixelSqueeze( text,
                                                         lb->fontMetrics(),
                                                         lb->width() - 
(KDialog::spacingHint() * 2) );
    QListBoxPixmap::setText(text);
}

m.

_______________________________________________
kde-usability mailing list
kde-usability@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-usability
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic