From 45fb2934f2104f97575fade34b96a56b5823e457 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sauli=20T=C3=A4hk=C3=A4p=C3=A4=C3=A4?= Date: Mon, 27 Apr 2015 22:05:35 +0300 Subject: [PATCH] Fix readonly checkbox opacity in Valo. (#17548) Change-Id: I633e0deeca6c1268937d8c9b918ea414355c85f3 --- .../themes/valo/components/_checkbox.scss | 20 +++++++++++++++++++ .../vaadin/tests/themes/valo/CheckBoxes.java | 5 +++++ .../tests/themes/valo/ValoThemeUITest.java | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) 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 -- 2.39.5