Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2014-01-09 14:58:42 -0500
committerTom Schindl2014-01-09 14:58:42 -0500
commita018edc9472a5947b3ae310308af6cfc3d0eec06 (patch)
tree19f765fb37a6590410c8c6dc43fb87ee25474bbb
parentf9cb92c907ca1c2f87202d1816bcd1febe2bb03a (diff)
downloadorg.eclipse.efxclipse-a018edc9472a5947b3ae310308af6cfc3d0eec06.tar.gz
org.eclipse.efxclipse-a018edc9472a5947b3ae310308af6cfc3d0eec06.tar.xz
org.eclipse.efxclipse-a018edc9472a5947b3ae310308af6cfc3d0eec06.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.java20
1 files changed, 16 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 323b8a49a..8844557d3 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
@@ -150,16 +150,28 @@ public abstract class Dialog {
stage.setTitle(title);
stage.initOwner(parent);
Parent content = createContents();
- Point2D size = getInitialSize(content);
- Scene s = new Scene(content,size.getX(),size.getY());
+ Scene s = new Scene(content);
s.getStylesheets().addAll(getStylesheets());
stage.setScene(s);
+ Point2D size = getInitialSize(content);
+ if( size != null ) {
+ stage.setWidth(size.getX());
+ stage.setHeight(size.getY());
+ }
+ Point2D location = getInitialLocation(content);
+ if( location != null ) {
+ stage.setX(location.getX());
+ stage.setY(location.getY());
+ }
return stage;
}
protected Point2D getInitialSize(Parent rootContainer) {
- stage.getScene().getRoot().impl_reapplyCSS();
- return new Point2D(rootContainer.prefWidth(-1), rootContainer.prefHeight(-1));
+ return null;
+ }
+
+ protected Point2D getInitialLocation(Parent rootContainer) {
+ return null;
}
void layout() {

Back to the top