[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 12:56:38
Message-ID: z2mce6720b41004300556y8555016p5a7c075f8c5d316f () mail ! gmail ! com
[Download RAW message or body]

2010/4/30 Jesús Fernández <jesusfs@gmail.com>:
>> 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
>

Sorry, I also tried what Marco said but it's the same, nothing changes
and they still have those unwanted gaps. Should I apply the policy to
the applet or the buttons?
_______________________________________________
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