Skip to content

Commit

Permalink
Fix color for hovered special fields (JabRef#10742)
Browse files Browse the repository at this point in the history
* Fix typo

* Do not use null

* Fix indent

* Add missing CSS class

Co-authored-by: Christoph <[email protected]>

* Add CHANGELOG.md

---------

Co-authored-by: Christoph <[email protected]>
  • Loading branch information
koppor and Siedlerchr authored Jan 2, 2024
1 parent 37d0518 commit 44d646e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv

- We fixed an issue where attempting to cancel the importing/generation of an entry from id is ignored. [#10508](https://github.com/JabRef/jabref/issues/10508)
- We fixed an issue where the preview panel showing the wrong entry (an entry that is not selected in the entry table). [#9172](https://github.com/JabRef/jabref/issues/9172)
- We fixed the colors of the icon on hover for unset special fields. [#10431](https://github.com/JabRef/jabref/issues/10431)

### Removed

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/actions/StandardActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public enum StandardActions implements Action {

AUTOMATIC_FIELD_EDITOR(Localization.lang("Automatic field editor")),
TOGGLE_GROUPS(Localization.lang("Groups"), IconTheme.JabRefIcons.TOGGLE_GROUPS, KeyBinding.TOGGLE_GROUPS_INTERFACE),
TOOGLE_OO(Localization.lang("OpenOffice/LibreOffice"), IconTheme.JabRefIcons.FILE_OPENOFFICE, KeyBinding.OPEN_OPEN_OFFICE_LIBRE_OFFICE_CONNECTION),
TOGGLE_OO(Localization.lang("OpenOffice/LibreOffice"), IconTheme.JabRefIcons.FILE_OPENOFFICE, KeyBinding.OPEN_OPEN_OFFICE_LIBRE_OFFICE_CONNECTION),
TOGGLE_WEB_SEARCH(Localization.lang("Web search"), Localization.lang("Toggle web search interface"), IconTheme.JabRefIcons.WWW, KeyBinding.WEB_SEARCH),

PARSE_LATEX(Localization.lang("Search for citations in LaTeX files..."), IconTheme.JabRefIcons.LATEX_CITATIONS),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public Node getGraphicNode() {
FontIcon fontIcon = FontIcon.of(icon);
fontIcon.getStyleClass().add("glyph-icon");

// Override the default color from the css files
// Override the default color from the css files
color.ifPresent(color -> fontIcon.setStyle(fontIcon.getStyle() +
String.format("-fx-fill: %s;", ColorUtil.toRGBCode(color)) +
String.format("-fx-icon-color: %s;", ColorUtil.toRGBCode(color))));
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/jabref/gui/maintable/MainTable.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

.table-row-cell:hover .empty-special-field {
visibility: visible;
-fx-icon-color: -jr-gray-2;
-fx-fill: -jr-gray-2;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/sidepane/SidePaneType.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Definition of all possible components in the side pane.
*/
public enum SidePaneType {
OPEN_OFFICE("OpenOffice/LibreOffice", IconTheme.JabRefIcons.FILE_OPENOFFICE, StandardActions.TOOGLE_OO),
OPEN_OFFICE("OpenOffice/LibreOffice", IconTheme.JabRefIcons.FILE_OPENOFFICE, StandardActions.TOGGLE_OO),
WEB_SEARCH(Localization.lang("Web search"), IconTheme.JabRefIcons.WWW, StandardActions.TOGGLE_WEB_SEARCH),
GROUPS(Localization.lang("Groups"), IconTheme.JabRefIcons.TOGGLE_GROUPS, StandardActions.TOGGLE_GROUPS);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public SpecialFieldAction getSpecialFieldAction(SpecialFieldValue value,
}

public JabRefIcon getIcon() {
return getAction().getIcon().orElse(null);
return getAction().getIcon().get();
}

public String getLocalization() {
Expand Down

0 comments on commit 44d646e

Please sign in to comment.