Skip to content

Commit d029337

Browse files
authored
Merge pull request #128 from andersforsell/splitbarth
Add thickness property in px for MaterialSplitPanel (for 1.6.0)
2 parents e86288d + 5b767c9 commit d029337

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

src/main/java/gwt/material/design/addins/client/splitpanel/MaterialSplitPanel.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public class MaterialSplitPanel extends MaterialWidget {
7979
private double bottomMin;
8080
private double bottomMax;
8181
private double barPosition = 50;
82+
private double thickness = 8;
8283
private Dock dock = Dock.LEFT;
8384
private Axis axis = Axis.HORIZONTAL;
8485

@@ -89,13 +90,14 @@ public MaterialSplitPanel() {
8990
@Override
9091
protected void onLoad() {
9192
super.onLoad();
92-
initSplitter(getElement(), getBarPosition(), getRightMax(), getRightMin(), getLeftMax(), getLeftMin(), getTopMax(), getTopMin(), getBottomMax(), getBottomMin(), getDock().getCssName(), getAxis().getCssName());
93+
initSplitter(getElement(), getBarPosition(), getThickness(), getRightMax(), getRightMin(), getLeftMax(), getLeftMin(), getTopMax(), getTopMin(), getBottomMax(), getBottomMin(), getDock().getCssName(), getAxis().getCssName());
9394
}
9495

9596
/**
9697
* Initialize the splitter component
9798
* @param e - The element you need to split
9899
* @param barPosition - The position of the bar based on percentage by default it's 50%
100+
* @param thickness - The bar's thickness in px
99101
* @param rightMax - The maximum right space while dragging the splitter bar horizontally
100102
* @param rightMin - The minimum right space while dragging the splitter bar horizontally
101103
* @param leftMax - The maximum left space while dragging the splitter bar horizontally
@@ -107,11 +109,11 @@ protected void onLoad() {
107109
* @param dock - When clicking on the white line located in the middle of splitter bar, depends on docking position it will collapse to that direction
108110
* @param orientation - There are two types of orientation : HORIZONTAL (Default) and VERTICAL
109111
*/
110-
protected native void initSplitter(Element e,double barPosition, double rightMax, double rightMin, double leftMax, double leftMin, double topMax, double topMin, double bottomMin, double bottomMax, String dock, String orientation) /*-{
112+
protected native void initSplitter(Element e, double barPosition, double thickness, double rightMax, double rightMin, double leftMax, double leftMin, double topMax, double topMin, double bottomMin, double bottomMax, String dock, String orientation) /*-{
111113
$wnd.jQuery(document).ready(function() {
112114
var splitted = $wnd.jQuery(e);
113115
if( splitted[0].touchSplitter == null ) {
114-
splitted.touchSplit({barPosition: barPosition, thickness: "8px", rightMax: rightMax, rightMin: rightMin, leftMax: leftMax, leftMin: leftMin, topMax: topMax, topMin: topMin, bottomMax: bottomMax, bottomMin: bottomMin, dock: dock, orientation: orientation});
116+
splitted.touchSplit({barPosition: barPosition, thickness: thickness + "px", rightMax: rightMax, rightMin: rightMin, leftMax: leftMax, leftMin: leftMin, topMax: topMax, topMin: topMin, bottomMax: bottomMax, bottomMin: bottomMin, dock: dock, orientation: orientation});
115117
}
116118
});
117119
}-*/;
@@ -291,4 +293,19 @@ public double getBarPosition() {
291293
public void setBarPosition(double barPosition) {
292294
this.barPosition = barPosition;
293295
}
296+
297+
/**
298+
* Get the bar's thickness in px
299+
*/
300+
public double getThickness() {
301+
return thickness;
302+
}
303+
304+
/**
305+
* Set the bar's thickness in px
306+
* @param thickness
307+
*/
308+
public void setThickness(double thickness) {
309+
this.thickness = thickness;
310+
}
294311
}

0 commit comments

Comments
 (0)