diff options
author | nea <nea@nea.moe> | 2023-05-25 23:33:28 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-05-25 23:33:28 +0200 |
commit | ee765a46475d907838697e78968b56155c69da03 (patch) | |
tree | 27a3b13389e753117e0bf7e7143619e28fed7fd7 /src/main/kotlin/moe/nea/firmament/gui/WFixedPanel.kt | |
parent | c9ceb228585dcb4ec6b74023dbb3beaa7db5946a (diff) | |
download | Firmament-ee765a46475d907838697e78968b56155c69da03.tar.gz Firmament-ee765a46475d907838697e78968b56155c69da03.tar.bz2 Firmament-ee765a46475d907838697e78968b56155c69da03.zip |
Make use of WFixedPanel for the config gui
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/gui/WFixedPanel.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/gui/WFixedPanel.kt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/gui/WFixedPanel.kt b/src/main/kotlin/moe/nea/firmament/gui/WFixedPanel.kt new file mode 100644 index 0000000..4ada681 --- /dev/null +++ b/src/main/kotlin/moe/nea/firmament/gui/WFixedPanel.kt @@ -0,0 +1,25 @@ +package moe.nea.firmament.gui + +import io.github.cottonmc.cotton.gui.widget.WPanel +import io.github.cottonmc.cotton.gui.widget.WWidget + +class WFixedPanel() : WPanel() { + var child: WWidget + set(value) { + children.clear() + setSize(0, 0) + children.add(value) + } + get() = children.single() + + constructor(child: WWidget) : this() { + this.child = child + } + + override fun layout() { + setSize(0, 0) + super.layout() + } + + override fun canResize(): Boolean = false +} |