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

List:       kde-panel-devel
Subject:    Re: Spacing in a plasma applet
From:       Jesús_Fernández <jesusfs () gmail ! com>
Date:       2010-04-30 11:38:42
Message-ID: h2kce6720b41004300438n6047ad55m85bc7c5bfb3acf9f () mail ! gmail ! com
[Download RAW message or body]

> thanks for fwd'ing it on, Alessandro ...
Thanks, I couldnt find any plasma list on lists.kde.org.

> probably it's spacing the icons out because the size policy and/or size hint
> for the plasmoid is set to "expanding". if you set the size policies to not be
> expanding, then when it is put into the panel it will not take up more space,
> resulting in gaps between the icons.

Thanks for the replies, I tried playing with the size policies and it
kind of works. This is the code I'm using in the init() method of the
Applet:

if self.containment().formFactor() == Plasma.Vertical:
    self.layout = QGraphicsLinearLayout(Qt.Vertical, self.applet)
    qsp = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed,
QSizePolicy.PushButton)
else:
    self.layout = QGraphicsLinearLayout(Qt.Horizontal, self.applet)
    qsp = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed,
QSizePolicy.PushButton)
self.layout.setSpacing(0)
self.applet.setSizePolicy(qsp)
self.applet.setLayout(self.layout)

I'm not quite sure if that's the way I should be doing it because
whenever I set the size policy to anything different than the default
it affects the whole panel the applet goes in. I mean, everything
inside the panel grows beyond the size of the panel just like this
[1]. Using any other policy the icons are again small with gaps in
between, like this [2].
I tried reimplementing the sizeHint method but it never gets called
and I quite dont know what to do there.

[1] http://media.kumomi.es/linux/panel_big.png
[2] http://media.kumomi.es/linux/panel_small.png
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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