This commit is contained in:
Glavo authored and Haowei Wen committed 2023-02-07 08:07:20 +08:00
1 parent 0f68a7c703
commit b9ef10a73d
1 file changed
+7 -6
@@ -111,7 +111,13 @@ class ModListPageSkin extends SkinBase<ModListPage> {
searchField.setOnAction(e -> search());
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);
@@ -182,11 +188,6 @@ class ModListPageSkin extends SkinBase<ModListPage> {
Node oldToolbar = toolbarPane.getCurrentNode();
if (newToolbar != oldToolbar) {
toolbarPane.setContent(newToolbar, ContainerAnimations.FADE.getAnimationProducer());
if (isSearching && newToolbar == toolbarNormal) {
isSearching = false;
searchField.clear();
Bindings.bindContent(listView.getItems(), getSkinnable().getItems());
}
}
}