[Panel-devel] Desktop Icons Patch

Christopher Blauvelt cblauvelt at gmail.com
Wed Dec 19 16:43:39 CET 2007


On Dec 19, 2007 8:53 AM, Aaron J. Seigo <aseigo at kde.org> wrote:

> On Wednesday 19 December 2007, Marco Martin wrote:
> > the minimum size of the icon is too big for the panel
> > and the applet should have an expandingdirections 0 otherwiseit eats all
> > the available space in a boxlayout
>
> this:
>
>  setMinimumContentSize(QSize(48,78));


Agreed.  I've been working on a way to do this but have been unable to find
a way to get the fontmetrics of the display.  I believe it's available in
QStyleGraphicsItem but that is not available upon creation of the widget.


>
>
> should probably be based on the height() of the font that will be used?
>
> > this patch should address these issues, in particular i made the
> > minimumcontentsize dependent from the containment, because in the panel
> the
> > icon doesn't have text (->different aspect ratio) and it should still be
> > possible to have a very tiny panel like 16 pixels or so.
>
> ineed.
>
> > i think it should be done to every applet that uses an icon widget (move
> it
> > down to icon widget?)
>
> some of it will need to, yes.
>
> > it still has the problem of the elided text that i feel it's kinda
> > connected with this one, i think the aspect ratio of the icon should
> change
> > upon resizing to make enough room for at least 15-16 characters, but i
> > still don't know how to do it
>
> ok, this part belongs in the applet. basically what you want to do is in
> constraintsUpdated you will want to respond to (constraints &
> SizeConstraint)
> and calculate a new width based on the height.
>

I've added a sizeHint to the widget just for that purpose.  My plan is to
compare the sizeHint of the Widget and compare that the size constraints of
the Applet and accomodate the Widget if it fits within the size constraints
of the applet.


>
> you can either set the new width right there or use contentSizeHint.
> either
> way, you need to be careful not to create an infinite loop: changing the
> size
> may well cause another call to constraintsUpdated for SizeConstraint; so
> the
> calculation needs to be stable (always returning the same width for the
> same
> height)
>
> --
> Aaron J. Seigo
> humru othro a kohnu se
> GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43
>
> KDE core developer sponsored by Trolltech
>
> _______________________________________________
> Panel-devel mailing list
> Panel-devel at kde.org
> https://mail.kde.org/mailman/listinfo/panel-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/panel-devel/attachments/20071219/9a8cc438/attachment.html 


More information about the Panel-devel mailing list