Skip to content

Commit

Permalink
Fix binding issue for the regex and case sensitive search buttons
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Voigt <dominik.ingo.voigt@gmail.com>
  • Loading branch information
DominikVoigt committed Nov 25, 2020
1 parent 350ec1f commit d4f82c0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/java/org/jabref/gui/search/GlobalSearchBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,14 @@ public GlobalSearchBar(JabRefFrame frame, StateManager stateManager, Preferences
// searchModeButton = new Button();
initSearchModifierButtons();

BooleanBinding focusBinding = searchField.focusedProperty()
.or(regularExpressionButton.focusedProperty()
.or(caseSensitiveButton.focusedProperty()));
BooleanBinding focusedOrActive = searchField.focusedProperty()
.or(searchField.textProperty()
.isNotEmpty());

regularExpressionButton.visibleProperty().unbind();
regularExpressionButton.visibleProperty().bind(focusBinding);
regularExpressionButton.visibleProperty().bind(focusedOrActive);
caseSensitiveButton.visibleProperty().unbind();
caseSensitiveButton.visibleProperty().bind(focusBinding);
caseSensitiveButton.visibleProperty().bind(focusedOrActive);

StackPane modifierButtons = new StackPane(new HBox(regularExpressionButton, caseSensitiveButton));
modifierButtons.setAlignment(Pos.CENTER);
Expand Down

0 comments on commit d4f82c0

Please sign in to comment.