Skip to content

Commit

Permalink
Added remove button to tags
Browse files Browse the repository at this point in the history
  • Loading branch information
calixtus authored and Siedlerchr committed May 18, 2023
1 parent d57a2ae commit d4846c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.control.ContentDisplay;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;

import org.jabref.gui.autocompleter.SuggestionProvider;
import org.jabref.gui.icon.IconTheme;
import org.jabref.gui.util.ViewModelListCellFactory;
import org.jabref.logic.integrity.FieldCheckers;
import org.jabref.model.database.BibDatabaseContext;
Expand Down Expand Up @@ -81,6 +83,9 @@ public ParsedEntryLinkField() {
private Node createTag(ParsedEntryLink entryLink) {
Label tagLabel = new Label();
tagLabel.setText(getConverter().toString(entryLink));
tagLabel.setGraphic(IconTheme.JabRefIcons.REMOVE_TAGS.getGraphicNode());
tagLabel.getGraphic().setOnMouseClicked(event -> removeTags(entryLink));
tagLabel.setContentDisplay(ContentDisplay.RIGHT);
tagLabel.setOnMouseClicked(event -> {
if (event.getClickCount() == 2) {
viewModel.jumpToEntry(entryLink);
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/org/jabref/gui/icon/IconTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,9 @@ public enum JabRefIcons implements JabRefIcon {
KEEP_ON_TOP(MaterialDesignP.PIN),
KEEP_ON_TOP_OFF(MaterialDesignP.PIN_OFF_OUTLINE),
OPEN_GLOBAL_SEARCH(MaterialDesignO.OPEN_IN_NEW),

REMOVE_TAGS(MaterialDesignC.CLOSE),
ACCEPT_LEFT(MaterialDesignS.SUBDIRECTORY_ARROW_LEFT),

ACCEPT_RIGHT(MaterialDesignS.SUBDIRECTORY_ARROW_RIGHT),

MERGE_GROUPS(MaterialDesignS.SOURCE_MERGE);

private final JabRefIcon icon;
Expand Down

0 comments on commit d4846c1

Please sign in to comment.