Skip to content

Commit

Permalink
increase edit box max length
Browse files Browse the repository at this point in the history
  • Loading branch information
acrylic-style committed Oct 20, 2023
1 parent 0430cba commit 5d19870
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ protected void init() {
} else if (config instanceof NumberVisualConfig<?> numberVisualConfig) {
int componentWidth = Math.min(maxWidth, this.width / 6);
EditBox editBox = new EditBox(font, this.width / 2 + 6, (offset += 22), componentWidth, 20, Component.literal(""));
editBox.setMaxLength(1024);
editBox.setTooltip(onTooltip);
Number defValue = numberVisualConfig.get();
if (defValue == null) defValue = numberVisualConfig.getDefaultValue();
Expand Down Expand Up @@ -302,6 +303,7 @@ protected void applyValue() {
addLabel.accept(config, offset);
} else if (config instanceof StringVisualConfig stringVisualConfig) {
EditBox editBox = new EditBox(font, this.width / 2 + 6, (offset += 22), Math.min(maxWidth, this.width / 6), 20, Component.literal(""));
editBox.setMaxLength(1024);
editBox.setTooltip(onTooltip);
String defValue = stringVisualConfig.get();
if (defValue == null) defValue = stringVisualConfig.getDefaultValue();
Expand All @@ -321,6 +323,7 @@ protected void applyValue() {
addLabel.accept(config, offset);
} else if (config instanceof ClassVisualConfig classVisualConfig) {
EditBox editBox = new EditBox(font, this.width / 2 + 6, (offset += 22), Math.min(maxWidth, this.width / 6), 20, Component.literal(""));
editBox.setMaxLength(1024);
editBox.setTooltip(onTooltip);
Class<?> defValue = classVisualConfig.get();
if (defValue == null) defValue = classVisualConfig.getDefaultValue();
Expand Down

0 comments on commit 5d19870

Please sign in to comment.