From 9987bf932829a495a9671677c4bdc3f53256ef5b Mon Sep 17 00:00:00 2001 From: Juuxel <6596629+Juuxel@users.noreply.github.com> Date: Sat, 27 Feb 2021 16:52:53 +0200 Subject: WListPanel: Add mouse scrolling support --- src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java | 6 ++++++ 1 file changed, 6 insertions(+) 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 2ddc6f1..e83d891 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 @@ -5,6 +5,7 @@ import net.fabricmc.api.Environment; import net.minecraft.client.util.math.MatrixStack; import io.github.cottonmc.cotton.gui.widget.data.Axis; +import io.github.cottonmc.cotton.gui.widget.data.InputResult; import java.util.ArrayList; import java.util.HashMap; @@ -196,4 +197,9 @@ public class WListPanel extends WClippedPanel { fixedHeight = true; return this; } + + @Override + public InputResult onMouseScroll(int x, int y, double amount) { + return scrollBar.onMouseScroll(0, 0, amount); + } } -- cgit