mirror of
https://github.com/octopusYan/alist-gui.git
synced 2024-11-10 06:26:43 +08:00
fix: 切换语言时theme重复bind导致报错的问题
This commit is contained in:
parent
be7e17665f
commit
1b3a4f5569
@ -1,6 +1,5 @@
|
|||||||
package cn.octopusyan.alistgui.config;
|
package cn.octopusyan.alistgui.config;
|
||||||
|
|
||||||
import atlantafx.base.theme.Theme;
|
|
||||||
import cn.octopusyan.alistgui.Application;
|
import cn.octopusyan.alistgui.Application;
|
||||||
import cn.octopusyan.alistgui.base.BaseController;
|
import cn.octopusyan.alistgui.base.BaseController;
|
||||||
import cn.octopusyan.alistgui.controller.AboutController;
|
import cn.octopusyan.alistgui.controller.AboutController;
|
||||||
@ -41,7 +40,6 @@ public class Context {
|
|||||||
private static final Logger log = LoggerFactory.getLogger(Context.class);
|
private static final Logger log = LoggerFactory.getLogger(Context.class);
|
||||||
private static Scene scene;
|
private static Scene scene;
|
||||||
private static final IntegerProperty currentViewIndex = new SimpleIntegerProperty(0);
|
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;
|
Context.application = application;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ObjectProperty<Theme> themeProperty() {
|
|
||||||
return theme;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取当前所选时区属性
|
// 获取当前所选时区属性
|
||||||
public static ObjectProperty<Locale> currentLocaleProperty() {
|
public static ObjectProperty<Locale> currentLocaleProperty() {
|
||||||
return currentLocale;
|
return currentLocale;
|
||||||
|
@ -36,7 +36,6 @@ public class SetupViewModel extends BaseViewModel {
|
|||||||
|
|
||||||
|
|
||||||
public SetupViewModel() {
|
public SetupViewModel() {
|
||||||
theme.bindBidirectional(Context.themeProperty());
|
|
||||||
theme.addListener((_, _, newValue) -> ConfigManager.theme(newValue));
|
theme.addListener((_, _, newValue) -> ConfigManager.theme(newValue));
|
||||||
silentStartup.addListener((_, _, newValue) -> ConfigManager.silentStartup(newValue));
|
silentStartup.addListener((_, _, newValue) -> ConfigManager.silentStartup(newValue));
|
||||||
autoStart.addListener((_, _, newValue) -> {
|
autoStart.addListener((_, _, newValue) -> {
|
||||||
|
Loading…
Reference in New Issue
Block a user