summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSauli Tähkäpää <sauli@vaadin.com>2015-08-26 23:33:49 +0300
committerTeemu Suo-Anttila <teemusa@vaadin.com>2015-10-19 11:51:48 +0300
commit20b0930f893d79653920f655c12f489eb78d6a79 (patch)
treeb7100b3171d59e5d4dfc90161f2cb32902952e12
parent76b42e680f0f409f253a3aa8499a18fd09329957 (diff)
downloadvaadin-framework-20b0930f893d79653920f655c12f489eb78d6a79.tar.gz
vaadin-framework-20b0930f893d79653920f655c12f489eb78d6a79.zip
Set opacity for disabled Grid in Valo. (#18661)
Change-Id: Ic1e1cecf01aab54d00d1215591514bd07b941754
-rw-r--r--WebContent/VAADIN/themes/valo/components/_grid.scss4
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/GridDisabled.java29
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/GridDisabledTest.java29
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 dffd5fbb65..a911007fa7 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