mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-09 11:55:52 -04:00
fix: 修复固定版本过多布局会乱
This commit is contained in:
parent
9f8f2567ba
commit
64d49d261d
@ -32,6 +32,7 @@ import javafx.geometry.Pos;
|
||||
import javafx.scene.Cursor;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.ScrollPane;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.input.MouseButton;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
@ -91,6 +92,7 @@ public final class MainPage extends StackPane implements DecoratorPage {
|
||||
|
||||
private TransitionPane announcementPane;
|
||||
private final VBox pinnedVersionsBox = new VBox(16);
|
||||
private final ScrollPane pinnedVersionsScroll = new ScrollPane(pinnedVersionsBox);
|
||||
private final StackPane updatePane;
|
||||
private final JFXButton menuButton;
|
||||
|
||||
@ -106,7 +108,9 @@ public final class MainPage extends StackPane implements DecoratorPage {
|
||||
|
||||
state.setValue(new State(null, titleNode, false, false, true));
|
||||
|
||||
setPadding(new Insets(20));
|
||||
pinnedVersionsScroll.setFitToWidth(true);
|
||||
FXUtils.smoothScrolling(pinnedVersionsScroll);
|
||||
pinnedVersionsBox.setPadding(new Insets(20, 20, 80, 20));
|
||||
|
||||
if (Metadata.isNightly() || (Metadata.isDev() && !Objects.equals(Metadata.VERSION, config().getShownTips().get(ANNOUNCEMENT)))) {
|
||||
String title;
|
||||
@ -278,9 +282,10 @@ public final class MainPage extends StackPane implements DecoratorPage {
|
||||
menuButton.addEventHandler(MouseEvent.MOUSE_CLICKED, secondaryClickHandle);
|
||||
|
||||
launchPane.getChildren().setAll(launchButton, separator, menuButton);
|
||||
StackPane.setMargin(launchPane, new Insets(20));
|
||||
}
|
||||
|
||||
getChildren().addAll(pinnedVersionsBox, updatePane, launchPane);
|
||||
getChildren().addAll(pinnedVersionsScroll, updatePane, launchPane);
|
||||
|
||||
menu.setMaxHeight(365);
|
||||
menu.setMaxWidth(545);
|
||||
@ -299,8 +304,8 @@ public final class MainPage extends StackPane implements DecoratorPage {
|
||||
VBox card = new VBox();
|
||||
card.getStyleClass().add("card");
|
||||
card.setSpacing(16);
|
||||
card.setMinHeight(100);
|
||||
card.setMinWidth(100);
|
||||
card.setPrefHeight(100);
|
||||
card.setPrefWidth(100);
|
||||
card.alignmentProperty().set(Pos.CENTER);
|
||||
card.setCursor(Cursor.HAND);
|
||||
ImageView image = new ImageView(profile.getRepository().getVersionIconImage(versionName));
|
||||
|
Loading…
x
Reference in New Issue
Block a user