This commit is contained in:
Glavo
2023-02-07 08:05:13 +08:00
committed by Haowei Wen
parent 0f68a7c703
commit b9ef10a73d

View File

@@ -111,7 +111,13 @@ class ModListPageSkin extends SkinBase<ModListPage> {
searchField.setOnAction(e -> search()); searchField.setOnAction(e -> search());
JFXButton closeSearchBar = createToolbarButton2(null, SVG::close, JFXButton closeSearchBar = createToolbarButton2(null, SVG::close,
() -> changeToolbar(toolbarNormal)); () -> {
changeToolbar(toolbarNormal);
isSearching = false;
searchField.clear();
Bindings.bindContent(listView.getItems(), getSkinnable().getItems());
});
searchBar.getChildren().setAll(searchField, closeSearchBar); searchBar.getChildren().setAll(searchField, closeSearchBar);
@@ -182,11 +188,6 @@ class ModListPageSkin extends SkinBase<ModListPage> {
Node oldToolbar = toolbarPane.getCurrentNode(); Node oldToolbar = toolbarPane.getCurrentNode();
if (newToolbar != oldToolbar) { if (newToolbar != oldToolbar) {
toolbarPane.setContent(newToolbar, ContainerAnimations.FADE.getAnimationProducer()); toolbarPane.setContent(newToolbar, ContainerAnimations.FADE.getAnimationProducer());
if (isSearching && newToolbar == toolbarNormal) {
isSearching = false;
searchField.clear();
Bindings.bindContent(listView.getItems(), getSkinnable().getItems());
}
} }
} }