aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/gui/WSpacer.kt
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-07-11 21:01:58 +0200
committernea <nea@nea.moe>2023-07-11 21:01:58 +0200
commit4d93f475aadc42c4bf83c3a0749af41659235c71 (patch)
treec8e01710defe66e06c50fa962c72fdac66a35a1f /src/main/kotlin/moe/nea/firmament/gui/WSpacer.kt
parent4444fcca44d9a53c8162d69e0e9f19fd214c2f54 (diff)
downloadfirmament-4d93f475aadc42c4bf83c3a0749af41659235c71.tar.gz
firmament-4d93f475aadc42c4bf83c3a0749af41659235c71.tar.bz2
firmament-4d93f475aadc42c4bf83c3a0749af41659235c71.zip
Bulk commit
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/gui/WSpacer.kt')
-rw-r--r--src/main/kotlin/moe/nea/firmament/gui/WSpacer.kt19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/gui/WSpacer.kt b/src/main/kotlin/moe/nea/firmament/gui/WSpacer.kt
new file mode 100644
index 0000000..42d08fe
--- /dev/null
+++ b/src/main/kotlin/moe/nea/firmament/gui/WSpacer.kt
@@ -0,0 +1,19 @@
+package moe.nea.firmament.gui
+
+import io.github.cottonmc.cotton.gui.widget.WPanel
+import io.github.cottonmc.cotton.gui.widget.WWidget
+
+class WSpacer(val child: WWidget, val spaceLeft: Int) : WPanel() {
+ init {
+ children.add(child)
+ child.setLocation(spaceLeft, 0)
+ }
+
+ override fun getWidth(): Int {
+ return child.width + spaceLeft
+ }
+
+ override fun getHeight(): Int {
+ return child.height
+ }
+}