diff --git a/src/main/java/com/sparrowwallet/sparrow/SparrowDesktop.java b/src/main/java/com/sparrowwallet/sparrow/SparrowDesktop.java index 76fe3e58..9c2c66d5 100644 --- a/src/main/java/com/sparrowwallet/sparrow/SparrowDesktop.java +++ b/src/main/java/com/sparrowwallet/sparrow/SparrowDesktop.java @@ -42,10 +42,7 @@ public class SparrowDesktop extends Application { public void start(Stage stage) throws Exception { this.mainStage = stage; - GlyphFontRegistry.register(new FontAwesome5()); - GlyphFontRegistry.register(new FontAwesome5Brands()); - Font.loadFont(AppServices.class.getResourceAsStream("/font/RobotoMono-Regular.ttf"), 13); - Font.loadFont(AppServices.class.getResourceAsStream("/font/RobotoMono-Italic.ttf"), 11); + initializeFonts(); URL.setURLStreamHandlerFactory(protocol -> WalletIcon.PROTOCOL.equals(protocol) ? new WalletIcon.WalletIconStreamHandler() : null); AppServices.initialize(this); @@ -117,6 +114,16 @@ public class SparrowDesktop extends Application { }); } + private void initializeFonts() { + GlyphFontRegistry.register(new FontAwesome5()); + GlyphFontRegistry.register(new FontAwesome5Brands()); + Font.loadFont(AppServices.class.getResourceAsStream("/font/RobotoMono-Regular.ttf"), 13); + Font.loadFont(AppServices.class.getResourceAsStream("/font/RobotoMono-Italic.ttf"), 11); + if(Platform.getCurrent() == Platform.OSX) { + Font.loadFont(AppServices.class.getResourceAsStream("/font/LiberationSans-Regular.ttf"), 13); + } + } + @Override public void stop() throws Exception { AppServices.get().stop(); diff --git a/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java b/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java index 07bd82a3..7e656220 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java @@ -811,12 +811,11 @@ public class EntryCell extends TreeTableCell implements Confirmati cell.getStyleClass().remove("negative-amount"); cell.getStyleClass().remove("spent"); cell.getStyleClass().remove("unspendable"); + cell.getStyleClass().remove("number-field"); if(entry != null) { - if(entry instanceof TransactionEntry) { + if(entry instanceof TransactionEntry transactionEntry) { cell.getStyleClass().add("transaction-row"); - TransactionEntry transactionEntry = (TransactionEntry)entry; - if(cell instanceof ConfirmationsListener confirmationsListener) { if(transactionEntry.isConfirming()) { cell.getStyleClass().add("confirming"); @@ -825,17 +824,21 @@ public class EntryCell extends TreeTableCell implements Confirmati confirmationsListener.getConfirmationsProperty().unbind(); } } + if(org.controlsfx.tools.Platform.getCurrent() == org.controlsfx.tools.Platform.OSX && transactionEntry.getBlockTransaction().getHeight() > 0) { + cell.getStyleClass().add("number-field"); + } } else if(entry instanceof NodeEntry) { cell.getStyleClass().add("node-row"); - } else if(entry instanceof UtxoEntry) { + } else if(entry instanceof UtxoEntry utxoEntry) { cell.getStyleClass().add("utxo-row"); - UtxoEntry utxoEntry = (UtxoEntry)entry; if(!utxoEntry.isSpendable()) { cell.getStyleClass().add("unspendable"); } - } else if(entry instanceof HashIndexEntry) { + if(org.controlsfx.tools.Platform.getCurrent() == org.controlsfx.tools.Platform.OSX && utxoEntry.getHashIndex().getHeight() > 0) { + cell.getStyleClass().add("number-field"); + } + } else if(entry instanceof HashIndexEntry hashIndexEntry) { cell.getStyleClass().add("hashindex-row"); - HashIndexEntry hashIndexEntry = (HashIndexEntry)entry; if(hashIndexEntry.isSpent()) { cell.getStyleClass().add("spent"); } diff --git a/src/main/resources/com/sparrowwallet/sparrow/general.css b/src/main/resources/com/sparrowwallet/sparrow/general.css index 217d9034..f43f8eb0 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/general.css +++ b/src/main/resources/com/sparrowwallet/sparrow/general.css @@ -251,7 +251,7 @@ } .number-field { - -fx-font-family: 'Helvetica Neue Regular', 'System Regular'; + -fx-font-family: 'Liberation Sans'; } VerticalHeader > Label.selected { diff --git a/src/main/resources/font/LiberationSans-Regular.ttf b/src/main/resources/font/LiberationSans-Regular.ttf new file mode 100644 index 00000000..59d2e251 Binary files /dev/null and b/src/main/resources/font/LiberationSans-Regular.ttf differ