Skip to content

Commit

Permalink
Merge pull request #3708 from JabRef/magnifier-color
Browse files Browse the repository at this point in the history
Try to change color of magnifier icon
  • Loading branch information
koppor authored Feb 15, 2018
2 parents 9fac1e3 + 89b3aa0 commit a20f70a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/jabref/gui/IconTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/org/jabref/gui/search/GlobalSearchBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/jabref/gui/search/SearchTextField.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

}

0 comments on commit a20f70a

Please sign in to comment.