aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/gui/config
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-07-30 16:31:23 +0200
committernea <nea@nea.moe>2023-07-30 16:31:23 +0200
commitb9a22305dce467764b55b81cd0ae4e8fa6f6990d (patch)
tree9af1af79c78a2e02f0315a7ee056750b717f0a67 /src/main/kotlin/moe/nea/firmament/gui/config
parentd47f2da4f6289f106d9003ade2e7cd60cb760e2a (diff)
downloadfirmament-b9a22305dce467764b55b81cd0ae4e8fa6f6990d.tar.gz
firmament-b9a22305dce467764b55b81cd0ae4e8fa6f6990d.tar.bz2
firmament-b9a22305dce467764b55b81cd0ae4e8fa6f6990d.zip
Fix overlapping config elements in config overview
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/gui/config')
-rw-r--r--src/main/kotlin/moe/nea/firmament/gui/config/AllConfigsGui.kt18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/gui/config/AllConfigsGui.kt b/src/main/kotlin/moe/nea/firmament/gui/config/AllConfigsGui.kt
index e547e3b..fbde4f5 100644
--- a/src/main/kotlin/moe/nea/firmament/gui/config/AllConfigsGui.kt
+++ b/src/main/kotlin/moe/nea/firmament/gui/config/AllConfigsGui.kt
@@ -23,8 +23,11 @@ import io.github.cottonmc.cotton.gui.client.CottonClientScreen
import io.github.cottonmc.cotton.gui.client.LightweightGuiDescription
import io.github.cottonmc.cotton.gui.widget.WBox
import io.github.cottonmc.cotton.gui.widget.WButton
+import io.github.cottonmc.cotton.gui.widget.WClippedPanel
import io.github.cottonmc.cotton.gui.widget.WGridPanel
import io.github.cottonmc.cotton.gui.widget.WLabel
+import io.github.cottonmc.cotton.gui.widget.WPanel
+import io.github.cottonmc.cotton.gui.widget.WPanelWithInsets
import io.github.cottonmc.cotton.gui.widget.WScrollPanel
import io.github.cottonmc.cotton.gui.widget.data.Axis
import io.github.cottonmc.cotton.gui.widget.data.Insets
@@ -33,6 +36,7 @@ import net.minecraft.client.gui.screen.Screen
import net.minecraft.text.Text
import moe.nea.firmament.features.FeatureManager
import moe.nea.firmament.gui.WFixedPanel
+import moe.nea.firmament.gui.WTightScrollPanel
import moe.nea.firmament.repo.RepoManager
import moe.nea.firmament.util.MC
import moe.nea.firmament.util.ScreenUtil.setScreenLater
@@ -58,12 +62,18 @@ object AllConfigsGui {
}, 0, 1, 10, 1)
box.add(WFixedPanel(panel))
}
- box.insets = Insets.ROOT_PANEL
- lwgd.setRootPanel(WScrollPanel((box)).also {
+ lwgd.setRootPanel(WBox(
+ Axis.VERTICAL
+ ).also {
+ it.insets = Insets.ROOT_PANEL
box.layout()
- it.setSize(box.width + 8, MC.window.scaledHeight / 2)
+ it.add(WFixedPanel((WTightScrollPanel((box)).also {
+ it.setSize(0, MC.window.scaledHeight / 2)
+ })))
+ it.setSize(0, MC.window.scaledHeight / 2)
})
- screen = object : CottonClientScreen(lwgd) {
+
+ screen = object : CottonClientScreen(lwgd) {
override fun close() {
MC.screen = parent
}