Skip to content

Commit

Permalink
feature JabRef#3607 autolink redesign
Browse files Browse the repository at this point in the history
- added (Auto) in front of the name of the pdf
- changed the icon for the linking action to LINK_PLUS
  • Loading branch information
LukasGutenberg committed Mar 3, 2021
1 parent e50566a commit 64a6005
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;
import javafx.scene.input.TransferMode;
import javafx.scene.layout.Background;
import javafx.scene.layout.BackgroundFill;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
import javafx.scene.text.Text;

import org.jabref.gui.DialogService;
Expand Down Expand Up @@ -150,9 +154,17 @@ private static Node createFileDisplay(LinkedFileViewModel linkedFile) {
progressIndicator.progressProperty().bind(linkedFile.downloadProgressProperty());
progressIndicator.visibleProperty().bind(linkedFile.downloadOngoingProperty());


Text auto = new Text();
auto.visibleProperty().bind(linkedFile.isAutomaticallyFoundProperty());
auto.managedProperty().bind(linkedFile.isAutomaticallyFoundProperty());
auto.setText("(Auto)");
auto.getStyleClass().setAll("file-row-text");

HBox info = new HBox(8);
info.setStyle("-fx-padding: 0.5em 0 0.5em 0;"); // To align with buttons below which also have 0.5em padding
info.getChildren().setAll(icon, link, desc, progressIndicator);
info.getChildren().setAll(icon, auto, link, desc, progressIndicator);


Button acceptAutoLinkedFile = IconTheme.JabRefIcons.AUTO_LINKED_FILE.asButton();
acceptAutoLinkedFile.setTooltip(new Tooltip(Localization.lang("This file was found automatically. Do you want to link it to this entry?")));
Expand All @@ -169,6 +181,7 @@ private static Node createFileDisplay(LinkedFileViewModel linkedFile) {
HBox container = new HBox(10);
container.setPrefHeight(Double.NEGATIVE_INFINITY);


container.getChildren().addAll(info, acceptAutoLinkedFile, writeXMPMetadata);

return container;
Expand Down
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 @@ -230,7 +230,7 @@ public enum JabRefIcons implements JabRefIcon {
RENAME(MaterialDesignR.RENAME_BOX),
DELETE_FILE(MaterialDesignD.DELETE_FOREVER),
REMOVE_LINK(MaterialDesignL.LINK_OFF),
AUTO_LINKED_FILE(MaterialDesignB.BRIEFCASE_CHECK),
AUTO_LINKED_FILE(MaterialDesignL.LINK_PLUS),
QUALITY_ASSURED(MaterialDesignC.CERTIFICATE),
QUALITY(MaterialDesignC.CERTIFICATE),
OPEN(MaterialDesignF.FOLDER_OUTLINE),
Expand Down

0 comments on commit 64a6005

Please sign in to comment.