Remove space on invisible widgets

43 views
Skip to first unread message

Javier Uribe

unread,
May 28, 2018, 12:51:00 PM5/28/18
to Kivy users support
I'd like to make some widgets invisible so i put them with opacity to 0. The problem is that they are invisible but they take space. So I'm implementing a way to remove the space they take.

As the widgets display vertically I thought that I just had to set the size_hint_y to 0 so theoretically they wouldn't take any percentage of the parent's height but it is not working.

To sum up, I have a vertical layout with widgets, if you set the opacity to 0 they are invisible but taking space and I want to remove it, so the next widget would take its place like it wouldn't exist.

So any ideas?

Javier Uribe

unread,
May 29, 2018, 3:54:33 AM5/29/18
to kivy-...@googlegroups.com
The layouts would be like this:

GridLayout
    cols
:1    

   
BoxLayout
   
BoxLayout
   
...
   
BoxLayout


   
So basically we have 1 column and a lot of rows. I want the remove the space the horizontal boxlayouts take.
Thank you very much.

Pieter van der Meer

unread,
May 29, 2018, 4:24:04 AM5/29/18
to kivy-...@googlegroups.com
Why not just rebuild the entire layout? 

On Tue, May 29, 2018 at 9:54 AM, Javier Uribe <javier.u...@gmail.com> wrote:
The layouts would be like this:
GridLayout
    cols:1   
    BoxLayout
    BoxLayout
    ...
    BoxLayout
   
So basically we have 1 column and a lot of rows. I want the remove the space the horizontal boxlayouts takes.
Thank you very much.
El lunes, 28 de mayo de 2018, 18:51:00 (UTC+2), Javier Uribe escribió:
I'd like to make some widgets invisible so i put them with opacity to 0. The problem is that they are invisible but they take space. So I'm implementing a way to remove the space they take.

As the widgets display vertically I thought that I just had to set the size_hint_y to 0 so theoretically they wouldn't take any percentage of the parent's height but it is not working.

To sum up, I have a vertical layout with widgets, if you set the opacity to 0 they are invisible but taking space and I want to remove it, so the next widget would take its place like it wouldn't exist.

So any ideas?

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Pieter van der Meer
System engineer / Owner
Tasty Chips Electronics
www.tastychips.nl

Javier Uribe

unread,
May 29, 2018, 4:58:45 AM5/29/18
to Kivy users support
I've just solved it! It turns out that if we have widgets inside a boxlayout (which is inside a gridlayout), and we want to change their percentage of space the way to do it is by changing the boxlayout's size_hint, not the widgets's. So If I set the size_hint_y to 0 on the boxlayouts it works.

El lunes, 28 de mayo de 2018, 18:51:00 (UTC+2), Javier Uribe escribió:
Reply all
Reply to author
Forward
0 new messages