Skip to content

Commit 285e361

Browse files
authored
[Enhancement] 下载界面简介不滚动 (#5458)
1 parent 0b70dc6 commit 285e361

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import javafx.scene.control.ScrollPane;
3333
import javafx.scene.control.Skin;
3434
import javafx.scene.control.SkinBase;
35-
import javafx.scene.layout.BorderPane;
3635
import javafx.scene.layout.HBox;
3736
import javafx.scene.layout.Priority;
3837
import javafx.scene.layout.Region;
@@ -224,17 +223,12 @@ protected ModDownloadPageSkin(DownloadPage control) {
224223
VBox pane = new VBox(8);
225224
pane.getStyleClass().add("gray-background");
226225
pane.setPadding(new Insets(10));
227-
ScrollPane scrollPane = new ScrollPane(pane);
228-
FXUtils.smoothScrolling(scrollPane);
229-
scrollPane.setFitToWidth(true);
230-
scrollPane.setFitToHeight(true);
231226

232227
HBox descriptionPane = new HBox(8);
233228
descriptionPane.setMinHeight(Region.USE_PREF_SIZE);
234229
descriptionPane.setAlignment(Pos.CENTER);
235230
pane.getChildren().add(descriptionPane);
236231
descriptionPane.getStyleClass().add("card-non-transparent");
237-
BorderPane.setMargin(descriptionPane, new Insets(11, 11, 0, 11));
238232
{
239233
var imageContainer = new ImageContainer(40);
240234
if (StringUtils.isNotBlank(getSkinnable().addon.getIconUrl())) {
@@ -283,8 +277,12 @@ protected ModDownloadPageSkin(DownloadPage control) {
283277
spinnerPane.setOnFailedAction(e -> getSkinnable().loadModVersions());
284278

285279
ComponentList list = new ComponentList();
286-
StackPane.setAlignment(list, Pos.TOP_CENTER);
287-
spinnerPane.setContent(list);
280+
ScrollPane scrollPane = new ScrollPane(list);
281+
FXUtils.smoothScrolling(scrollPane);
282+
scrollPane.setFitToWidth(true);
283+
scrollPane.setFitToHeight(true);
284+
StackPane.setAlignment(scrollPane, Pos.TOP_CENTER);
285+
spinnerPane.setContent(scrollPane);
288286

289287
FXUtils.onChangeAndOperate(control.loaded, loaded -> {
290288
if (control.versions == null) return;
@@ -338,7 +336,7 @@ protected ModDownloadPageSkin(DownloadPage control) {
338336
});
339337
}
340338

341-
getChildren().setAll(scrollPane);
339+
getChildren().setAll(pane);
342340
}
343341
}
344342

0 commit comments

Comments
 (0)