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

List:       kde-pim
Subject:    Re: [Kde-pim] [PATCH] KOrganizer: squeezing text in monthview, 2nd
From:       David Faure <dfaure () klaralvdalens-datakonsult ! se>
Date:       2003-07-12 8:58:25
[Download RAW message or body]

On Friday 11 July 2003 23:40, Tim Jansen wrote:
> > But yes, it wraps at word boundaries, that was the whole point of it :}
> > I was just surprised that you needed iterations - if you're cutting at the
> > char that doesn't fit, then that's a straightforward thing... what's the
> > reason for the iterations?
> 
> It's just a different way of doing it, somewhat inspired by KSqueezedLabel. 
> I know the width of the cell in pixels (cw), and can calculate the width of 
> the complete text in pixels (tw), so I can guess that I should resize the 
> text to text.lenght() * cw / tw. 
... or you could add the width of every char, until > cw, and gray out the
last 3 ones (I still don't see the need for any high-level iteration...).

> No, as adding charWidth() works that is at least as good (probably better, if 
> FontMetric::boundaryRect() behaves o(n)).
Right, which is why calling it in a loop doesn't exactly sound like a good thing to do.

-- 
David Faure -- faure@kde.org, dfaure@klaralvdalens-datakonsult.se
Qt/KDE/KOffice developer
Klarälvdalens Datakonsult AB, Platform-independent software solutions
_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

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