diff options
author | nea <nea@nea.moe> | 2023-06-03 14:24:48 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-06-03 14:24:48 +0200 |
commit | 9477a32ad577fc242fd83059826706fcea8c6f31 (patch) | |
tree | 900481bf5c9bc390b4101f946f6221b9995eccba /src/main/kotlin/moe/nea/firmament/gui/WTightScrollPanel.kt | |
parent | 06a8ace53c3c1fcce02e9a9d085b82acb8cecb71 (diff) | |
download | firmament-9477a32ad577fc242fd83059826706fcea8c6f31.tar.gz firmament-9477a32ad577fc242fd83059826706fcea8c6f31.tar.bz2 firmament-9477a32ad577fc242fd83059826706fcea8c6f31.zip |
Bad pets menu
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/gui/WTightScrollPanel.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/gui/WTightScrollPanel.kt | 12 |
1 files changed, 12 insertions, 0 deletions
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) + } +} |