From b9c0971afe9596329bd1a7e12f2cca1e647a80d4 Mon Sep 17 00:00:00 2001 From: Teppo Kurki Date: Mon, 6 Jul 2015 11:59:00 +0300 Subject: Fixes scrollToLine while resizing Grid via split position (#18424) Change-Id: I5ecd8a91bd1ebea809d04a54307fcd752fbe3f39 --- .../grid/GridScrollToLineWhileResizing.java | 73 ++++++++++++++++++++++ .../grid/GridScrollToLineWhileResizingTest.java | 49 +++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 uitest/src/com/vaadin/tests/components/grid/GridScrollToLineWhileResizing.java create mode 100644 uitest/src/com/vaadin/tests/components/grid/GridScrollToLineWhileResizingTest.java (limited to 'uitest/src/com/vaadin/tests/components/grid') diff --git a/uitest/src/com/vaadin/tests/components/grid/GridScrollToLineWhileResizing.java b/uitest/src/com/vaadin/tests/components/grid/GridScrollToLineWhileResizing.java new file mode 100644 index 0000000000..194a9a3acc --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/grid/GridScrollToLineWhileResizing.java @@ -0,0 +1,73 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.grid; + +import com.vaadin.data.Item; +import com.vaadin.data.util.IndexedContainer; +import com.vaadin.event.SelectionEvent; +import com.vaadin.event.SelectionEvent.SelectionListener; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Grid; +import com.vaadin.ui.Grid.SelectionMode; +import com.vaadin.ui.VerticalSplitPanel; + +public class GridScrollToLineWhileResizing extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + + final VerticalSplitPanel vsp = new VerticalSplitPanel(); + vsp.setWidth(500, Unit.PIXELS); + vsp.setHeight(500, Unit.PIXELS); + vsp.setSplitPosition(100, Unit.PERCENTAGE); + addComponent(vsp); + + IndexedContainer indexedContainer = new IndexedContainer(); + indexedContainer.addContainerProperty("column1", String.class, ""); + + for (int i = 0; i < 100; i++) { + Item addItem = indexedContainer.addItem(i); + addItem.getItemProperty("column1").setValue("cell" + i); + } + + final Grid grid = new Grid(indexedContainer); + grid.setSizeFull(); + + grid.setSelectionMode(SelectionMode.SINGLE); + grid.addSelectionListener(new SelectionListener() { + + @Override + public void select(SelectionEvent event) { + vsp.setSplitPosition(50, Unit.PERCENTAGE); + grid.scrollTo(event.getSelected().iterator().next()); + } + }); + + vsp.setFirstComponent(grid); + } + + @Override + protected String getTestDescription() { + return "Tests scrollToLine while moving SplitPanel split position to resize the Grid on the same round-trip."; + } + + @Override + protected Integer getTicketNumber() { + return null; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/grid/GridScrollToLineWhileResizingTest.java b/uitest/src/com/vaadin/tests/components/grid/GridScrollToLineWhileResizingTest.java new file mode 100644 index 0000000000..aee1db7a85 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/grid/GridScrollToLineWhileResizingTest.java @@ -0,0 +1,49 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.grid; + +import static org.junit.Assert.assertTrue; + +import java.util.List; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.elements.GridElement; +import com.vaadin.testbench.parallel.TestCategory; +import com.vaadin.tests.tb3.MultiBrowserTest; + +@TestCategory("grid") +public class GridScrollToLineWhileResizingTest extends MultiBrowserTest { + + @Test + public void testScrollToLineWorksWhileMovingSplitProgrammatically() { + openTestURL(); + + $(GridElement.class).first().getCell(21, 0).click(); + + List cells = findElements(By.className("v-grid-cell")); + boolean foundCell21 = false; + for (WebElement cell : cells) { + if ("cell21".equals(cell.getText())) { + foundCell21 = true; + } + } + + assertTrue(foundCell21); + } +} \ No newline at end of file -- cgit v1.2.3 From 0f9d0b0bf1cd5fb58f47f22bd6d52a9fac31c530 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Thu, 9 Jul 2015 14:51:30 +0300 Subject: Support frozen columns in Grid editor (#16727) Change-Id: Iff797c3bf90a6021099a3ed4082cfca3a6fb3540 --- WebContent/VAADIN/themes/base/grid/grid.scss | 10 +++ client/src/com/vaadin/client/widgets/Grid.java | 43 ++++++++++-- .../components/grid/GridEditorFrozenColumnsUI.java | 43 ++++++++++++ .../grid/GridEditorFrozenColumnsUITest.java | 78 ++++++++++++++++++++++ .../vaadin/tests/components/grid/GridEditorUI.java | 6 +- .../tests/components/grid/GridEditorUITest.java | 2 +- .../basicfeatures/client/GridEditorClientTest.java | 6 +- .../grid/basicfeatures/server/GridEditorTest.java | 2 +- 8 files changed, 178 insertions(+), 12 deletions(-) create mode 100644 uitest/src/com/vaadin/tests/components/grid/GridEditorFrozenColumnsUI.java create mode 100644 uitest/src/com/vaadin/tests/components/grid/GridEditorFrozenColumnsUITest.java (limited to 'uitest/src/com/vaadin/tests/components/grid') diff --git a/WebContent/VAADIN/themes/base/grid/grid.scss b/WebContent/VAADIN/themes/base/grid/grid.scss index 1653032703..31403428cd 100644 --- a/WebContent/VAADIN/themes/base/grid/grid.scss +++ b/WebContent/VAADIN/themes/base/grid/grid.scss @@ -199,6 +199,12 @@ $v-grid-details-border-bottom-stripe: 1px solid darken($v-grid-row-background-co border-left: none; } } + + .#{$primaryStyleName}-editor-cells.frozen > div { + @include box-shadow(1px 0 2px rgba(0,0,0,.1)); + border-right: $v-grid-cell-vertical-border; + border-left: none; + } .#{$primaryStyleName}-row-stripe > td { background-color: $v-grid-row-stripe-background-color; @@ -342,6 +348,10 @@ $v-grid-details-border-bottom-stripe: 1px solid darken($v-grid-row-background-co .#{$primaryStyleName}-editor-cells { position: relative; white-space: nowrap; + + &.frozen { + z-index: 2; + } > div { display: inline-block; diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java index 58fc532a77..232d67c1d4 100644 --- a/client/src/com/vaadin/client/widgets/Grid.java +++ b/client/src/com/vaadin/client/widgets/Grid.java @@ -1135,6 +1135,8 @@ public class Grid extends ResizeComposite implements private DivElement editorOverlay = DivElement.as(DOM.createDiv()); private DivElement cellWrapper = DivElement.as(DOM.createDiv()); + private DivElement frozenCellWrapper = DivElement.as(DOM.createDiv()); + private DivElement messageAndButtonsWrapper = DivElement.as(DOM .createDiv()); @@ -1530,15 +1532,31 @@ public class Grid extends ResizeComposite implements }); gridElement.appendChild(editorOverlay); + editorOverlay.appendChild(frozenCellWrapper); editorOverlay.appendChild(cellWrapper); editorOverlay.appendChild(messageAndButtonsWrapper); + int frozenColumns = grid.getVisibleFrozenColumnCount(); + double frozenColumnsWidth = 0; + double cellHeight = 0; + for (int i = 0; i < tr.getCells().getLength(); i++) { Element cell = createCell(tr.getCells().getItem(i)); - - cellWrapper.appendChild(cell); + cellHeight = Math.max(cellHeight, WidgetUtil + .getRequiredHeightBoundingClientRectDouble(tr + .getCells().getItem(i))); Column column = grid.getVisibleColumn(i); + + if (i < frozenColumns) { + frozenCellWrapper.appendChild(cell); + frozenColumnsWidth += WidgetUtil + .getRequiredWidthBoundingClientRectDouble(tr + .getCells().getItem(i)); + } else { + cellWrapper.appendChild(cell); + } + if (column.isEditable()) { Widget editor = getHandler().getWidget(column); @@ -1560,6 +1578,10 @@ public class Grid extends ResizeComposite implements } } + setBounds(frozenCellWrapper, 0, 0, frozenColumnsWidth, 0); + setBounds(cellWrapper, frozenColumnsWidth, 0, tr.getOffsetWidth() + - frozenColumnsWidth, cellHeight); + // Only add these elements once if (!messageAndButtonsWrapper.isOrHasChild(messageWrapper)) { messageAndButtonsWrapper.appendChild(messageWrapper); @@ -1624,6 +1646,7 @@ public class Grid extends ResizeComposite implements editorOverlay.removeAllChildren(); cellWrapper.removeAllChildren(); + frozenCellWrapper.removeAllChildren(); editorOverlay.removeFromParent(); scrollHandler.removeHandler(); @@ -1636,6 +1659,7 @@ public class Grid extends ResizeComposite implements editorOverlay.removeClassName(styleName); cellWrapper.removeClassName(styleName + "-cells"); + frozenCellWrapper.removeClassName(styleName + "-cells"); messageAndButtonsWrapper.removeClassName(styleName + "-footer"); messageWrapper.removeClassName(styleName + "-message"); @@ -1648,6 +1672,7 @@ public class Grid extends ResizeComposite implements editorOverlay.setClassName(styleName); cellWrapper.setClassName(styleName + "-cells"); + frozenCellWrapper.setClassName(styleName + "-cells frozen"); messageAndButtonsWrapper.setClassName(styleName + "-footer"); messageWrapper.setClassName(styleName + "-message"); @@ -1698,7 +1723,8 @@ public class Grid extends ResizeComposite implements private void updateHorizontalScrollPosition() { double scrollLeft = grid.getScrollLeft(); - cellWrapper.getStyle().setLeft(-scrollLeft, Unit.PX); + cellWrapper.getStyle().setLeft( + frozenCellWrapper.getOffsetWidth() - scrollLeft, Unit.PX); } protected void setGridEnabled(boolean enabled) { @@ -6051,7 +6077,12 @@ public class Grid extends ResizeComposite implements } private void updateFrozenColumns() { - int numberOfColumns = frozenColumnCount; + escalator.getColumnConfiguration().setFrozenColumnCount( + getVisibleFrozenColumnCount()); + } + + private int getVisibleFrozenColumnCount() { + int numberOfColumns = getFrozenColumnCount(); // for the escalator the hidden columns are not in the frozen column // count, but for grid they are. thus need to convert the index @@ -6066,9 +6097,7 @@ public class Grid extends ResizeComposite implements } else if (selectionColumn != null) { numberOfColumns++; } - - escalator.getColumnConfiguration() - .setFrozenColumnCount(numberOfColumns); + return numberOfColumns; } /** diff --git a/uitest/src/com/vaadin/tests/components/grid/GridEditorFrozenColumnsUI.java b/uitest/src/com/vaadin/tests/components/grid/GridEditorFrozenColumnsUI.java new file mode 100644 index 0000000000..d2414a8c40 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/grid/GridEditorFrozenColumnsUI.java @@ -0,0 +1,43 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.grid; + +import com.vaadin.tests.util.PersonContainer; +import com.vaadin.ui.Grid; + +public class GridEditorFrozenColumnsUI extends GridEditorUI { + + @Override + protected Grid createGrid(PersonContainer container) { + Grid grid = super.createGrid(container); + + grid.setFrozenColumnCount(2); + + grid.setWidth("600px"); + + return grid; + } + + @Override + protected Integer getTicketNumber() { + return 16727; + } + + @Override + protected String getTestDescription() { + return "Frozen columns should also freeze cells in editor."; + } +} diff --git a/uitest/src/com/vaadin/tests/components/grid/GridEditorFrozenColumnsUITest.java b/uitest/src/com/vaadin/tests/components/grid/GridEditorFrozenColumnsUITest.java new file mode 100644 index 0000000000..75d71a3c40 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/grid/GridEditorFrozenColumnsUITest.java @@ -0,0 +1,78 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.grid; + +import java.io.IOException; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.JavascriptExecutor; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.elements.GridElement; +import com.vaadin.testbench.elements.GridElement.GridCellElement; +import com.vaadin.testbench.parallel.TestCategory; +import com.vaadin.tests.tb3.MultiBrowserTest; + +@TestCategory("grid") +public class GridEditorFrozenColumnsUITest extends MultiBrowserTest { + + @Test + public void testEditorWithFrozenColumns() throws IOException { + openTestURL(); + + openEditor(10); + + compareScreen("noscroll"); + + scrollGridHorizontallyTo(100); + + compareScreen("scrolled"); + } + + private void openEditor(int rowIndex) { + GridElement grid = $(GridElement.class).first(); + + GridCellElement cell = grid.getCell(rowIndex, 1); + + new Actions(driver).moveToElement(cell).doubleClick().build().perform(); + } + + private void scrollGridHorizontallyTo(double px) { + executeScript("arguments[0].scrollLeft = " + px, + getGridHorizontalScrollbar()); + } + + private Object executeScript(String script, WebElement element) { + final WebDriver driver = getDriver(); + if (driver instanceof JavascriptExecutor) { + final JavascriptExecutor je = (JavascriptExecutor) driver; + return je.executeScript(script, element); + } else { + throw new IllegalStateException("current driver " + + getDriver().getClass().getName() + " is not a " + + JavascriptExecutor.class.getSimpleName()); + } + } + + private WebElement getGridHorizontalScrollbar() { + return getDriver() + .findElement( + By.xpath("//div[contains(@class, \"v-grid-scroller-horizontal\")]")); + } +} diff --git a/uitest/src/com/vaadin/tests/components/grid/GridEditorUI.java b/uitest/src/com/vaadin/tests/components/grid/GridEditorUI.java index 60e241bae3..0a302967e8 100644 --- a/uitest/src/com/vaadin/tests/components/grid/GridEditorUI.java +++ b/uitest/src/com/vaadin/tests/components/grid/GridEditorUI.java @@ -28,6 +28,10 @@ public class GridEditorUI extends AbstractTestUI { protected void setup(VaadinRequest request) { PersonContainer container = PersonContainer.createWithTestData(); + addComponent(createGrid(container)); + } + + protected Grid createGrid(PersonContainer container) { Grid grid = new Grid(container); // Don't use address since there's no converter @@ -43,7 +47,7 @@ public class GridEditorUI extends AbstractTestUI { grid.getColumn("phoneNumber").getEditorField().setReadOnly(true); - addComponent(grid); + return grid; } } diff --git a/uitest/src/com/vaadin/tests/components/grid/GridEditorUITest.java b/uitest/src/com/vaadin/tests/components/grid/GridEditorUITest.java index 47dc90e33a..3d0b3bb071 100644 --- a/uitest/src/com/vaadin/tests/components/grid/GridEditorUITest.java +++ b/uitest/src/com/vaadin/tests/components/grid/GridEditorUITest.java @@ -45,7 +45,7 @@ public class GridEditorUITest extends MultiBrowserTest { openEditor(10); - assertTrue("Edtor should be opened with a password field", + assertTrue("Editor should be opened with a password field", isElementPresent(PasswordFieldElement.class)); assertFalse("Notification was present", diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridEditorClientTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridEditorClientTest.java index f437589a39..43fe29bc02 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridEditorClientTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridEditorClientTest.java @@ -134,10 +134,12 @@ public class GridEditorClientTest extends GridBasicClientFeaturesTest { @Test public void testWithSelectionColumn() throws Exception { selectMenuPath("Component", "State", "Selection mode", "multi"); + selectMenuPath("Component", "State", "Frozen column count", + "-1 columns"); selectMenuPath(EDIT_ROW_5); - WebElement editorCells = findElement(By - .className("v-grid-editor-cells")); + WebElement editorCells = findElements( + By.className("v-grid-editor-cells")).get(1); List selectorDivs = editorCells.findElements(By .cssSelector("div")); diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java index 0c39b3e509..b77cc41946 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java @@ -361,7 +361,7 @@ public class GridEditorTest extends GridBasicFeaturesTest { assertEquals( "Not editable cell did not contain correct classname", "not-editable", - editor.findElement(By.className("v-grid-editor-cells")) + editor.findElements(By.className("v-grid-editor-cells")).get(1) .findElements(By.xpath("./div")).get(3) .getAttribute("class")); -- cgit v1.2.3 From 9734bc5dfa5d919e3214dc17581d3da3ad1a3ebd Mon Sep 17 00:00:00 2001 From: elmot Date: Tue, 30 Jun 2015 17:40:30 +0300 Subject: Grid sidebar menu design changed. See design document and comments at trac ticket. (#18325) Change-Id: I6686d131f015cf0b7b9a6b43ce43284218d5dd63 --- WebContent/VAADIN/themes/base/grid/grid.scss | 10 ++++++---- .../VAADIN/themes/chameleon/components/components.scss | 2 ++ .../VAADIN/themes/chameleon/components/grid/grid.scss | 12 ++++++++++++ WebContent/VAADIN/themes/reindeer/grid/grid.scss | 6 ++++++ WebContent/VAADIN/themes/runo/grid/grid.scss | 15 +++++++-------- WebContent/VAADIN/themes/valo/components/_grid.scss | 3 --- client/src/com/vaadin/client/widgets/Grid.java | 1 - .../grid/basicfeatures/server/GridSidebarThemeTest.java | 12 ++++++------ 8 files changed, 39 insertions(+), 22 deletions(-) create mode 100644 WebContent/VAADIN/themes/chameleon/components/grid/grid.scss (limited to 'uitest/src/com/vaadin/tests/components/grid') diff --git a/WebContent/VAADIN/themes/base/grid/grid.scss b/WebContent/VAADIN/themes/base/grid/grid.scss index 31403428cd..f587dfef4f 100644 --- a/WebContent/VAADIN/themes/base/grid/grid.scss +++ b/WebContent/VAADIN/themes/base/grid/grid.scss @@ -108,6 +108,7 @@ $v-grid-details-border-bottom-stripe: 1px solid darken($v-grid-row-background-co outline: none; padding: 0 4px; text-align: right; + line-height: 1; &::-moz-focus-inner { border: 0; @@ -128,10 +129,10 @@ $v-grid-details-border-bottom-stripe: 1px solid darken($v-grid-row-background-co &.open { .#{$primaryStyleName}-sidebar-button { width: 100%; - + &:after { - content: "\00d7"; - font-size: 16px; + content: "\f0c9"; + font-size: $v-grid-header-font-size; line-height: 1; } } @@ -142,11 +143,12 @@ $v-grid-details-border-bottom-stripe: 1px solid darken($v-grid-row-background-co } .v-ie8 &.open .#{$primaryStyleName}-sidebar-button:after { + vertical-align: middle; + text-align: center; display: inline; } .#{$primaryStyleName}-sidebar-content { - border-top: $v-grid-border; padding: 4px 0; .gwt-MenuBar { diff --git a/WebContent/VAADIN/themes/chameleon/components/components.scss b/WebContent/VAADIN/themes/chameleon/components/components.scss index 9c8a56b33d..578ea23bf3 100644 --- a/WebContent/VAADIN/themes/chameleon/components/components.scss +++ b/WebContent/VAADIN/themes/chameleon/components/components.scss @@ -1,6 +1,7 @@ @import "accordion/accordion.scss"; @import "button/button.scss"; @import "colorpicker/colorpicker.scss"; +@import "grid/grid.scss"; @import "label/label.scss"; @import "menubar/menubar.scss"; @import "notification/notification.scss"; @@ -24,6 +25,7 @@ @include chameleon-accordion; @include chameleon-button; @include chameleon-colorpicker; + @include chameleon-grid; @include chameleon-label; @include chameleon-menubar; @include chameleon-notification; diff --git a/WebContent/VAADIN/themes/chameleon/components/grid/grid.scss b/WebContent/VAADIN/themes/chameleon/components/grid/grid.scss new file mode 100644 index 0000000000..5007ad6619 --- /dev/null +++ b/WebContent/VAADIN/themes/chameleon/components/grid/grid.scss @@ -0,0 +1,12 @@ +@mixin chameleon-grid($primaryStyleName: v-grid) { + + // Sidebar + .#{$primaryStyleName}-sidebar.v-contextmenu { + + .v-on:before, .v-off:before { + content: none; + font-size: 0; + margin-right: 0; + } + } +} diff --git a/WebContent/VAADIN/themes/reindeer/grid/grid.scss b/WebContent/VAADIN/themes/reindeer/grid/grid.scss index 7ae0f402aa..cb5e9d454e 100644 --- a/WebContent/VAADIN/themes/reindeer/grid/grid.scss +++ b/WebContent/VAADIN/themes/reindeer/grid/grid.scss @@ -40,6 +40,12 @@ .#{$primaryStyleName}-sidebar-content { background-color: #f8f8f9; } + + .v-on:before, .v-off:before { + content: none; + font-size: 0; + margin-right: 0; + } } // Sort indicators diff --git a/WebContent/VAADIN/themes/runo/grid/grid.scss b/WebContent/VAADIN/themes/runo/grid/grid.scss index aca9821c53..1f049c5fb0 100644 --- a/WebContent/VAADIN/themes/runo/grid/grid.scss +++ b/WebContent/VAADIN/themes/runo/grid/grid.scss @@ -30,14 +30,7 @@ // Sidebar .#{$primaryStyleName}-sidebar.v-contextmenu { - &.open { - .#{$primaryStyleName}-sidebar-button { - &:after { - font-size: 22px; - } - } - } - + .#{$primaryStyleName}-sidebar-content { background-color: transparent; @@ -45,6 +38,12 @@ border: none; } } + + .v-on:before, .v-off:before { + content: none; + font-size: 0; + margin-right: 0; + } } // Sort indicators diff --git a/WebContent/VAADIN/themes/valo/components/_grid.scss b/WebContent/VAADIN/themes/valo/components/_grid.scss index 27d421b9f2..d00ddf30a4 100644 --- a/WebContent/VAADIN/themes/valo/components/_grid.scss +++ b/WebContent/VAADIN/themes/valo/components/_grid.scss @@ -203,9 +203,6 @@ $v-grid-details-border-bottom-stripe: $v-grid-cell-horizontal-border !default; // Sidebar .#{$primary-stylename}-sidebar.v-contextmenu { &.open { - .#{$primary-stylename}-sidebar-button:after { - font-size: 20px; - } .#{$primary-stylename}-sidebar-content { margin: 0 0 2px; diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java index 232d67c1d4..377943ed61 100644 --- a/client/src/com/vaadin/client/widgets/Grid.java +++ b/client/src/com/vaadin/client/widgets/Grid.java @@ -3248,7 +3248,6 @@ public class Grid extends ResizeComposite implements clickOutsideToCloseHandlerRegistration = Event .addNativePreviewHandler(clickOutsideToCloseHandler); } - openCloseButton.setHeight(""); } /** diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSidebarThemeTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSidebarThemeTest.java index 0e5dd32989..238b470feb 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSidebarThemeTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSidebarThemeTest.java @@ -45,15 +45,15 @@ public class GridSidebarThemeTest extends GridBasicFeaturesTest { private void runTestSequence(String theme) throws IOException { openTestURL("theme=" + theme); - compareScreen(theme + "_SidebarClosed"); + compareScreen(theme + "-SidebarClosed"); getSidebarOpenButton().click(); - compareScreen(theme + "_SidebarOpen"); + compareScreen(theme + "-SidebarOpen"); new Actions(getDriver()).moveToElement(getColumnHidingToggle(2), 5, 5) .perform(); - compareScreen(theme + "_OnMouseOverNotHiddenToggle"); + compareScreen(theme + "-OnMouseOverNotHiddenToggle"); getColumnHidingToggle(2).click(); getColumnHidingToggle(3).click(); @@ -63,17 +63,17 @@ public class GridSidebarThemeTest extends GridBasicFeaturesTest { .perform(); ; - compareScreen(theme + "_TogglesTriggered"); + compareScreen(theme + "-TogglesTriggered"); new Actions(getDriver()).moveToElement(getColumnHidingToggle(2)) .perform(); ; - compareScreen(theme + "_OnMouseOverHiddenToggle"); + compareScreen(theme + "-OnMouseOverHiddenToggle"); getSidebarOpenButton().click(); - compareScreen(theme + "_SidebarClosed2"); + compareScreen(theme + "-SidebarClosed2"); } @Override -- cgit v1.2.3