From a57eb8d263da1b11f394505190405276cd5872b2 Mon Sep 17 00:00:00 2001 From: mstiles92 Date: Wed, 26 Nov 2014 08:19:13 -0500 Subject: [PATCH 1/2] #470 Prevent the search box from losing focus in Auto Search and NEI Synchronized Auto Search modes. Without this patch applied there is no real difference between the auto and manual search box modes (other than whether the search box initially has focus when the GUI is opened). The search box should always have focus in auto mode, and should be able to lose focus in manual mode, as has always been the case until recently. This patch fixes the problem by preventing the search box from losing focus when in Auto and NEI Synchronized Auto search modes. --- .../appeng/client/gui/implementations/GuiMEMonitorable.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java b/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java index 4e724f78..6e6f0053 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java +++ b/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java @@ -345,7 +345,10 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi @Override protected void mouseClicked(int xCoord, int yCoord, int btn) { - searchField.mouseClicked( xCoord, yCoord, btn ); + Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); + + if ( searchMode != SearchBoxMode.AUTOSEARCH && searchMode != SearchBoxMode.NEI_AUTOSEARCH ) + searchField.mouseClicked( xCoord, yCoord, btn ); if ( btn == 1 && searchField.isMouseIn( xCoord, yCoord ) ) { From f4f3634b7875ee2b78cca5b89a2fed051f839025 Mon Sep 17 00:00:00 2001 From: mstiles92 Date: Wed, 26 Nov 2014 09:29:25 -0500 Subject: [PATCH 2/2] Use braces around if statement body. --- .../appeng/client/gui/implementations/GuiMEMonitorable.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java b/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java index 6e6f0053..449ab063 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java +++ b/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java @@ -348,7 +348,9 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE ); if ( searchMode != SearchBoxMode.AUTOSEARCH && searchMode != SearchBoxMode.NEI_AUTOSEARCH ) + { searchField.mouseClicked( xCoord, yCoord, btn ); + } if ( btn == 1 && searchField.isMouseIn( xCoord, yCoord ) ) {