When clicking on the "Widgets" and "Lists" tabs, the content jumps from the left edge of the page to the center of the page. This is because we are showing the content, and then centering it. To get around this, the visibility of the content is set to hidden, the centering is done, and then the the visibility is set to visible. The same problem happens when you click on the "Show Dialog" button under the "Popups" section, and a similar fix is used to get around this problem.

Patch by: rdayal
Review by: me, jgw

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1181 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/KitchenSink.java b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/KitchenSink.java
index 0a08558..fc6916b 100644
--- a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/KitchenSink.java
+++ b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/KitchenSink.java
@@ -107,8 +107,10 @@
         info.getColor());
 
     // Display the new sink.
+    curSink.setVisible(false);
     panel.add(curSink);
     panel.setCellHorizontalAlignment(curSink, VerticalPanel.ALIGN_CENTER);
+    curSink.setVisible(true);
     curSink.onShow();
   }
 
diff --git a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Popups.java b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Popups.java
index 23b2687..070fa08 100644
--- a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Popups.java
+++ b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Popups.java
@@ -128,7 +128,9 @@
     } else if (sender == dialogButton) {
       DialogBox dlg = new MyDialog();
       dlg.show();
+      dlg.setVisible(false);
       dlg.center();
+      dlg.setVisible(true);
     }
   }