diff --git a/CHANGELOG.md b/CHANGELOG.md index 43fdf812fdf..8b0901a26fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - The export to MS Office XML now uses the month name for the field `MonthAcessed` instead of the two digit number [#7354](https://github.com/JabRef/jabref/issues/7354) - We included some standalone dialogs from the options menu in the main preference dialog and fixed some visual issues in the preferences dialog. [#7384](https://github.com/JabRef/jabref/pull/7384) - We improved the linking of the `python3` interpreter via the shebang to dynamically use the systems default Python. Related to [JabRef-Browser-Extension #177](https://github.com/JabRef/JabRef-Browser-Extension/issues/177) +- Automatically found pdf files now have the linking button to the far left and uses a link icon with a plus instead of a briefcase. The file name also has lowered opacity(70%) until added. [#3607](https://github.com/JabRef/jabref/issues/3607) - We simplified the select entry type form by splitting it into two parts ("Recommended" and "Others") based on internal usage data. [#6730](https://github.com/JabRef/jabref/issues/6730) ### Fixed diff --git a/src/main/java/org/jabref/gui/Base.css b/src/main/java/org/jabref/gui/Base.css index 9296ab3a7d8..e7f42cd8bb4 100644 --- a/src/main/java/org/jabref/gui/Base.css +++ b/src/main/java/org/jabref/gui/Base.css @@ -646,6 +646,10 @@ -fx-fill: -jr-search-text; } +.file-row-text:opacity{ + -fx-fill: derive(-jr-search-text, 70%); +} + .combo-box-base { -fx-background-color: -fx-outer-border, -fx-control-inner-background; -fx-background-insets: 0, 1; diff --git a/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java b/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java index acba658aaec..bfd49abef93 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java @@ -4,6 +4,7 @@ import javafx.beans.binding.Bindings; import javafx.collections.ObservableList; +import javafx.css.PseudoClass; import javafx.fxml.FXML; import javafx.scene.Node; import javafx.scene.Parent; @@ -46,6 +47,7 @@ import org.jabref.preferences.PreferencesService; import com.airhacks.afterburner.views.ViewLoader; +import com.tobiasdiez.easybind.EasyBind; public class LinkedFilesEditor extends HBox implements FieldEditorFX { @@ -137,11 +139,16 @@ private void handleOnDragDropped(LinkedFileViewModel originalItem, DragEvent eve } private static Node createFileDisplay(LinkedFileViewModel linkedFile) { + PseudoClass opacity = PseudoClass.getPseudoClass("opacity"); + Node icon = linkedFile.getTypeIcon().getGraphicNode(); icon.setOnMouseClicked(event -> linkedFile.open()); + Text link = new Text(); link.textProperty().bind(linkedFile.linkProperty()); link.getStyleClass().setAll("file-row-text"); + EasyBind.subscribe(linkedFile.isAutomaticallyFoundProperty(), found -> link.pseudoClassStateChanged(opacity, found)); + Text desc = new Text(); desc.textProperty().bind(linkedFile.descriptionProperty()); desc.getStyleClass().setAll("file-row-text"); @@ -157,6 +164,7 @@ private static Node createFileDisplay(LinkedFileViewModel linkedFile) { 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?"))); acceptAutoLinkedFile.visibleProperty().bind(linkedFile.isAutomaticallyFoundProperty()); + acceptAutoLinkedFile.managedProperty().bind(linkedFile.isAutomaticallyFoundProperty()); acceptAutoLinkedFile.setOnAction(event -> linkedFile.acceptAsLinked()); acceptAutoLinkedFile.getStyleClass().setAll("icon-button"); @@ -169,7 +177,7 @@ private static Node createFileDisplay(LinkedFileViewModel linkedFile) { HBox container = new HBox(10); container.setPrefHeight(Double.NEGATIVE_INFINITY); - container.getChildren().addAll(info, acceptAutoLinkedFile, writeXMPMetadata); + container.getChildren().addAll(acceptAutoLinkedFile, info, writeXMPMetadata); return container; } diff --git a/src/main/java/org/jabref/gui/icon/IconTheme.java b/src/main/java/org/jabref/gui/icon/IconTheme.java index 07a3a346fe1..aa95617c38f 100644 --- a/src/main/java/org/jabref/gui/icon/IconTheme.java +++ b/src/main/java/org/jabref/gui/icon/IconTheme.java @@ -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),