Layout resizing

Hello !

I have 3 buttons in a HorizontalLayout. When the mouse enters in a button, it grows. When the mouse exits the button, it shrinks.
The problem is that the layout containing these 3 buttons is never resizing : if one of the buttons grows, we actually don’t see the changes.

Has anyone got an idea ? Am I clear enough ?
11619.png

How are you resizing your buttons? With CSS or GWT?

The Vaadin core layouts need to be notified via JavaScript/GWT code if the size of their child components change out of their update routines, in order for them to provide the necessary space for them to show.

If you use CSS to scale the buttons, then there’s not much you can do. I can only suggest using CssLayout or CustomLayout as the root for those buttons, which allow their child elements to grow a bit more naturally.

If you use GWT for the sizing, then you can call
applicationConnection.notifyParentOfSizeChange(this);
after each frame in your animation. Do note, that this might be a very slow computation, depending on your page/layout structure.

Thank you Jouni, it works !

I do it in GWT and use the method Util.notifyParentOfSizeChange(this, false);

Great! Yeah, so it was Util and not applicationConnection that had the method. My bad.