diff options
author | Roman / Nea <roman.graef@gmail.com> | 2021-11-16 21:25:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-16 22:25:28 +0200 |
commit | 5a7f7a6505063355603da275e66243221d970d2a (patch) | |
tree | d73894b73e7cdb7b6d07a5e3cb9cde4b14af5aef /GuiTest/src/main/java | |
parent | 231fc57601bf270524017c72d584517f3982367e (diff) | |
download | LibGui-5a7f7a6505063355603da275e66243221d970d2a.tar.gz LibGui-5a7f7a6505063355603da275e66243221d970d2a.tar.bz2 LibGui-5a7f7a6505063355603da275e66243221d970d2a.zip |
Improve WTextField (#140)
* Refactor rendering of WTextField and add text scrolling
* Make caret position movable by clicks
Also deprecated the public getCaretPos method since it was public.
* Rework keyboard interactions with WTextField
Introduce CTRL+(Left/Right) for deletes, selects and cursor moves.
* Revert breaking API changes in WTextField
Diffstat (limited to 'GuiTest/src/main/java')
-rw-r--r-- | GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java b/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java index 5cf09d4..70c50d4 100644 --- a/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java +++ b/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java @@ -18,7 +18,7 @@ public class TestDescription extends SyncedGuiDescription { public TestDescription(ScreenHandlerType<?> type, int syncId, PlayerInventory playerInventory, ScreenHandlerContext context) { super(type, syncId, playerInventory, getBlockInventory(context, GuiBlockEntity.INVENTORY_SIZE), null); - + WGridPanel root = (WGridPanel)this.getRootPanel(); WItemSlot slot = WItemSlot.of(blockInventory, 0, 4, 1); @@ -39,7 +39,7 @@ public class TestDescription extends SyncedGuiDescription { root.add(buttonB, 5, 3, 4, 1); root.add(new WButton(new LiteralText("Button C")), 0, 5, 4, 1); root.add(new WButton(new LiteralText("Button D")), 5, 5, 4, 1); - root.add(new WTextField(new LiteralText("Type something...")), 0, 7, 5, 1); + root.add(new WTextField(new LiteralText("Type something...")).setMaxLength(64), 0, 7, 5, 1); root.add(new WLabel(new LiteralText("Large slot:")), 0, 9); root.add(WItemSlot.outputOf(blockInventory, 0), 4, 9); |