[Panel-devel] [PATCH] Plasma::icon resizing

Marco Martin notmart at gmail.com
Wed Dec 19 13:04:16 CET 2007


On Wednesday 19 December 2007, Aaron J. Seigo wrote:
> On Tuesday 18 December 2007, Marco Martin wrote:
> > On Tuesday 18 December 2007, Aaron J. Seigo wrote:
> > > On Tuesday 18 December 2007, Jason Stubbs wrote:
> > > > On Tuesday 18 December 2007 03:48:42 Marco Martin wrote:
> > > > > Hi,
> > > > > this patch makes the icons to resize when the applet is resized,
> > > > > and sized small enough to leave room for the text label.
> > > > > how does it look?
> > > >
> > > > Wow! Less code than I thought it would take.
> > > >
> > > > I tested by adding labels on to the icons for the lock/logout widget.
> > > > You'll need to remove expandingDirections() so that the icon will
> > > > expand when in a layout too. Also, there doesn't seem to be quite
> > > > enough room for the text as well. But it's close. :)
> > >
> > > and then you can commit; good work to everyone working on the icon
> > > issues =)
> >
> > Plasma::Icon is my favourite foe:)
>
> testing this now i see that there are some remaining problems, at least
> when the icons are used in the Url widget; i haven't tested them
> separately.
>
> the issue is that when there is more vertical space than necessary, the
> text is far below the icon. it should be snugged up.
>
> it might be useful if Plasma::Icon could return an "optimal" size based on
> text width and overall height (e.g. if the height given in N, then the icon
> will be X pixels high and the text Y pixels in height meaning that N-(X+Y)
> is really the height that should be used ...)

so i would say an height sufficient to contain the text and no more and a 
width enough to have room for a medium-lenght filename.
how to connect that optimal size (sizeHint()?) to the containig applet? at the 
moment it always has the aspect ratio that is set by setMinimumContentSize

> (btw, i've spent this evening playing with various things in plasma ...
> have a list of things to fix up tomorrow on my plate ...)




More information about the Panel-devel mailing list