diff options
author | Sauli Tähkäpää <sauli@vaadin.com> | 2015-08-26 23:33:49 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-09-29 12:06:19 +0000 |
commit | 8638a0786cd3968076ba6aa9b53311c28678f7e8 (patch) | |
tree | 34e9dc5774692330456dcbfdfe05daf9afb5a5e6 | |
parent | ca38846dff92c8c8e4cd971106b2c65dae0463c1 (diff) | |
download | vaadin-framework-8638a0786cd3968076ba6aa9b53311c28678f7e8.tar.gz vaadin-framework-8638a0786cd3968076ba6aa9b53311c28678f7e8.zip |
Set opacity for disabled Grid in Valo. (#18661)
Change-Id: I6fe834c6a7ce7695f065d7385f3b6dc1940864a1
3 files changed, 62 insertions, 0 deletions
diff --git a/WebContent/VAADIN/themes/valo/components/_grid.scss b/WebContent/VAADIN/themes/valo/components/_grid.scss index e9b4d249c7..dd2f0f0761 100644 --- a/WebContent/VAADIN/themes/valo/components/_grid.scss +++ b/WebContent/VAADIN/themes/valo/components/_grid.scss @@ -45,6 +45,10 @@ $v-grid-details-border-bottom-stripe: $v-grid-cell-horizontal-border !default; .#{$primary-stylename} { @include user-select(text); background-color: $v-background-color; + + &.v-disabled { + @include opacity($v-disabled-opacity); + } } .#{$primary-stylename}-header .#{$primary-stylename}-cell { diff --git a/uitest/src/com/vaadin/tests/themes/valo/GridDisabled.java b/uitest/src/com/vaadin/tests/themes/valo/GridDisabled.java new file mode 100644 index 0000000000..9bb0c0c0e3 --- /dev/null +++ b/uitest/src/com/vaadin/tests/themes/valo/GridDisabled.java @@ -0,0 +1,29 @@ +package com.vaadin.tests.themes.valo; + +import com.vaadin.annotations.Theme; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Grid; + +@Theme("valo") +public class GridDisabled extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + final Grid grid = new Grid(); + + grid.addColumn("foo", String.class); + grid.addRow("Foo"); + grid.select(grid.addRow("Bar")); + + addComponent(grid); + + addButton("Disable", new Button.ClickListener() { + @Override + public void buttonClick(Button.ClickEvent event) { + grid.setEnabled(!grid.isEnabled()); + } + }); + } +} diff --git a/uitest/src/com/vaadin/tests/themes/valo/GridDisabledTest.java b/uitest/src/com/vaadin/tests/themes/valo/GridDisabledTest.java new file mode 100644 index 0000000000..27c3bfa91d --- /dev/null +++ b/uitest/src/com/vaadin/tests/themes/valo/GridDisabledTest.java @@ -0,0 +1,29 @@ +package com.vaadin.tests.themes.valo; + +import java.io.IOException; +import java.util.List; + +import org.junit.Test; +import org.openqa.selenium.remote.DesiredCapabilities; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class GridDisabledTest extends MultiBrowserTest { + + @Override + public List<DesiredCapabilities> getBrowsersToTest() { + // Grids current DOM/CSS structure doesn't allow + // opacity to work properly in IE8. + return getBrowsersExcludingIE8(); + } + + @Test + public void disabledGrid() throws IOException { + openTestURL(); + + $(ButtonElement.class).caption("Disable").first().click(); + + compareScreen("disabled"); + } +}
\ No newline at end of file |