mirror of
https://github.com/octopusYan/alist-gui.git
synced 2024-11-21 19:56:41 +08:00
fix: 切换语言时theme重复bind导致报错的问题
This commit is contained in:
parent
be7e17665f
commit
1b3a4f5569
@ -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;
|
||||
|
@ -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) -> {
|
||||
|
Loading…
Reference in New Issue
Block a user