diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/SettingsPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/SettingsPage.java index 3b88e0a99..f60a38b3f 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/SettingsPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/SettingsPage.java @@ -101,7 +101,10 @@ public final class SettingsPage extends StackPane implements DecoratorPage { @FXML private Pane proxyPane; - { + private ObjectProperty selectedProxyType; + private ObjectProperty backgroundType; + + public SettingsPage() { FXUtils.loadFXML(this, "/assets/fxml/setting.fxml"); FXUtils.smoothScrolling(scroll); @@ -148,7 +151,7 @@ public final class SettingsPage extends StackPane implements DecoratorPage { chkEnableProxy.selectedProperty().bindBidirectional(CONFIG.hasProxyProperty()); chkProxyAuthentication.selectedProperty().bindBidirectional(CONFIG.hasProxyAuthProperty()); - ObjectProperty selectedProxyType = new SimpleObjectProperty(Proxy.Type.HTTP) { + selectedProxyType = new SimpleObjectProperty(Proxy.Type.HTTP) { { invalidated(); } @@ -184,14 +187,14 @@ public final class SettingsPage extends StackPane implements DecoratorPage { FXUtils.installTooltip(btnUpdate, i18n("update.tooltip")); checkUpdate(); - // background + // ==== Background ==== backgroundItem.loadChildren(Collections.singletonList( backgroundItem.createChildren(i18n("launcher.background.default"), EnumBackgroundImage.DEFAULT) )); backgroundItem.setCustomUserData(EnumBackgroundImage.CUSTOM); backgroundItem.getTxtCustom().textProperty().bindBidirectional(CONFIG.backgroundImageProperty()); - ObjectProperty backgroundType = new SimpleObjectProperty(EnumBackgroundImage.DEFAULT) { + backgroundType = new SimpleObjectProperty(EnumBackgroundImage.DEFAULT) { { invalidated(); } @@ -211,8 +214,9 @@ public final class SettingsPage extends StackPane implements DecoratorPage { new When(backgroundType.isEqualTo(EnumBackgroundImage.DEFAULT)) .then(i18n("launcher.background.default")) .otherwise(CONFIG.backgroundImageProperty())); + // ==== - // theme + // ==== Theme ==== JFXColorPicker picker = new JFXColorPicker(Color.web(CONFIG.getTheme().getColor()), null); picker.setCustomColorText(i18n("color.custom")); picker.setRecentColorsText(i18n("color.recent")); @@ -224,6 +228,7 @@ public final class SettingsPage extends StackPane implements DecoratorPage { }); themeColorPickerContainer.getChildren().setAll(picker); Platform.runLater(() -> JFXDepthManager.setDepth(picker, 0)); + // ==== } public String getTitle() {