aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/notenoughupdates/gui/WGridPanelWithPadding.kt
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-05-16 01:23:43 +0200
committernea <nea@nea.moe>2023-05-16 01:23:43 +0200
commitead6762eb1c005914b05f9d3c29f334989c67513 (patch)
treecd1409756be2bc4a93195c31d432fef053afe002 /src/main/kotlin/moe/nea/notenoughupdates/gui/WGridPanelWithPadding.kt
parent96c546cc73880a7c502c17aadda6ca84c847692d (diff)
downloadFirmament-ead6762eb1c005914b05f9d3c29f334989c67513.tar.gz
Firmament-ead6762eb1c005914b05f9d3c29f334989c67513.tar.bz2
Firmament-ead6762eb1c005914b05f9d3c29f334989c67513.zip
Replace references to NEU with Firmament
Diffstat (limited to 'src/main/kotlin/moe/nea/notenoughupdates/gui/WGridPanelWithPadding.kt')
-rw-r--r--src/main/kotlin/moe/nea/notenoughupdates/gui/WGridPanelWithPadding.kt33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/main/kotlin/moe/nea/notenoughupdates/gui/WGridPanelWithPadding.kt b/src/main/kotlin/moe/nea/notenoughupdates/gui/WGridPanelWithPadding.kt
deleted file mode 100644
index 287483e..0000000
--- a/src/main/kotlin/moe/nea/notenoughupdates/gui/WGridPanelWithPadding.kt
+++ /dev/null
@@ -1,33 +0,0 @@
-package moe.nea.notenoughupdates.gui
-
-import io.github.cottonmc.cotton.gui.widget.WPanelWithInsets
-import io.github.cottonmc.cotton.gui.widget.WWidget
-import io.github.cottonmc.cotton.gui.widget.data.Insets
-
-class WGridPanelWithPadding(
- val grid: Int = 18,
- val verticalPadding: Int = 0,
- val horizontalPadding: Int = 0,
-) : WPanelWithInsets() {
-
- private inline val vertOffset get() = grid + verticalPadding
- private inline val horiOffset get() = grid + horizontalPadding
-
- fun add(w: WWidget, x: Int, y: Int, width: Int = 1, height: Int = 1) {
- children.add(w)
- w.parent = this
- w.setLocation(x * horiOffset + insets.left, y * vertOffset + insets.top)
- if (w.canResize())
- w.setSize(
- grid + (horiOffset * (width - 1)),
- grid + (vertOffset * (height - 1)),
- )
- expandToFit(w, insets)
- }
-
- override fun setInsets(insets: Insets): WGridPanelWithPadding {
- super.setInsets(insets)
- return this
- }
-
-} \ No newline at end of file