]> source.dussan.org Git - vaadin-framework.git/commitdiff
Add overflow: hidden to v-label to prevent margins from escaping (#8671)
authorLeif Åstrand <leif@vaadin.com>
Mon, 16 Apr 2012 09:12:20 +0000 (12:12 +0300)
committerLeif Åstrand <leif@vaadin.com>
Mon, 16 Apr 2012 09:12:20 +0000 (12:12 +0300)
WebContent/VAADIN/themes/base/label/label.css [new file with mode: 0644]
tests/testbench/com/vaadin/tests/components/gridlayout/MarginsInLabels.java [new file with mode: 0644]

diff --git a/WebContent/VAADIN/themes/base/label/label.css b/WebContent/VAADIN/themes/base/label/label.css
new file mode 100644 (file)
index 0000000..366dbdf
--- /dev/null
@@ -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 (file)
index 0000000..1cbed2a
--- /dev/null
@@ -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);
+    }
+
+}