Modal always center

Hi,

Are there CUBA’s options to keep screen opened by dialogMode always on center ?
In fact in my project, height increase depends option we have selected.

In waiting, i will used javascript.

ScreenDependencyUtils.addScreenDependency(frameOwner, “webjar://jquery/3.3.1/jquery.min.js”, Dependency.Type.JAVASCRIPT);
JavaScript js = Page.getCurrent().getJavaScript();
js.execute("…");

image

No options works, javascript is not pretty.
the possibility to put stylename at c-app-dialog-window will be nice too to apply custom modal view

image

best regards,

Gabriel

Hi,

There is no way to make dialog window always center automatically, but you can center it programmatically using the following code:

if (getWindow() instanceof DialogWindow) {
    ((DialogWindow) getWindow()).center();
}

In order to add styles to window itself, you need to obtain Vaadin window:

com.vaadin.ui.Window dialogWindow = getWindow().unwrapComposition(com.vaadin.ui.Window.class);
dialogWindow.addStyleName("custom-style");

Regards,
Gleb