aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GuiTest/src/main/java/io/github/cottonmc/test/client/Issue182TestGui.java18
-rw-r--r--GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java2
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())))
));
}