From c2fabcdc352edb53ccda20822c3ba00654ac3f4a Mon Sep 17 00:00:00 2001 From: CiiLu <109708109+CiiLu@users.noreply.github.com> Date: Sun, 17 May 2026 21:03:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Glavo=20=E7=94=9F=E6=97=A5=E5=BF=AB?= =?UTF-8?q?=E4=B9=90=E5=96=B5=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmcl/ui/versions/GameListPopupMenu.java | 43 +++++++++---------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListPopupMenu.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListPopupMenu.java index 703ef2f97a5..2e25d7af64f 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListPopupMenu.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListPopupMenu.java @@ -31,7 +31,6 @@ import javafx.scene.control.ListCell; import javafx.scene.control.ListView; import javafx.scene.layout.BorderPane; -import javafx.scene.layout.HBox; import javafx.scene.layout.Region; import javafx.scene.layout.StackPane; import org.jackhuang.hmcl.game.Version; @@ -66,10 +65,11 @@ public GameListPopupMenu() { this.getStyleClass().add("popup-menu-content"); listView.setCellFactory(Cell::new); - listView.setFixedCellSize(60); + + listView.setFixedCellSize(50); listView.setPrefWidth(300); - listView.prefHeightProperty().bind(Bindings.size(getItems()).multiply(60).add(2)); + listView.prefHeightProperty().bind(Bindings.size(getItems()).multiply(50).add(2)); Label placeholder = new Label(i18n("version.empty")); placeholder.setStyle("-fx-padding: 10px; -fx-text-fill: -monet-on-surface-variant; -fx-font-style: italic;"); @@ -94,35 +94,34 @@ private static final class Cell extends ListCell { public Cell(ListView listView) { this.setPadding(Insets.EMPTY); - HBox root = new HBox(); - - root.setSpacing(8); - root.setAlignment(Pos.CENTER_LEFT); - - StackPane imageViewContainer = new StackPane(); - FXUtils.setLimitWidth(imageViewContainer, 32); - FXUtils.setLimitHeight(imageViewContainer, 32); this.imageView = new ImageContainer(32); - imageViewContainer.getChildren().setAll(imageView); + this.imageView.setMouseTransparent(true); + BorderPane.setAlignment(imageView, Pos.CENTER); this.content = new TwoLineListItem(); + this.content.setMouseTransparent(true); FXUtils.onChangeAndOperate(tag, tag -> { content.getTags().clear(); if (StringUtils.isNotBlank(tag)) { content.addTag(tag); } }); - BorderPane.setAlignment(content, Pos.CENTER); - root.getChildren().setAll(imageView, content); - StackPane pane = new StackPane(); - pane.getChildren().setAll(root); - pane.getStyleClass().add("menu-container"); - root.setMouseTransparent(true); + BorderPane container = new BorderPane(); + container.getStyleClass().add("container"); + container.setPickOnBounds(false); + container.setLeft(imageView); + container.setCenter(content); + + RipplerContainer ripplerContainer = new RipplerContainer(container); + ripplerContainer.maxWidthProperty().bind(listView.widthProperty().subtract(5)); + + StackPane rootPane = new StackPane(); + rootPane.getStyleClass().add("advanced-list-item"); + rootPane.getChildren().setAll(ripplerContainer); - RipplerContainer ripplerContainer = new RipplerContainer(pane); - FXUtils.onClicked(ripplerContainer, () -> { + FXUtils.onClicked(rootPane, () -> { GameItem item = getItem(); if (item != null) { item.getProfile().setSelectedVersion(item.getId()); @@ -130,8 +129,8 @@ public Cell(ListView listView) { popup.hide(); } }); - this.graphic = ripplerContainer; - ripplerContainer.maxWidthProperty().bind(listView.widthProperty().subtract(5)); + + this.graphic = rootPane; } @Override From f587cdd5ebcaa25db73ec77b594395bfbc9a7285 Mon Sep 17 00:00:00 2001 From: CiiLu <109708109+CiiLu@users.noreply.github.com> Date: Tue, 19 May 2026 21:58:41 +0800 Subject: [PATCH 2/2] qwq --- .../java/org/jackhuang/hmcl/ui/versions/GameListPopupMenu.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListPopupMenu.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListPopupMenu.java index 2e25d7af64f..767808887bd 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListPopupMenu.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListPopupMenu.java @@ -115,11 +115,11 @@ public Cell(ListView listView) { container.setCenter(content); RipplerContainer ripplerContainer = new RipplerContainer(container); - ripplerContainer.maxWidthProperty().bind(listView.widthProperty().subtract(5)); StackPane rootPane = new StackPane(); rootPane.getStyleClass().add("advanced-list-item"); rootPane.getChildren().setAll(ripplerContainer); + rootPane.maxWidthProperty().bind(listView.widthProperty().subtract(5)); FXUtils.onClicked(rootPane, () -> { GameItem item = getItem();