From 9477a32ad577fc242fd83059826706fcea8c6f31 Mon Sep 17 00:00:00 2001 From: nea Date: Sat, 3 Jun 2023 14:24:48 +0200 Subject: Bad pets menu --- src/main/kotlin/moe/nea/firmament/gui/WTightScrollPanel.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/main/kotlin/moe/nea/firmament/gui/WTightScrollPanel.kt (limited to 'src/main/kotlin/moe/nea/firmament/gui/WTightScrollPanel.kt') diff --git a/src/main/kotlin/moe/nea/firmament/gui/WTightScrollPanel.kt b/src/main/kotlin/moe/nea/firmament/gui/WTightScrollPanel.kt new file mode 100644 index 0000000..e9905d8 --- /dev/null +++ b/src/main/kotlin/moe/nea/firmament/gui/WTightScrollPanel.kt @@ -0,0 +1,12 @@ +package moe.nea.firmament.gui + +import io.github.cottonmc.cotton.gui.widget.WPanel +import io.github.cottonmc.cotton.gui.widget.WScrollPanel +import io.github.cottonmc.cotton.gui.widget.WWidget + +class WTightScrollPanel(val widget: WWidget, val margin: Int = 3) : WScrollPanel(widget) { + override fun setSize(x: Int, y: Int) { + (widget as? WPanel)?.layout() + super.setSize(widget.width + 8 + margin, y) + } +} -- cgit