From 54ae621bede4331ebed97139b43d2282f64cf060 Mon Sep 17 00:00:00 2001 From: mkpaz Date: Thu, 29 Sep 2022 13:18:49 +0400 Subject: [PATCH] Fix font family chooser --- .../java/atlantafx/sampler/page/general/TypographyPage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sampler/src/main/java/atlantafx/sampler/page/general/TypographyPage.java b/sampler/src/main/java/atlantafx/sampler/page/general/TypographyPage.java index 40ba2aa..b3eb6a7 100755 --- a/sampler/src/main/java/atlantafx/sampler/page/general/TypographyPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/general/TypographyPage.java @@ -93,10 +93,10 @@ public class TypographyPage extends AbstractPage { private ComboBox createFontFamilyChooser() { ComboBox comboBox = new ComboBox<>(); - comboBox.getItems().add(TM.isDefaultFontFamily() ? DEFAULT_FONT_ID : TM.getFontFamily()); + comboBox.getItems().add(DEFAULT_FONT_ID); // keyword to reset font family to its default value comboBox.getItems().addAll(FXCollections.observableArrayList(Font.getFamilies())); comboBox.setPrefWidth(CONTROL_WIDTH); - comboBox.getSelectionModel().select(TM.getFontFamily()); + comboBox.getSelectionModel().select(TM.getFontFamily()); // select active font family value on page load comboBox.valueProperty().addListener((obs, old, val) -> { if (val != null) { TM.setFontFamily(DEFAULT_FONT_ID.equals(val) ? DEFAULT_FONT_FAMILY_NAME : val);