diff --git a/src/main/java/org/jabref/gui/IconTheme.java b/src/main/java/org/jabref/gui/IconTheme.java index 0b78c7cd09e..249e40ccc3f 100644 --- a/src/main/java/org/jabref/gui/IconTheme.java +++ b/src/main/java/org/jabref/gui/IconTheme.java @@ -198,6 +198,7 @@ public enum JabRefIcon { REFRESH(MaterialDesignIcon.REFRESH), DELETE_ENTRY(MaterialDesignIcon.DELETE), SEARCH(MaterialDesignIcon.MAGNIFY), + ADVANCED_SEARCH(Color.CYAN, MaterialDesignIcon.MAGNIFY), PREFERENCES(MaterialDesignIcon.SETTINGS), HELP(MaterialDesignIcon.HELP_CIRCLE), UP(MaterialDesignIcon.CHEVRON_UP), diff --git a/src/main/java/org/jabref/gui/search/GlobalSearchBar.java b/src/main/java/org/jabref/gui/search/GlobalSearchBar.java index 4d12cb41cd7..7ffc8cc100e 100644 --- a/src/main/java/org/jabref/gui/search/GlobalSearchBar.java +++ b/src/main/java/org/jabref/gui/search/GlobalSearchBar.java @@ -78,6 +78,8 @@ public class GlobalSearchBar extends JPanel { private SearchDisplayMode searchDisplayMode; + private JLabel searchIcon = new JLabel(IconTheme.JabRefIcon.SEARCH.getIcon()); + /** * if this flag is set the searchbar won't be selected after the next search */ @@ -195,6 +197,7 @@ public void actionPerformed(ActionEvent e) { setLayout(new FlowLayout(FlowLayout.RIGHT)); JToolBar toolBar = new OSXCompatibleToolbar(); toolBar.setFloatable(false); + toolBar.add(searchIcon); toolBar.add(container); toolBar.add(openCurrentResultsInDialog); toolBar.addSeparator(); @@ -391,6 +394,11 @@ public void updateResults(int matched, TextFlow description, boolean grammarBase currentResults.setText(Localization.lang("Found %0 results.", String.valueOf(matched))); searchField.pseudoClassStateChanged(CLASS_RESULTS_FOUND, true); } + if (grammarBasedSearch) { + searchIcon.setIcon(IconTheme.JabRefIcon.ADVANCED_SEARCH.getIcon()); + } else { + searchIcon.setIcon(IconTheme.JabRefIcon.SEARCH.getIcon()); + } Tooltip tooltip = new Tooltip(); tooltip.setContentDisplay(ContentDisplay.GRAPHIC_ONLY); tooltip.setGraphic(description); diff --git a/src/main/java/org/jabref/gui/search/SearchTextField.java b/src/main/java/org/jabref/gui/search/SearchTextField.java index e018ac2efd9..334b5a751aa 100644 --- a/src/main/java/org/jabref/gui/search/SearchTextField.java +++ b/src/main/java/org/jabref/gui/search/SearchTextField.java @@ -2,7 +2,6 @@ import javafx.scene.control.TextField; -import org.jabref.gui.IconTheme; import org.jabref.logic.l10n.Localization; import org.controlsfx.control.textfield.CustomTextField; @@ -13,7 +12,7 @@ public class SearchTextField { public static TextField create() { CustomTextField textField = (CustomTextField) TextFields.createClearableTextField(); textField.setPromptText(Localization.lang("Search") + "..."); - textField.setLeft(IconTheme.JabRefIcon.SEARCH.getGraphicNode()); return textField; } + }