diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-04-16 12:12:20 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-04-16 12:12:20 +0300 |
commit | 00ef3eff62a9719ae83f802b17dc4b1e501440a8 (patch) | |
tree | 0174f477d579190f31e857a42452c0fa412571bb | |
parent | c212d06836d39da3db190468447057d411021885 (diff) | |
download | vaadin-framework-00ef3eff62a9719ae83f802b17dc4b1e501440a8.tar.gz vaadin-framework-00ef3eff62a9719ae83f802b17dc4b1e501440a8.zip |
Add overflow: hidden to v-label to prevent margins from escaping (#8671)
-rw-r--r-- | WebContent/VAADIN/themes/base/label/label.css | 3 | ||||
-rw-r--r-- | tests/testbench/com/vaadin/tests/components/gridlayout/MarginsInLabels.java | 50 |
2 files changed, 53 insertions, 0 deletions
diff --git a/WebContent/VAADIN/themes/base/label/label.css b/WebContent/VAADIN/themes/base/label/label.css new file mode 100644 index 0000000000..366dbdf26f --- /dev/null +++ b/WebContent/VAADIN/themes/base/label/label.css @@ -0,0 +1,3 @@ +.v-label { + overflow: hidden; +}
\ No newline at end of file diff --git a/tests/testbench/com/vaadin/tests/components/gridlayout/MarginsInLabels.java b/tests/testbench/com/vaadin/tests/components/gridlayout/MarginsInLabels.java new file mode 100644 index 0000000000..1cbed2a17d --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/gridlayout/MarginsInLabels.java @@ -0,0 +1,50 @@ +package com.vaadin.tests.components.gridlayout; + +import com.vaadin.terminal.WrappedRequest; +import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.ui.AbstractLayout; +import com.vaadin.ui.Accordion; +import com.vaadin.ui.GridLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.Label.ContentMode; +import com.vaadin.ui.TabSheet; +import com.vaadin.ui.VerticalLayout; + +public class MarginsInLabels extends AbstractTestRoot { + + @Override + protected void setup(WrappedRequest request) { + AbstractLayout layout = new VerticalLayout(); + layout.addComponent(new Label("<h1>Vertical layout</h1>", + ContentMode.XHTML)); + layout.addComponent(new Label("Next row")); + addComponent(layout); + + layout = new GridLayout(1, 2); + layout.setWidth("100%"); + layout.addComponent(new Label("<h1>Grid layout</h1>", ContentMode.XHTML)); + layout.addComponent(new Label("Next row")); + addComponent(layout); + + TabSheet tabSheet = new TabSheet(); + tabSheet.addTab(new Label("<h1>Tabsheet</h1>", ContentMode.XHTML), + "Label"); + addComponent(tabSheet); + + Accordion accordion = new Accordion(); + accordion.addTab(new Label("<h1>Accordion</h1>", ContentMode.XHTML), + "Label"); + addComponent(accordion); + } + + @Override + protected String getTestDescription() { + return "Margins inside labels should not be allowed to collapse out of the label as it causes problems with layotus measuring the label."; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(8671); + } + +} |