From e325d94a8a1641ace08e1560a9240647f3488216 Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Sun, 14 May 2023 15:39:04 +0300 Subject: Add test for #196 --- .../io/github/cottonmc/test/client/Issue196TestGui.java | 16 ++++++++++++++++ .../io/github/cottonmc/test/client/LibGuiTestClient.java | 1 + 2 files changed, 17 insertions(+) create mode 100644 GuiTest/src/main/java/io/github/cottonmc/test/client/Issue196TestGui.java diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/client/Issue196TestGui.java b/GuiTest/src/main/java/io/github/cottonmc/test/client/Issue196TestGui.java new file mode 100644 index 0000000..6de8181 --- /dev/null +++ b/GuiTest/src/main/java/io/github/cottonmc/test/client/Issue196TestGui.java @@ -0,0 +1,16 @@ +package io.github.cottonmc.test.client; + +import net.minecraft.text.Text; + +import io.github.cottonmc.cotton.gui.client.LightweightGuiDescription; +import io.github.cottonmc.cotton.gui.widget.WGridPanel; +import io.github.cottonmc.cotton.gui.widget.WTextField; + +public final class Issue196TestGui extends LightweightGuiDescription { + public Issue196TestGui() { + WTextField textField = new WTextField(Text.literal("Select with tab and type text")); + textField.setText(""); + ((WGridPanel) rootPanel).add(textField, 0, 0, 4, 1); + rootPanel.validate(this); + } +} diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java b/GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java index 32e8343..635040f 100644 --- a/GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java +++ b/GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java @@ -63,6 +63,7 @@ public class LibGuiTestClient implements ClientModInitializer { return openScreen(client -> new PaddingTestGui(hori, vert)).run(context); })))) .then(literal("#182").executes(openScreen(client -> new Issue182TestGui()))) + .then(literal("#196").executes(openScreen(client -> new Issue196TestGui()))) )); } -- cgit