Thursday, April 17, 2014

Re: DockLayoutPanel as root with fixed width

Hi,

I noticed that there are no scrollbars when the browser width gets resized below the fixed width of the DockLayoutPanel.

Consider this minimal example:

 public void onModuleLoad()
 {
  DockLayoutPanel p = new DockLayoutPanel (Unit.PX);
  Style s = p.getElement ().getStyle ();
  
  s.setBorderStyle (BorderStyle.SOLID);
  s.setBorderWidth (1,Unit.PX);
  s.setBorderColor ("#FF0000");
  s.setBackgroundColor ("#ABCDEF");
  
  s.setProperty ("width","1000px");
  s.setProperty ("marginLeft","auto");
  s.setProperty ("marginRight","auto");
  
  RootLayoutPanel.get().add(p);
 }

I also tried Window.enableScrolling (true);, but there is no scrollbar in Chrome.

Again, wouldn't it be better to use one Panel /e. g. ScrollPanel) to cover the whole viewport and add a centered DockLayoutPanel to it?

Magnus

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment