javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Shell.java
changeset 26 dc7c549001d5
parent 21 2a9601315dfc
child 35 85266cc22c7f
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Shell.java	Fri May 14 15:47:24 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Shell.java	Thu May 27 12:49:31 2010 +0300
@@ -132,6 +132,8 @@
 
 Rectangle defBounds;
 
+Point oldSize;
+
 /**
  * The WindowSurface wrapper for top level shells. Window surface
  * provides access for Qt created draw surface.
@@ -830,6 +832,20 @@
 int setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
     // On Symbian platform top-level Shells are forced to maximized
     if(OS.windowServer == OS.WS_SYMBIAN_S60 && parent == null) {
+    	//for updating the layout when shell.pack is called after shell open.
+    	// or aligning with other platform which has resizable top shell
+    	if(resize) {
+    		Point newSize = new Point(width, height);
+    		if(oldSize == null || !oldSize.equals(newSize)) {
+    			sendEvent(SWT.Resize);
+    			// Activate layout
+    			if (layout != null) {
+    				markLayout (false, false);
+    				updateLayout (false);
+    			}
+    			oldSize = newSize; 
+    		}
+    	}    
         return 0;
     }