From d9df40442f9d4ea5277ea4f36f36042073a85f52 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 18 Aug 2019 18:42:19 +0800 Subject: Close #135 --- src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java') diff --git a/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java index b4f5e2b22..40a54f1df 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java @@ -7,6 +7,7 @@ package me.shedaniel.rei.gui.widget; import com.mojang.blaze3d.platform.GlStateManager; import net.minecraft.client.render.GuiLighting; +import net.minecraft.client.resource.language.I18n; import net.minecraft.client.sound.PositionedSoundInstance; import net.minecraft.sound.SoundEvents; @@ -24,6 +25,7 @@ public class SearchFieldWidget extends TextFieldWidget { GuiLighting.disable(); GlStateManager.disableDepthTest(); setEditableColor(isSearching ? -1313241 : 14737632); + setSuggestion(!isFocused() && getText().isEmpty() ? I18n.translate("text.rei.search.field.suggestion") : null); super.render(int_1, int_2, float_1); GlStateManager.enableDepthTest(); } @@ -32,7 +34,7 @@ public class SearchFieldWidget extends TextFieldWidget { public void renderBorder() { if (!isSearching) super.renderBorder(); - else { + else if (this.hasBorder()) { fill(this.getBounds().x - 1, this.getBounds().y - 1, this.getBounds().x + this.getBounds().width + 1, this.getBounds().y + this.getBounds().height + 1, -1313241); fill(this.getBounds().x, this.getBounds().y, this.getBounds().x + this.getBounds().width, this.getBounds().y + this.getBounds().height, -16777216); } -- cgit