fixup! use suggested OS detection

This commit is contained in:
Mingye Wang 2022-05-13 16:56:25 +08:00 committed by Yuhui Huang
parent 718c0a668a
commit b91dba3141

View File

@ -40,8 +40,10 @@ import org.jackhuang.hmcl.util.i18n.Locales;
import org.jackhuang.hmcl.util.i18n.Locales.SupportedLocale;
import org.jackhuang.hmcl.util.javafx.ObservableHelper;
import org.jackhuang.hmcl.util.javafx.PropertyUtils;
import org.jackhuang.hmcl.util.platform.OperatingSystem;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.net.Proxy;
import java.util.Map;
@ -146,7 +148,7 @@ public final class Config implements Cloneable, Observable {
private ObservableList<Map<Object, Object>> accountStorages = FXCollections.observableArrayList();
@SerializedName("fontFamily")
private StringProperty fontFamily = new SimpleStringProperty("Monospace");
private StringProperty fontFamily = new SimpleStringProperty(OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS ? "Consolas" : "Monospace");
@SerializedName("fontSize")
private DoubleProperty fontSize = new SimpleDoubleProperty(12);
@ -188,10 +190,6 @@ 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.setValue("Consolas");
}
PropertyUtils.attachListener(this, helper);
}