Remove default padding of work-screen

Information about development with ProjX.

Remove default padding of work-screen

Postby Development@SIB » Fri Oct 28, 2016 1:25 pm

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 525 times

and the html code:

screen_defaultpadding_html.png
screen_defaultpadding_html.png (44.84 KiB) Viewed 525 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 525 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);
User avatar
Development@SIB
 
Posts: 311
Joined: Mon Sep 28, 2009 1:54 pm

Return to Documentation