diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2008-12-12 06:00:13 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2008-12-12 06:00:13 +0000 |
commit | e47a291a690b7dad726e709742a3f0477a20fd80 (patch) | |
tree | d9cd36fb734805e7195d355140967821387f43e6 /src/com/itmill/toolkit/ui | |
parent | 132d29542195a6efffc9a0424bc486226550d4df (diff) | |
download | vaadin-framework-e47a291a690b7dad726e709742a3f0477a20fd80.tar.gz vaadin-framework-e47a291a690b7dad726e709742a3f0477a20fd80.zip |
OL -> VerticalLayout as default for panel
svn changeset:6183/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/ui')
-rw-r--r-- | src/com/itmill/toolkit/ui/Window.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/com/itmill/toolkit/ui/Window.java b/src/com/itmill/toolkit/ui/Window.java index 97867b8faf..aa8ccdb75c 100644 --- a/src/com/itmill/toolkit/ui/Window.java +++ b/src/com/itmill/toolkit/ui/Window.java @@ -114,6 +114,12 @@ public class Window extends Panel implements URIHandler, ParameterHandler { private Focusable pendingFocus; + /** + * Flag to trac if window has default layout and no defined size. This is + * invalid situations for sub windows. + */ + private boolean defaultLayout; + /* ********************************************************************* */ /** @@ -173,10 +179,17 @@ public class Window extends Panel implements URIHandler, ParameterHandler { */ public Window(String caption, Layout layout) { super(caption, layout); + defaultLayout = layout == null; setScrollable(true); setSizeUndefined(); } + @Override + public void setLayout(Layout newLayout) { + super.setLayout(newLayout); + defaultLayout = false; + } + /** * Gets the terminal type. * @@ -1039,9 +1052,7 @@ public class Window extends Panel implements URIHandler, ParameterHandler { "You can only add windows inside application-level windows"); } - if (window.getWidth() < 0 - && window.getLayout() instanceof VerticalLayout - && window.getLayout().getWidthUnits() == UNITS_PERCENTAGE) { + if (window.getWidth() < 0 && window.defaultLayout) { // set sane width for subwindow layout when window has undefined // width. This may though be odd for developer in some situations. // See #2321 |