From: mbaudier Date: Tue, 3 Jul 2018 10:29:12 +0000 (+0200) Subject: Start single sourcing lightweight dialog X-Git-Tag: argeo-commons-2.1.74~8 X-Git-Url: https://git.argeo.org/?p=lgpl%2Fargeo-commons.git;a=commitdiff_plain;h=95cb03bd2c79197f2bd333b6881101128313cd39 Start single sourcing lightweight dialog --- diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/dialogs/LightweightDialog.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/dialogs/LightweightDialog.java index cc8a830bf..5649a1571 100644 --- a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/dialogs/LightweightDialog.java +++ b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/dialogs/LightweightDialog.java @@ -70,8 +70,11 @@ public class LightweightDialog { public int open() { if (foregoundShell != null) throw new EclipseUiException("There is already a shell"); - backgroundShell = new Shell(parentShell, SWT.DIALOG_TRIM | SWT.ON_TOP); + backgroundShell = new Shell(parentShell, SWT.ON_TOP); backgroundShell.setFullScreen(true); + // if (parentShell != null) { + // backgroundShell.setBounds(parentShell.getBounds()); + // } else // backgroundShell.setMaximized(true); backgroundShell.setAlpha(128); backgroundShell.setBackground(getDisplay().getSystemColor(SWT.COLOR_BLACK)); @@ -84,7 +87,7 @@ public class LightweightDialog { // shell.pack(); // shell.layout(); - Rectangle shellBounds = Display.getCurrent().getBounds();// RAP + Rectangle shellBounds = parentShell != null ? parentShell.getBounds() : Display.getCurrent().getBounds();// RAP Point dialogSize = foregoundShell.getSize(); int x = shellBounds.x + (shellBounds.width - dialogSize.x) / 2; int y = shellBounds.y + (shellBounds.height - dialogSize.y) / 2;