diff options
author | Juuz <6596629+Juuxel@users.noreply.github.com> | 2023-02-02 18:28:46 +0200 |
---|---|---|
committer | Juuz <6596629+Juuxel@users.noreply.github.com> | 2023-02-02 18:30:07 +0200 |
commit | 6b80460d7e3566d8e102ce799aa562adcd9b926d (patch) | |
tree | f7e6b02d85f01a930f846135380f93fbb616b016 | |
parent | 4dfa470e20c82a649c991fa6defb82f08976ebaa (diff) | |
download | LibGui-6b80460d7e3566d8e102ce799aa562adcd9b926d.tar.gz LibGui-6b80460d7e3566d8e102ce799aa562adcd9b926d.tar.bz2 LibGui-6b80460d7e3566d8e102ce799aa562adcd9b926d.zip |
Add test for #182
-rw-r--r-- | GuiTest/src/main/java/io/github/cottonmc/test/client/Issue182TestGui.java | 18 | ||||
-rw-r--r-- | GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/client/Issue182TestGui.java b/GuiTest/src/main/java/io/github/cottonmc/test/client/Issue182TestGui.java new file mode 100644 index 0000000..5d4a739 --- /dev/null +++ b/GuiTest/src/main/java/io/github/cottonmc/test/client/Issue182TestGui.java @@ -0,0 +1,18 @@ +package io.github.cottonmc.test.client; + +import io.github.cottonmc.cotton.gui.client.LightweightGuiDescription; +import io.github.cottonmc.cotton.gui.widget.WBox; +import io.github.cottonmc.cotton.gui.widget.WTextField; +import io.github.cottonmc.cotton.gui.widget.data.Axis; + +// Used for testing issue #182 (https://github.com/CottonMC/LibGui/issues/182): +// Highlighting/selecting text in the top field makes the bottom one blue. +public final class Issue182TestGui extends LightweightGuiDescription { + public Issue182TestGui() { + WBox root = new WBox(Axis.VERTICAL); + root.add(new WTextField(), 100, 20); + root.add(new WTextField(), 100, 20); + setRootPanel(root); + root.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 ead774b..794264c 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 @@ -56,7 +56,7 @@ public class LibGuiTestClient implements ClientModInitializer { var vert = IntegerArgumentType.getInteger(context, "vertical"); return openScreen(client -> new PaddingTestGui(hori, vert)).run(context); })))) - + .then(literal("#182").executes(openScreen(client -> new Issue182TestGui()))) )); } |