Skip to content

Commit 881f5e7

Browse files
GlavoCiiLu
andauthored
[release/3.6] 模组下载列表翻页后自动回到顶部 (#4433)
#4170 Co-authored-by: 辞庐 <109708109+CiiLu@users.noreply.github.com>
1 parent 73f0eb4 commit 881f5e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadListPage.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ protected Skin<?> createDefaultSkin() {
229229
}
230230

231231
private static class ModDownloadListPageSkin extends SkinBase<DownloadListPage> {
232+
private final JFXListView<RemoteMod> listView = new JFXListView<>();
232233
protected ModDownloadListPageSkin(DownloadListPage control) {
233234
super(control);
234235

@@ -449,6 +450,8 @@ protected ModDownloadListPageSkin(DownloadListPage control) {
449450
boolean disableNext = disableAll || pageOffset == pageCount - 1;
450451
nextPageButton.setDisable(disableNext);
451452
lastPageButton.setDisable(disableNext);
453+
454+
listView.scrollTo(0);
452455
};
453456

454457
FXUtils.onChange(control.pageCount, pageCountN -> {
@@ -504,7 +507,6 @@ protected ModDownloadListPageSkin(DownloadListPage control) {
504507
}
505508
});
506509

507-
JFXListView<RemoteMod> listView = new JFXListView<>();
508510
spinnerPane.setContent(listView);
509511
Bindings.bindContent(listView.getItems(), getSkinnable().items);
510512
FXUtils.onClicked(listView, () -> {

0 commit comments

Comments
 (0)