fix(config): Use Consolas by default on Windows only

Currently non-Windows systems get a proportional font for logging. Bad.

Fix #139.
This commit is contained in:
Mingye Wang 2022-05-10 17:43:00 +08:00 committed by Yuhui Huang
parent cc39a37beb
commit c62963f455

View File

@ -146,7 +146,7 @@ public final class Config implements Cloneable, Observable {
private ObservableList<Map<Object, Object>> accountStorages = FXCollections.observableArrayList();
@SerializedName("fontFamily")
private StringProperty fontFamily = new SimpleStringProperty("Consolas");
private StringProperty fontFamily = new SimpleStringProperty("Monospace");
@SerializedName("fontSize")
private DoubleProperty fontSize = new SimpleDoubleProperty(12);
@ -188,6 +188,10 @@ public final class Config implements Cloneable, Observable {
private transient ObservableHelper helper = new ObservableHelper(this);
public Config() {
// Default override for better-looking logs on Windows
if (System.getProperty("os.name").startsWith("Windows")) {
this.fontFamily = new SimpleStringProperty("Consolas");
}
PropertyUtils.attachListener(this, helper);
}