[Icon Plasmoid] Provide a generic plasmoid class for icon based plasmoid

Loïc Marteau loic.marteau at gmail.com
Sat May 31 19:49:23 CEST 2008


Aaron J. Seigo wrote:
> On Saturday 31 May 2008, Loïc Marteau wrote:
>   
>> void ShowDesktop::constraintsEvent(Plasma::Constraints constraints)
>> {
>>     m_icon->resize(contentsRect().size());
>> }
>>     
>
> if you put your icon in a layout, this shouldn't be necessary:
>
> QGraphicsLineartLayout *layout = new QGraphicsLineartLayout(this);
> layout->setContentsMargins(0,0,0,0);
> layout->setSpacing(0);
> layout->addItem(m_icon);
>
>   
Thanks !
>> I think that such icon plasmoid should be a little more little (*0.75
>> would be fine) and still take too much unused width space (it is much
>> better with setAspectRatioMode(Plasma::Square) but still not perfect).
>> Question 3 :
>> How can i do to reduce the size to 75 % ?
>>     
>
> looking at your screenshot, i can see  what you are trying to do (make all the 
> icons similar/the same size) but this isn't the approach to take as it doesn't 
> follow 
>
>   
What approach do you think is the better for plasma about this stuffs ?

I would like to have icon plasmoid with the same default size (the same 
as the screenshot) perhaps 75 %
but size should be configurable (by setting an other percentage in the 
class ?) .
In the screenshot the K button is bigger than others and i think it's 
great to can do this.
>> Question 4 :
>> It is possible to reduce the width of unused space when we use the
>> setAspectRatioMode(Plasma::Square) shortcut ?
>>     
>
> then it really isn't square, is it? =)
>
>   
Yes it is, sorry for my poor english. In fact i think that with this 
method (plasma::square) the width of plasmoid is well optimized and it 
is not the case of a lot of other plasmoids and we should fix this by 
providing a good (generic :op ?!) way to deal with this size problems.

I would like to help, maybe i can correct some plasmoid if i find such 
good way ?!
What do you think about proposing a recommended way to implement an icon 
plasmoid ?

In fact there is still a space (too big imho) between each plasmoid. Is 
it possible to reduce it ?
> in the case of the icons, we probably don't actually want to be using 
> Plasma::Square, but just set the size policy to be minimum for the growth 
> direction (horizontally on horizontal panels, vertically on vertical panels)
>   
so isn't the idea to provide a generic class for them not good ? you 
begin the conversation by seeing that it was
setAspectRatioMode(Plasma::Square) being for :op

Thanks a lot for your help and your work in plasma !
:o)

Cheers

Loic


More information about the Panel-devel mailing list