From: Sauli Tähkäpää Date: Mon, 27 Apr 2015 19:05:35 +0000 (+0300) Subject: Fix readonly checkbox opacity in Valo. (#17548) X-Git-Tag: 7.5.0.rc1~9 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=45fb2934f2104f97575fade34b96a56b5823e457;p=vaadin-framework.git Fix readonly checkbox opacity in Valo. (#17548) Change-Id: I633e0deeca6c1268937d8c9b918ea414355c85f3 --- diff --git a/WebContent/VAADIN/themes/valo/components/_checkbox.scss b/WebContent/VAADIN/themes/valo/components/_checkbox.scss index 7283c4cbbf..1be12d3533 100644 --- a/WebContent/VAADIN/themes/valo/components/_checkbox.scss +++ b/WebContent/VAADIN/themes/valo/components/_checkbox.scss @@ -144,4 +144,24 @@ } } + &.v-readonly { + > label, + > .v-icon { + cursor: default; + } + + > label > .v-icon { + cursor: default; + } + + :root & > input:active ~ label:after { + background: transparent; + } + + :root & > input ~ label:after { + @include opacity($v-disabled-opacity); + } + } + + } diff --git a/uitest/src/com/vaadin/tests/themes/valo/CheckBoxes.java b/uitest/src/com/vaadin/tests/themes/valo/CheckBoxes.java index c79447bd86..9a889b3bda 100644 --- a/uitest/src/com/vaadin/tests/themes/valo/CheckBoxes.java +++ b/uitest/src/com/vaadin/tests/themes/valo/CheckBoxes.java @@ -84,6 +84,11 @@ public class CheckBoxes extends VerticalLayout implements View { check.setIcon(testIcon.get()); row.addComponent(check); + check = new CheckBox("Readonly", true); + check.setReadOnly(true); + check.setIcon(testIcon.get()); + row.addComponent(check); + h1 = new Label("Option Groups"); h1.addStyleName("h1"); addComponent(h1); diff --git a/uitest/src/com/vaadin/tests/themes/valo/ValoThemeUITest.java b/uitest/src/com/vaadin/tests/themes/valo/ValoThemeUITest.java index 3ab224f105..4ed7e33e13 100644 --- a/uitest/src/com/vaadin/tests/themes/valo/ValoThemeUITest.java +++ b/uitest/src/com/vaadin/tests/themes/valo/ValoThemeUITest.java @@ -86,7 +86,7 @@ public class ValoThemeUITest extends MultiBrowserTest { public void checkboxes() throws Exception { openTestURL("test"); open("Check Boxes & Option Groups", "Check Boxes"); - compareScreen("checkboxes_with_disabled"); + compareScreen("checkboxes_with_readonly"); } @Test