From 95cb03bd2c79197f2bd333b6881101128313cd39 Mon Sep 17 00:00:00 2001 From: mbaudier Date: Tue, 3 Jul 2018 12:29:12 +0200 Subject: [PATCH] Start single sourcing lightweight dialog --- .../org/argeo/eclipse/ui/dialogs/LightweightDialog.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; -- 2.30.2