fix: 切换语言时theme重复bind导致报错的问题
Some checks are pending
Auto Alpha Tag / auto-tag (x64, x64) (push) Waiting to run
Release / meta (push) Waiting to run
Release / windows (x64, x64) (push) Blocked by required conditions
Release / release (push) Blocked by required conditions

This commit is contained in:
octopus_yan 2024-09-19 12:34:52 +08:00
parent be7e17665f
commit 1b3a4f5569
2 changed files with 0 additions and 7 deletions

View File

@ -1,6 +1,5 @@
package cn.octopusyan.alistgui.config;
import atlantafx.base.theme.Theme;
import cn.octopusyan.alistgui.Application;
import cn.octopusyan.alistgui.base.BaseController;
import cn.octopusyan.alistgui.controller.AboutController;
@ -41,7 +40,6 @@ public class Context {
private static final Logger log = LoggerFactory.getLogger(Context.class);
private static Scene scene;
private static final IntegerProperty currentViewIndex = new SimpleIntegerProperty(0);
private static final ObjectProperty<Theme> theme = new SimpleObjectProperty<>(ConfigManager.theme());
/**
* 控制器集合
@ -92,10 +90,6 @@ public class Context {
Context.application = application;
}
public static ObjectProperty<Theme> themeProperty() {
return theme;
}
// 获取当前所选时区属性
public static ObjectProperty<Locale> currentLocaleProperty() {
return currentLocale;

View File

@ -36,7 +36,6 @@ public class SetupViewModel extends BaseViewModel {
public SetupViewModel() {
theme.bindBidirectional(Context.themeProperty());
theme.addListener((_, _, newValue) -> ConfigManager.theme(newValue));
silentStartup.addListener((_, _, newValue) -> ConfigManager.silentStartup(newValue));
autoStart.addListener((_, _, newValue) -> {