.#{$primaryStyleName} span.#{$primaryStyleName}-menuitem-disabled:hover,
.#{$primaryStyleName} span.#{$primaryStyleName}-menuitem-disabled:focus,
.#{$primaryStyleName} span.#{$primaryStyleName}-menuitem-disabled:active {
- color: #999;
+ opacity: .5;
+ filter: alpha(opacity=50);
}
.#{$primaryStyleName}-more-menuitem {
/* Arial has the most coverage for geometric entity characters */
--- /dev/null
+package com.vaadin.tests.themes.base;
+
+import com.vaadin.server.ThemeResource;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.MenuBar;
+
+public class DisabledMenuBarItem extends AbstractTestUI {
+ @Override
+ protected void setup(VaadinRequest request) {
+ MenuBar menubar = new MenuBar();
+
+ MenuBar.MenuItem item = menubar.addItem("Item", null);
+ item.setEnabled(false);
+ item.setIcon(new ThemeResource("just_a_placeholder.png"));
+
+ addComponent(menubar);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Image icon should be greyed out.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 15381;
+ }
+}
--- /dev/null
+package com.vaadin.tests.themes.base;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Test;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.By;
+import com.vaadin.testbench.parallel.Browser;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class DisabledMenuBarItemTest extends MultiBrowserTest {
+
+ @Test
+ public void disabledMenuItemShouldHaveOpacity() {
+ openTestURL();
+
+ WebElement element = driver.findElement(By
+ .className("v-menubar-menuitem-disabled"));
+
+ assertThat(element.getCssValue("opacity"), is("0.5"));
+
+ if (browserIsIE8or9()) {
+ assertThat(element.getCssValue("filter"), is("alpha(opacity=50)"));
+
+ }
+ }
+
+ private boolean browserIsIE8or9() {
+ return Browser.IE8.getDesiredCapabilities().equals(
+ getDesiredCapabilities())
+ || Browser.IE9.getDesiredCapabilities().equals(
+ getDesiredCapabilities());
+ }
+}
\ No newline at end of file