From 3ebc59a764687cb68a6d550c99dce1c686bce174 Mon Sep 17 00:00:00 2001 From: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com> Date: Sat, 25 May 2019 14:09:29 +0200 Subject: [PATCH] Fix icon size - the second (#4993) * Refactor fixing wrong icon size * Refactor and fix configureIconButton --- .../org/jabref/gui/actions/ActionFactory.java | 9 ++------- .../org/jabref/gui/entryeditor/EntryEditor.fxml | 9 ++++++++- .../org/jabref/gui/entryeditor/EntryEditor.java | 16 ++++++---------- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/main/java/org/jabref/gui/actions/ActionFactory.java b/src/main/java/org/jabref/gui/actions/ActionFactory.java index 07a8ddb3f2f..60625d13a1a 100644 --- a/src/main/java/org/jabref/gui/actions/ActionFactory.java +++ b/src/main/java/org/jabref/gui/actions/ActionFactory.java @@ -4,7 +4,6 @@ import java.lang.reflect.Method; import java.util.Objects; -import javafx.scene.Node; import javafx.scene.control.Button; import javafx.scene.control.ButtonBase; import javafx.scene.control.CheckMenuItem; @@ -148,13 +147,9 @@ public ButtonBase configureIconButton(Action action, Command command, ButtonBase button.getStyleClass().add("icon-button"); // For some reason the graphic is not set correctly, so let's fix this + // ToDO: Find a way to reuse JabRefIconView button.graphicProperty().unbind(); - action.getIcon().ifPresent(icon -> { - // ToDO: Find a way to reuse JabRefIconView - Node graphicNode = icon.getGraphicNode(); - graphicNode.setStyle(String.format("-fx-font-family: %s; -fx-font-size: %s;", icon.fontFamily(), "1em")); - button.setGraphic(graphicNode); - }); + action.getIcon().ifPresent(icon -> button.setGraphic(icon.getGraphicNode())); return button; } diff --git a/src/main/java/org/jabref/gui/entryeditor/EntryEditor.fxml b/src/main/java/org/jabref/gui/entryeditor/EntryEditor.fxml index d4cd990c09b..35fb41daa74 100644 --- a/src/main/java/org/jabref/gui/entryeditor/EntryEditor.fxml +++ b/src/main/java/org/jabref/gui/entryeditor/EntryEditor.fxml @@ -40,7 +40,14 @@ -