Fwd: New Comment for "Currency Converter"

Thomas Olsen tanghus at gmail.com
Tue Oct 20 01:26:25 CEST 2009


On 20/10-2009 00:46 "Aaron J. Seigo" <aseigo at kde.org> wrote:
> On October 19, 2009, Thomas Olsen wrote:
> > Thanks anyways. I think maybe I've misunderstood what the user meant and
> > thinking about it it doesn't feel like a good solution.
> 
> yes, it's not what locking is for. some people have gotten it into their
>  head that locking widgets is part of the daily plasma workflow. it's not.
>  unfortunately some eager users out there have run around in various online
>  forums / mailing lists making it sound that way ;)
> 
> > I'm now looking for
> >  a way to let the Plasmoid collapse/expand the controls with an up/down
> >  button.
> 
> pretty easy to do, really ... a button, a slot connected to its clicked
> signal, a method than shows/hides the widgets :)
> 

That's what I've tried so far but it doesn't seem to work, at least not in 
plasmoidviewer. It shows and hides the widgets first but I cannot get the 
layout to update. I've tried invalidating and activating but nothing happens 
even if I resize the viewer. Guess I'll have to try to install it to properly 
see how it reacts on the desktop.

    def collapse_or_expand(self):
        if not self.collapsed:
            self.from_label.hide()
            self.currency_from.hide()
            self.to_label.hide()
            self.currency_to.hide()
            self.collapsed = True
            #self.resize(360,80)
        else:
            self.from_label.show()
            self.currency_from.show()
            self.to_label.show()
            self.currency_to.show()
            self.collapsed = False
            #self.resize(360,160)
        self.grid_layout.invalidate()
        self.top_layout.invalidate()
        self.grid_layout.activate()
        self.top_layout.activate()

On a side note I don't think I need nested layouts. A grid layout is enough.

-- 
Best Regards / Med venlig hilsen

  Thomas Olsen



More information about the Plasma-devel mailing list