Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2014-01-09 14:42:10 -0500
committerTom Schindl2014-01-09 14:42:10 -0500
commitf9cb92c907ca1c2f87202d1816bcd1febe2bb03a (patch)
treec3bf55b8e11b90227e70b8594d6c9f0b3624cc6c
parent06b9a66fa9c19f0fd79c274842a5315672d9a9ca (diff)
downloadorg.eclipse.efxclipse-f9cb92c907ca1c2f87202d1816bcd1febe2bb03a.tar.gz
org.eclipse.efxclipse-f9cb92c907ca1c2f87202d1816bcd1febe2bb03a.tar.xz
org.eclipse.efxclipse-f9cb92c907ca1c2f87202d1816bcd1febe2bb03a.zip
Bug 425221 - Initial size not used by dialogs
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.dialogs/src/org/eclipse/fx/ui/dialogs/Dialog.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/bundles/runtime/org.eclipse.fx.ui.dialogs/src/org/eclipse/fx/ui/dialogs/Dialog.java b/bundles/runtime/org.eclipse.fx.ui.dialogs/src/org/eclipse/fx/ui/dialogs/Dialog.java
index d22456beb..323b8a49a 100755
--- a/bundles/runtime/org.eclipse.fx.ui.dialogs/src/org/eclipse/fx/ui/dialogs/Dialog.java
+++ b/bundles/runtime/org.eclipse.fx.ui.dialogs/src/org/eclipse/fx/ui/dialogs/Dialog.java
@@ -148,17 +148,18 @@ public abstract class Dialog {
protected Stage create() {
Stage stage = new Stage();
stage.setTitle(title);
-// Causes problems when embedded in SWT
stage.initOwner(parent);
Parent content = createContents();
- Scene s = new Scene(content);
+ Point2D size = getInitialSize(content);
+ Scene s = new Scene(content,size.getX(),size.getY());
s.getStylesheets().addAll(getStylesheets());
stage.setScene(s);
return stage;
}
- protected Point2D getInitialSize() {
- return new Point2D(stage.getScene().getRoot().prefWidth(-1), stage.getScene().getRoot().prefHeight(-1));
+ protected Point2D getInitialSize(Parent rootContainer) {
+ stage.getScene().getRoot().impl_reapplyCSS();
+ return new Point2D(rootContainer.prefWidth(-1), rootContainer.prefHeight(-1));
}
void layout() {

Back to the top