From 8638a0786cd3968076ba6aa9b53311c28678f7e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sauli=20T=C3=A4hk=C3=A4p=C3=A4=C3=A4?= Date: Wed, 26 Aug 2015 23:33:49 +0300 Subject: [PATCH] Set opacity for disabled Grid in Valo. (#18661) Change-Id: I6fe834c6a7ce7695f065d7385f3b6dc1940864a1 --- .../VAADIN/themes/valo/components/_grid.scss | 4 +++ .../tests/themes/valo/GridDisabled.java | 29 +++++++++++++++++++ .../tests/themes/valo/GridDisabledTest.java | 29 +++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 uitest/src/com/vaadin/tests/themes/valo/GridDisabled.java create mode 100644 uitest/src/com/vaadin/tests/themes/valo/GridDisabledTest.java 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 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 -- 2.39.5