From 5c9c336a33c28e067730e3e00588ccc873e85b35 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Wed, 30 Jun 2021 14:08:06 +0200 Subject: [PATCH] allow setting glyph to null --- .../org/cryptomator/ui/controls/FontAwesome5IconView.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/controls/FontAwesome5IconView.java b/src/main/java/org/cryptomator/ui/controls/FontAwesome5IconView.java index 4d0797eaa..3bfa70c46 100644 --- a/src/main/java/org/cryptomator/ui/controls/FontAwesome5IconView.java +++ b/src/main/java/org/cryptomator/ui/controls/FontAwesome5IconView.java @@ -21,8 +21,8 @@ public class FontAwesome5IconView extends Text { private static final String FONT_PATH = "/css/fontawesome5-free-solid.otf"; private static final Font FONT; - private ObjectProperty glyph = new SimpleObjectProperty<>(this, "glyph", DEFAULT_GLYPH); - private DoubleProperty glyphSize = new SimpleDoubleProperty(this, "glyphSize", DEFAULT_GLYPH_SIZE); + private final ObjectProperty glyph = new SimpleObjectProperty<>(this, "glyph", DEFAULT_GLYPH); + private final DoubleProperty glyphSize = new SimpleDoubleProperty(this, "glyphSize", DEFAULT_GLYPH_SIZE); static { try { @@ -42,7 +42,7 @@ public class FontAwesome5IconView extends Text { } private void glyphChanged(@SuppressWarnings("unused") ObservableValue observable, @SuppressWarnings("unused") FontAwesome5Icon oldValue, FontAwesome5Icon newValue) { - setText(newValue.unicode()); + setText(newValue == null ? null : newValue.unicode()); } private void glyphSizeChanged(@SuppressWarnings("unused") ObservableValue observable, @SuppressWarnings("unused") Number oldValue, Number newValue) {