Applet resizing (Python)

Aaron J. Seigo aseigo at kde.org
Mon Jun 28 18:28:12 CEST 2010


On June 28, 2010, Thomas Olsen wrote:
>   def collapse_or_expand(self):
>     if not self.collapsed:
>       # snippet for brevity - hiding controls
>       self.collapsed = True
>       self.collapse_button.nativeWidget().setIcon(KIcon("arrow-down"))
>       print "Resizing to: %i" % self.collapsed_height
>       self.applet.resize(self.applet.geometry().width(),
> self.collapsed_height) else:
>       # snippet for brevity - showing controls
>       self.collapsed = False
>       self.collapse_button.nativeWidget().setIcon(KIcon("arrow-up"))
>       self.applet.resize(self.applet.geometry().width(), self.full_height)
>     self.cfg.writeEntry("collapsed", self.collapsed)
>     self.layout_widgets()
> 
> When collapsing resize() is called with the correct values but straight
> after that new_geometry get's triggered again with a height value of ~60
> pixels more...

first, when an applet changes its own size (which is generally frowned upon, 
thought not always avoidable) it needs to emit the appletTransformedItself() 
signal.

beyond that, it could be an issue with the default sizes of the elements in 
your layout, so when the layout is recalculated they say they are larger 
again? dunno..

-- 
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 Qt Development Frameworks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20100628/8ff27e15/attachment.sig 


More information about the Plasma-devel mailing list