aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/gui/WTightScrollPanel.kt
blob: e9905d85ea2d67e0e027c45afaae880bdfa1697e (plain)
1
2
3
4
5
6
7
8
9
10
11
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)
    }
}