summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorHenrik Paul <henrik@vaadin.com>2014-11-27 12:03:20 +0200
committerTeemu Suo-Anttila <teemusa@vaadin.com>2014-11-27 12:05:54 +0000
commit227bd83276810ffbae87b582c985b2702595cf42 (patch)
tree21a012c501209aeaf6c07658d25a0caa802a24bb /client
parent1f585fe302b2aaa0a76fb485b993347e9f2fca82 (diff)
downloadvaadin-framework-227bd83276810ffbae87b582c985b2702595cf42.tar.gz
vaadin-framework-227bd83276810ffbae87b582c985b2702595cf42.zip
Adds a themeable background element for horizontal scrollbar (#13334)
Change-Id: I95622de533497b3d89bcdd2a782c6271aec0764f
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/grid/Escalator.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/ui/grid/Escalator.java b/client/src/com/vaadin/client/ui/grid/Escalator.java
index 3fde3476e0..4262ab53a0 100644
--- a/client/src/com/vaadin/client/ui/grid/Escalator.java
+++ b/client/src/com/vaadin/client/ui/grid/Escalator.java
@@ -800,6 +800,17 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker
horizontalScrollbar.getElement().getStyle()
.setLeft(frozenPixels, Unit.PX);
horizontalScrollbar.setScrollPos(prevScrollPos);
+
+ /*
+ * only show the scrollbar wrapper if the scrollbar itself is
+ * visible.
+ */
+ if (horizontalScrollbar.showsScrollHandle()) {
+ horizontalScrollbarBackground.getStyle().clearDisplay();
+ } else {
+ horizontalScrollbarBackground.getStyle().setDisplay(
+ Display.NONE);
+ }
}
/**
@@ -4039,6 +4050,9 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker
private final ColumnConfigurationImpl columnConfiguration = new ColumnConfigurationImpl();
private final DivElement tableWrapper;
+ private final DivElement horizontalScrollbarBackground = DivElement.as(DOM
+ .createDiv());
+
private PositionFunction position;
/** The cached width of the escalator, in pixels. */
@@ -4138,6 +4152,11 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker
table.appendChild(bodyElem);
table.appendChild(footElem);
+ Style hWrapperStyle = horizontalScrollbarBackground.getStyle();
+ hWrapperStyle.setDisplay(Display.NONE);
+ hWrapperStyle.setHeight(Util.getNativeScrollbarSize(), Unit.PX);
+ root.appendChild(horizontalScrollbarBackground);
+
setStylePrimaryName("v-escalator");
// init default dimensions
@@ -4655,6 +4674,8 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker
horizontalScrollbar.setStylePrimaryName(style);
UIObject.setStylePrimaryName(tableWrapper, style + "-tablewrapper");
+ UIObject.setStylePrimaryName(horizontalScrollbarBackground, style
+ + "-horizontalscrollbarbackground");
header.setStylePrimaryName(style);
body.setStylePrimaryName(style);