Page 1 of 1

Remove default padding of work-screen

PostPosted: Fri Oct 28, 2016 1:25 pm
by Development@SIB
The standard application frame with Vaadin UI adds a default padding of 5 pixels to every screen if margins of screen layout are smaller than 5 pixels.

An example:

screen_defaultpadding.png
screen_defaultpadding.png (47.32 KiB) Viewed 527 times

and the html code:

screen_defaultpadding_html.png
screen_defaultpadding_html.png (44.84 KiB) Viewed 527 times


To change the default padding, simply set a custom margin in your screen, e.g.

Code: Select all
getLayout().setMargins(new UIInsets(8, 8, 8, 8));

or set/add the style:

Code: Select all
setStyle(new Style("nopadding"));

to remove the default padding.

Here's the result without default padding:

screen_nopadding.png
screen_nopadding.png (38.92 KiB) Viewed 527 times

The default padding of the screen is now unset, but the users layout has custom margins:

Code: Select all
layUsers.setMargins(7, 2, 5, 5);