diff options
author | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-05-08 22:20:06 +0300 |
---|---|---|
committer | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-05-08 22:20:06 +0300 |
commit | fe0277477fbf0290429c1d593afc7bcc63db3a35 (patch) | |
tree | b7097d54f4806430c53c064c0e813b7e2c640b52 /src/main | |
parent | 7e61da56c52ebfa00c2fdd036b6dc83d4c0f4e21 (diff) | |
download | LibGui-fe0277477fbf0290429c1d593afc7bcc63db3a35.tar.gz LibGui-fe0277477fbf0290429c1d593afc7bcc63db3a35.tar.bz2 LibGui-fe0277477fbf0290429c1d593afc7bcc63db3a35.zip |
WScrollBar: Fix window
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java | 6 | ||||
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java index 1d357c0..9416f95 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java @@ -102,9 +102,7 @@ public class WListPanel<D, W extends WWidget> extends WClippedPanel { this.children.add(scrollBar); scrollBar.setLocation(this.width-scrollBar.getWidth(), 0); scrollBar.setSize(8, this.height); - //scrollBar.window = 6; - scrollBar.setMaxValue(data.size()); - + //super.layout(); //System.out.println("Validating"); @@ -139,7 +137,7 @@ public class WListPanel<D, W extends WWidget> extends WClippedPanel { //Fix up the scrollbar handle and track metrics scrollBar.setWindow(cellsHigh); - //scrollBar.setMaxValue(data.size()); + scrollBar.setMaxValue(data.size()); int scrollOffset = scrollBar.getValue(); //System.out.println(scrollOffset); diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java index 2010a08..ff7d5e8 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java @@ -129,7 +129,7 @@ public class WScrollBar extends WAbstractSlider { } public void setMaxValue(int max) { - super.setMaxValue(max); + super.setMaxValue(max - window); checkValue(); } |