[release/3.6] 模组下载列表翻页后自动回到顶部 (#4433)

https://github.com/HMCL-dev/HMCL/pull/4170

Co-authored-by: 辞庐 <[email protected]>
This commit is contained in:
Glavoand辞庐 authored and GitHub committed 2025-09-10 21:28:03 +08:00
1 parent 73f0eb472a
commit 881f5e7874
1 file changed
+3 -1
@@ -229,6 +229,7 @@ public class DownloadListPage extends Control implements DecoratorPage, VersionP
}
private static class ModDownloadListPageSkin extends SkinBase<DownloadListPage> {
private final JFXListView<RemoteMod> listView = new JFXListView<>();
protected ModDownloadListPageSkin(DownloadListPage control) {
super(control);
@@ -449,6 +450,8 @@ public class DownloadListPage extends Control implements DecoratorPage, VersionP
boolean disableNext = disableAll || pageOffset == pageCount - 1;
nextPageButton.setDisable(disableNext);
lastPageButton.setDisable(disableNext);
listView.scrollTo(0);
};
FXUtils.onChange(control.pageCount, pageCountN -> {
@@ -504,7 +507,6 @@ public class DownloadListPage extends Control implements DecoratorPage, VersionP
}
});
JFXListView<RemoteMod> listView = new JFXListView<>();
spinnerPane.setContent(listView);
Bindings.bindContent(listView.getItems(), getSkinnable().items);
FXUtils.onClicked(listView, () -> {