Browse Source

Hide button caption overflow in reindeer and valo. (#11864)

Change-Id: Iaeb9cd571dd4b7a37cdc89f9d291365aef96c9e1
tags/7.5.0.alpha1
Sauli Tähkäpää 9 years ago
parent
commit
c9586c93b9

+ 2
- 0
WebContent/VAADIN/themes/reindeer/button/button-standard.scss View File

@@ -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 {

+ 2
- 0
WebContent/VAADIN/themes/valo/components/_button.scss View File

@@ -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;

+ 27
- 0
uitest/src/com/vaadin/tests/themes/ButtonTextOverflow.java View File

@@ -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;
}
}

+ 25
- 0
uitest/src/com/vaadin/tests/themes/ButtonTextOverflowTest.java View File

@@ -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");
}

}

Loading…
Cancel
Save