diff options
author | Sauli Tähkäpää <sauli@vaadin.com> | 2015-02-06 23:59:35 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-02-27 16:23:00 +0000 |
commit | c9586c93b93987d9b5942c38ef0b536c091092a5 (patch) | |
tree | 9e41c15b5d2ba3967776440d71e9a356d59744e0 | |
parent | acb889336f80227d609b194e56ac6ae3ead0d338 (diff) | |
download | vaadin-framework-c9586c93b93987d9b5942c38ef0b536c091092a5.tar.gz vaadin-framework-c9586c93b93987d9b5942c38ef0b536c091092a5.zip |
Hide button caption overflow in reindeer and valo. (#11864)
Change-Id: Iaeb9cd571dd4b7a37cdc89f9d291365aef96c9e1
4 files changed, 56 insertions, 0 deletions
diff --git a/WebContent/VAADIN/themes/reindeer/button/button-standard.scss b/WebContent/VAADIN/themes/reindeer/button/button-standard.scss index 632340f228..4809611442 100644 --- a/WebContent/VAADIN/themes/reindeer/button/button-standard.scss +++ b/WebContent/VAADIN/themes/reindeer/button/button-standard.scss @@ -42,6 +42,8 @@ background-repeat: no-repeat; background-position: right top; background-image: url(img/right.png); /** sprite-ref: buttons; sprite-alignment: right */ + overflow: hidden; + text-overflow: ellipsis; } .#{$primaryStyleName}-caption { diff --git a/WebContent/VAADIN/themes/valo/components/_button.scss b/WebContent/VAADIN/themes/valo/components/_button.scss index 3a4bca615d..673a55a97a 100644 --- a/WebContent/VAADIN/themes/valo/components/_button.scss +++ b/WebContent/VAADIN/themes/valo/components/_button.scss @@ -119,6 +119,8 @@ text-align: center; white-space: nowrap; outline: none; + overflow: hidden; + text-overflow: ellipsis; @include valo-tappable; @if $vertical-centering { @include valo-button-vertical-centering; diff --git a/uitest/src/com/vaadin/tests/themes/ButtonTextOverflow.java b/uitest/src/com/vaadin/tests/themes/ButtonTextOverflow.java new file mode 100644 index 0000000000..6cf8b7958e --- /dev/null +++ b/uitest/src/com/vaadin/tests/themes/ButtonTextOverflow.java @@ -0,0 +1,27 @@ +package com.vaadin.tests.themes; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; + +public class ButtonTextOverflow extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + Button button = new Button("Button Button Button"); + + button.setWidth("100px"); + + addComponent(button); + } + + @Override + protected String getTestDescription() { + return "Overflowing button caption should be hidden with ellipsis."; + } + + @Override + protected Integer getTicketNumber() { + return 11864; + } +} diff --git a/uitest/src/com/vaadin/tests/themes/ButtonTextOverflowTest.java b/uitest/src/com/vaadin/tests/themes/ButtonTextOverflowTest.java new file mode 100644 index 0000000000..e31e98ac6e --- /dev/null +++ b/uitest/src/com/vaadin/tests/themes/ButtonTextOverflowTest.java @@ -0,0 +1,25 @@ +package com.vaadin.tests.themes; + +import java.io.IOException; + +import org.junit.Test; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ButtonTextOverflowTest extends MultiBrowserTest { + + @Test + public void captionOverflowIsHiddenInReindeer() throws IOException { + openTestURL("theme=reindeer"); + + compareScreen("reindeer"); + } + + @Test + public void captionOverflowIsHiddenInValo() throws IOException { + openTestURL("theme=valo"); + + compareScreen("valo"); + } + +}
\ No newline at end of file |