Skip to content

Commit f9dd7a1

Browse files
authored
修复 InstallersPage 意外地显示滚动条的问题 (#4097)
This reverts commit c669026.
1 parent cbb83d4 commit f9dd7a1

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

HMCL/src/main/java/org/jackhuang/hmcl/ui/download/AbstractInstallersPage.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,19 @@ protected InstallersPageSkin(AbstractInstallersPage control) {
121121
InstallerItem[] libraries = control.group.getLibraries();
122122

123123
FlowPane libraryPane = new FlowPane(libraries);
124-
libraryPane.setVgap(8);
124+
libraryPane.setVgap(16);
125125
libraryPane.setHgap(16);
126126

127-
ScrollPane scrollPane = new ScrollPane(libraryPane);
128-
scrollPane.setFitToWidth(true);
129-
scrollPane.setFitToHeight(true);
130-
BorderPane.setMargin(scrollPane, new Insets(16, 0, 16, 0));
131-
root.setCenter(scrollPane);
127+
if (libraries.length <= 8) {
128+
BorderPane.setMargin(libraryPane, new Insets(16, 0, 16, 0));
129+
root.setCenter(libraryPane);
130+
} else {
131+
ScrollPane scrollPane = new ScrollPane(libraryPane);
132+
scrollPane.setFitToWidth(true);
133+
scrollPane.setFitToHeight(true);
134+
BorderPane.setMargin(scrollPane, new Insets(16, 0, 16, 0));
135+
root.setCenter(scrollPane);
136+
}
132137
}
133138

134139
{

0 commit comments

Comments
 (0)