Save search string when search unfocuses (#149)

This commit is contained in:
firenoo authored and GitHub committed 2023-08-02 18:02:12 +02:00
1 parent 3fa1b1e0e2
commit dd842a182c
1 file changed
+11
@@ -339,10 +339,21 @@ public class GuiInterfaceTerminalWireless extends FCBaseMEGui implements IDropTo
@Override
protected void mouseClicked(final int xCoord, final int yCoord, final int btn) {
boolean focusIn = searchFieldInputs.isFocused();
boolean focusOut = searchFieldOutputs.isFocused();
boolean focusName = searchFieldNames.isFocused();
searchFieldInputs.mouseClicked(xCoord, yCoord, btn);
searchFieldOutputs.mouseClicked(xCoord, yCoord, btn);
searchFieldNames.mouseClicked(xCoord, yCoord, btn);
if (focusIn && !searchFieldInputs.isFocused()) {
searchFieldInputsText = searchFieldInputs.getText();
} else if (focusOut && !searchFieldOutputs.isFocused()) {
searchFieldOutputsText = searchFieldOutputs.getText();
} else if (focusName && !searchFieldNames.isFocused()) {
searchFieldNamesText = searchFieldNames.getText();
}
super.mouseClicked(xCoord, yCoord, btn);
}