mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-08-03 03:16:35 -04:00
模组下载列表翻页后自动回到顶部 (#4170)
This commit is contained in:
parent
bcd73e6d15
commit
a470475c21
@ -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, () -> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user