Skip to content

Commit a6952d3

Browse files
committed
fix #1124 Initial SplitPanel sizes not working as expected
1 parent 35339a9 commit a6952d3

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

domino-ui/src/main/java/org/dominokit/domino/ui/splitpanel/HSplitPanel.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
import static org.dominokit.domino.ui.utils.Domino.*;
1919

20+
import org.dominokit.domino.ui.utils.Unit;
21+
2022
/**
2123
* Represents a horizontal split panel which contains two panels separated by a horizontal splitter.
2224
*
@@ -65,6 +67,7 @@ protected double getPanelSize(SplitPanel panel) {
6567
protected void setPanelSize(SplitPanel panel, String size) {
6668
panel.style().setWidth(size);
6769
panel.setCssProperty("--dui-split-panel-dynamic-size", size);
70+
panel.onPanelResize(Unit.px.parse(size).doubleValue());
6871
}
6972

7073
/**

domino-ui/src/main/java/org/dominokit/domino/ui/splitpanel/SplitPanel.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,8 @@ public SplitPanel setLast(boolean last) {
246246
* @param pixels the new size of the panel in pixels
247247
* @param percent the new size of the panel in percentage
248248
*/
249-
void onResize(double pixels, double percent) {
250-
resizeListeners.forEach(
251-
resizeListener -> resizeListener.onResize(SplitPanel.this, pixels, percent));
249+
void onPanelResize(double pixels) {
250+
resizeListeners.forEach(resizeListener -> resizeListener.onResize(SplitPanel.this, pixels));
252251
}
253252

254253
/**
@@ -272,6 +271,6 @@ public interface ResizeListener {
272271
* @param pixels the size of the panel in pixels after resizing
273272
* @param percent the size of the panel in percentage after resizing
274273
*/
275-
void onResize(SplitPanel panel, double pixels, double percent);
274+
void onResize(SplitPanel panel, double pixels);
276275
}
277276
}

domino-ui/src/main/java/org/dominokit/domino/ui/splitpanel/VSplitPanel.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
import static org.dominokit.domino.ui.utils.Domino.*;
1919

20+
import org.dominokit.domino.ui.utils.Unit;
21+
2022
/**
2123
* Represents a vertical split panel which contains two panels separated by a vertical splitter.
2224
*
@@ -65,6 +67,7 @@ protected double getPanelSize(SplitPanel panel) {
6567
protected void setPanelSize(SplitPanel panel, String size) {
6668
panel.style().setHeight(size);
6769
panel.setCssProperty("--dui-split-panel-dynamic-size", size);
70+
panel.onPanelResize(Unit.px.parse(size).doubleValue());
6871
}
6972

7073
/**

0 commit comments

Comments
 (0)