Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Fix for group icon #7552

Merged
merged 3 commits into from
Mar 20, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/icon/IconTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public enum JabRefIcons implements JabRefIcon {
TWITTER(MaterialDesignT.TWITTER),
BLOG(MaterialDesignR.RSS),
DATE_PICKER(MaterialDesignC.CALENDAR),
DEFAULT_GROUP_ICON_COLORED(MaterialDesignP.PLAY),
DEFAULT_GROUP_ICON_COLORED(MaterialDesignC.CIRCLE),
DEFAULT_GROUP_ICON(MaterialDesignL.LABEL_OUTLINE),
ALL_ENTRIES_GROUP_ICON(MaterialDesignD.DATABASE),
IMPORT(MaterialDesignC.CALL_RECEIVED),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import javafx.scene.Node;
import javafx.scene.paint.Color;

import org.jabref.gui.util.ColorUtil;

import org.kordamp.ikonli.Ikon;
import org.kordamp.ikonli.javafx.FontIcon;

Expand Down Expand Up @@ -41,7 +43,7 @@ public Node getGraphicNode() {
Ikon icon = icons.get(0);
FontIcon fontIcon = FontIcon.of(icon);
fontIcon.getStyleClass().add("glyph-icon");
color.ifPresent(fontIcon::setIconColor);
color.ifPresent(color -> fontIcon.setStyle(fontIcon.getStyle() + String.format("-fx-fill: %s;", ColorUtil.toRGBCode(color))));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why setIconColor doesn't work? Maybe add a short comment so that we will not revert it in the future by accident.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I have no idea.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has something to do with the style class. If you uncomment the line "getStyleClass.add("glyph-icon")" than it works properly. However, then the rest of the icons are black because that property is set in the css (and is obviously different for dark and base.css) and therefore overrides the color of the 'FontIcon".

So add a comment like:
Override the default color from the css files

return fontIcon;
}

Expand Down