From b5ba6f510254e760ff3a75e4dc701e87f29b743a Mon Sep 17 00:00:00 2001 From: neveler <55753029+neveler@users.noreply.github.com> Date: Sat, 27 Dec 2025 16:54:17 +0800 Subject: [PATCH 1/8] update --- HMCL/src/main/resources/assets/css/root.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HMCL/src/main/resources/assets/css/root.css b/HMCL/src/main/resources/assets/css/root.css index ac93303b39..6b75e39433 100644 --- a/HMCL/src/main/resources/assets/css/root.css +++ b/HMCL/src/main/resources/assets/css/root.css @@ -442,7 +442,7 @@ } .launch-pane > Rectangle { - -fx-fill: -monet-primary-container; + -fx-fill: -monet-on-surface-variant; } /******************************************************************************* From 79a95bf932a10642812ff2e53bf6a16a404c8cc9 Mon Sep 17 00:00:00 2001 From: neveler <55753029+neveler@users.noreply.github.com> Date: Sat, 27 Dec 2025 21:09:15 +0800 Subject: [PATCH 2/8] update --- .../org/jackhuang/hmcl/ui/main/MainPage.java | 141 +++++++++--------- 1 file changed, 71 insertions(+), 70 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java index da386dd5fb..d7f69b57f9 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java @@ -208,90 +208,91 @@ public final class MainPage extends StackPane implements DecoratorPage { } StackPane launchPane = new StackPane(); - launchPane.getStyleClass().add("launch-pane"); launchPane.setMaxWidth(230); launchPane.setMaxHeight(55); FXUtils.onScroll(launchPane, versions, list -> { String currentId = getCurrentGame(); return Lang.indexWhere(list, instance -> instance.getId().equals(currentId)); }, it -> profile.setSelectedVersion(it.getId())); - StackPane.setAlignment(launchPane, Pos.BOTTOM_RIGHT); + { - JFXButton launchButton = new JFXButton(); - launchButton.setPrefWidth(230); - launchButton.setPrefHeight(55); - //launchButton.setButtonType(JFXButton.ButtonType.RAISED); - launchButton.setDefaultButton(true); - launchButton.setClip(new Rectangle(-100, -100, 310, 200)); + HBox hBox = new HBox(); + hBox.getStyleClass().add("launch-pane"); + hBox.setMaxWidth(230); + hBox.setMaxHeight(55); + { - VBox graphic = new VBox(); - graphic.setAlignment(Pos.CENTER); - graphic.setTranslateX(-7); - graphic.setMaxWidth(200); - Label launchLabel = new Label(); - launchLabel.setStyle("-fx-font-size: 16px;"); - Label currentLabel = new Label(); - currentLabel.setStyle("-fx-font-size: 12px;"); - - FXUtils.onChangeAndOperate(currentGameProperty(), new Consumer<>() { - private Tooltip tooltip; - - @Override - public void accept(String currentGame) { - if (currentGame == null) { - launchLabel.setText(i18n("version.launch.empty")); - currentLabel.setText(null); - graphic.getChildren().setAll(launchLabel); - launchButton.setOnAction(e -> MainPage.this.launchNoGame()); - if (tooltip == null) - tooltip = new Tooltip(i18n("version.launch.empty.tooltip")); - FXUtils.installFastTooltip(launchButton, tooltip); - } else { - launchLabel.setText(i18n("version.launch")); - currentLabel.setText(currentGame); - graphic.getChildren().setAll(launchLabel, currentLabel); - launchButton.setOnAction(e -> MainPage.this.launch()); - if (tooltip != null) - Tooltip.uninstall(launchButton, tooltip); + JFXButton launchButton = new JFXButton(); + launchButton.setMaxWidth(208); + launchButton.setPrefHeight(55); + launchButton.setStyle("-fx-background-radius: 4px 0 0 4px"); + launchButton.setDefaultButton(true); + { + VBox graphic = new VBox(); + graphic.setAlignment(Pos.CENTER); + graphic.setMaxWidth(208); + graphic.setMinWidth(208); + Label launchLabel = new Label(); + launchLabel.setStyle("-fx-font-size: 16px;"); + Label currentLabel = new Label(); + currentLabel.setStyle("-fx-font-size: 12px;"); + + FXUtils.onChangeAndOperate(currentGameProperty(), new Consumer<>() { + private Tooltip tooltip; + + @Override + public void accept(String currentGame) { + if (currentGame == null) { + launchLabel.setText(i18n("version.launch.empty")); + currentLabel.setText(null); + graphic.getChildren().setAll(launchLabel); + launchButton.setOnAction(e -> MainPage.this.launchNoGame()); + if (tooltip == null) + tooltip = new Tooltip(i18n("version.launch.empty.tooltip")); + FXUtils.installFastTooltip(launchButton, tooltip); + } else { + launchLabel.setText(i18n("version.launch")); + currentLabel.setText(currentGame); + graphic.getChildren().setAll(launchLabel, currentLabel); + launchButton.setOnAction(e -> MainPage.this.launch()); + if (tooltip != null) + Tooltip.uninstall(launchButton, tooltip); + } } + }); + + launchButton.setGraphic(graphic); + } + + Rectangle separator = new Rectangle(); + separator.setWidth(2); + separator.setHeight(57); + separator.setTranslateY(-1); + separator.setMouseTransparent(true); + + menuButton = new JFXButton(); + menuButton.setPrefHeight(55); + menuButton.setStyle("-fx-background-radius: 0 4px 4px 0"); + menuButton.setMaxWidth(20); + menuButton.setMinWidth(20); + menuButton.setOnAction(e -> onMenu()); + FXUtils.installFastTooltip(menuButton, i18n("version.switch")); + menuButton.setGraphic(SVG.ARROW_DROP_UP.createIcon(30)); + + EventHandler secondaryClickHandle = event -> { + if (event.getButton() == MouseButton.SECONDARY && event.getClickCount() == 1) { + menuButton.fire(); + event.consume(); } - }); + }; + launchButton.addEventHandler(MouseEvent.MOUSE_CLICKED, secondaryClickHandle); + menuButton.addEventHandler(MouseEvent.MOUSE_CLICKED, secondaryClickHandle); - launchButton.setGraphic(graphic); + hBox.getChildren().setAll(launchButton, separator, menuButton); } - Rectangle separator = new Rectangle(); - separator.setWidth(1); - separator.setHeight(57); - separator.setTranslateX(95); - separator.setMouseTransparent(true); - - menuButton = new JFXButton(); - menuButton.setPrefHeight(55); - menuButton.setPrefWidth(230); - //menuButton.setButtonType(JFXButton.ButtonType.RAISED); - menuButton.setStyle("-fx-font-size: 15px;"); - menuButton.setOnAction(e -> onMenu()); - menuButton.setClip(new Rectangle(211, -100, 100, 200)); - StackPane graphic = new StackPane(); - Node svg = SVG.ARROW_DROP_UP.createIcon(30); - StackPane.setAlignment(svg, Pos.CENTER_RIGHT); - graphic.getChildren().setAll(svg); - graphic.setTranslateX(6); - FXUtils.installFastTooltip(menuButton, i18n("version.switch")); - menuButton.setGraphic(graphic); - - EventHandler secondaryClickHandle = event -> { - if (event.getButton() == MouseButton.SECONDARY && event.getClickCount() == 1) { - menuButton.fire(); - event.consume(); - } - }; - launchButton.addEventHandler(MouseEvent.MOUSE_CLICKED, secondaryClickHandle); - menuButton.addEventHandler(MouseEvent.MOUSE_CLICKED, secondaryClickHandle); - - launchPane.getChildren().setAll(launchButton, separator, menuButton); + launchPane.getChildren().setAll(hBox); } getChildren().addAll(updatePane, launchPane); From 7f2ddfc7485669be7e34bf546a3b8fb7f11b0cd6 Mon Sep 17 00:00:00 2001 From: neveler <55753029+neveler@users.noreply.github.com> Date: Mon, 29 Dec 2025 12:42:29 +0800 Subject: [PATCH 3/8] update --- .../org/jackhuang/hmcl/ui/main/MainPage.java | 127 ++++++++---------- HMCL/src/main/resources/assets/css/root.css | 34 ++++- 2 files changed, 81 insertions(+), 80 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java index d7f69b57f9..bd0f365ce3 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java @@ -207,92 +207,71 @@ public final class MainPage extends StackPane implements DecoratorPage { updatePane.getChildren().setAll(hBox, closeUpdateButton); } - StackPane launchPane = new StackPane(); - launchPane.setMaxWidth(230); - launchPane.setMaxHeight(55); + HBox launchPane = new HBox(); + launchPane.getStyleClass().add("launch-pane"); FXUtils.onScroll(launchPane, versions, list -> { String currentId = getCurrentGame(); return Lang.indexWhere(list, instance -> instance.getId().equals(currentId)); }, it -> profile.setSelectedVersion(it.getId())); - StackPane.setAlignment(launchPane, Pos.BOTTOM_RIGHT); + StackPane.setAlignment(launchPane, Pos.BOTTOM_RIGHT); { - HBox hBox = new HBox(); - hBox.getStyleClass().add("launch-pane"); - hBox.setMaxWidth(230); - hBox.setMaxHeight(55); - + JFXButton launchButton = new JFXButton(); + launchButton.getStyleClass().add("launch-button"); + launchButton.setDefaultButton(true); { - JFXButton launchButton = new JFXButton(); - launchButton.setMaxWidth(208); - launchButton.setPrefHeight(55); - launchButton.setStyle("-fx-background-radius: 4px 0 0 4px"); - launchButton.setDefaultButton(true); - { - VBox graphic = new VBox(); - graphic.setAlignment(Pos.CENTER); - graphic.setMaxWidth(208); - graphic.setMinWidth(208); - Label launchLabel = new Label(); - launchLabel.setStyle("-fx-font-size: 16px;"); - Label currentLabel = new Label(); - currentLabel.setStyle("-fx-font-size: 12px;"); - - FXUtils.onChangeAndOperate(currentGameProperty(), new Consumer<>() { - private Tooltip tooltip; - - @Override - public void accept(String currentGame) { - if (currentGame == null) { - launchLabel.setText(i18n("version.launch.empty")); - currentLabel.setText(null); - graphic.getChildren().setAll(launchLabel); - launchButton.setOnAction(e -> MainPage.this.launchNoGame()); - if (tooltip == null) - tooltip = new Tooltip(i18n("version.launch.empty.tooltip")); - FXUtils.installFastTooltip(launchButton, tooltip); - } else { - launchLabel.setText(i18n("version.launch")); - currentLabel.setText(currentGame); - graphic.getChildren().setAll(launchLabel, currentLabel); - launchButton.setOnAction(e -> MainPage.this.launch()); - if (tooltip != null) - Tooltip.uninstall(launchButton, tooltip); - } + VBox graphic = new VBox(); + graphic.setAlignment(Pos.CENTER); + Label launchLabel = new Label(); + launchLabel.setStyle("-fx-font-size: 16px;"); + Label currentLabel = new Label(); + currentLabel.setStyle("-fx-font-size: 12px;"); + + FXUtils.onChangeAndOperate(currentGameProperty(), new Consumer<>() { + private Tooltip tooltip; + + @Override + public void accept(String currentGame) { + if (currentGame == null) { + launchLabel.setText(i18n("version.launch.empty")); + currentLabel.setText(null); + graphic.getChildren().setAll(launchLabel); + launchButton.setOnAction(e -> MainPage.this.launchNoGame()); + if (tooltip == null) + tooltip = new Tooltip(i18n("version.launch.empty.tooltip")); + FXUtils.installFastTooltip(launchButton, tooltip); + } else { + launchLabel.setText(i18n("version.launch")); + currentLabel.setText(currentGame); + graphic.getChildren().setAll(launchLabel, currentLabel); + launchButton.setOnAction(e -> MainPage.this.launch()); + if (tooltip != null) + Tooltip.uninstall(launchButton, tooltip); } - }); - - launchButton.setGraphic(graphic); - } - - Rectangle separator = new Rectangle(); - separator.setWidth(2); - separator.setHeight(57); - separator.setTranslateY(-1); - separator.setMouseTransparent(true); - - menuButton = new JFXButton(); - menuButton.setPrefHeight(55); - menuButton.setStyle("-fx-background-radius: 0 4px 4px 0"); - menuButton.setMaxWidth(20); - menuButton.setMinWidth(20); - menuButton.setOnAction(e -> onMenu()); - FXUtils.installFastTooltip(menuButton, i18n("version.switch")); - menuButton.setGraphic(SVG.ARROW_DROP_UP.createIcon(30)); - - EventHandler secondaryClickHandle = event -> { - if (event.getButton() == MouseButton.SECONDARY && event.getClickCount() == 1) { - menuButton.fire(); - event.consume(); } - }; - launchButton.addEventHandler(MouseEvent.MOUSE_CLICKED, secondaryClickHandle); - menuButton.addEventHandler(MouseEvent.MOUSE_CLICKED, secondaryClickHandle); + }); - hBox.getChildren().setAll(launchButton, separator, menuButton); + launchButton.setGraphic(graphic); } - launchPane.getChildren().setAll(hBox); + menuButton = new JFXButton(); + menuButton.getStyleClass().add("menu-button"); + menuButton.setOnAction(e -> onMenu()); + Node svg = SVG.ARROW_DROP_UP.createIcon(30); + StackPane.setAlignment(svg, Pos.CENTER_RIGHT); + FXUtils.installFastTooltip(menuButton, i18n("version.switch")); + menuButton.setGraphic(svg); + + EventHandler secondaryClickHandle = event -> { + if (event.getButton() == MouseButton.SECONDARY && event.getClickCount() == 1) { + menuButton.fire(); + event.consume(); + } + }; + launchButton.addEventHandler(MouseEvent.MOUSE_CLICKED, secondaryClickHandle); + menuButton.addEventHandler(MouseEvent.MOUSE_CLICKED, secondaryClickHandle); + + launchPane.getChildren().setAll(launchButton, menuButton); } getChildren().addAll(updatePane, launchPane); diff --git a/HMCL/src/main/resources/assets/css/root.css b/HMCL/src/main/resources/assets/css/root.css index 6b75e39433..52acc1934f 100644 --- a/HMCL/src/main/resources/assets/css/root.css +++ b/HMCL/src/main/resources/assets/css/root.css @@ -421,18 +421,44 @@ * * ******************************************************************************/ +.launch-pane { + -fx-spacing: 4px; + -fx-max-height: 55px; + -fx-min-height: 55px; + -fx-max-width: 230px; + -fx-min-width: 230px; + -fx-background-color: -monet-on-surface-variant; +} + .launch-pane > .jfx-button { + -fx-translate-y: 1px; + -fx-max-height: 53px; + -fx-min-height: 53px; -fx-background-color: -monet-primary-container; -fx-cursor: hand; } +.launch-pane > .jfx-button.launch-button { + -fx-max-width: 206px; + -fx-min-width: 206px; + -fx-background-radius: 2px 0 0 2px; +} + +.launch-pane > .jfx-button.menu-button { + -fx-max-width: 20px; + -fx-min-width: 20px; + -fx-font-size: 15px; + -fx-background-radius: 0 2px 2px 0; +} + .launch-pane > .jfx-button > StackPane > .jfx-rippler { -jfx-rippler-fill: -monet-on-primary-container; -jfx-mask-type: CIRCLE; - -fx-padding: 0.0; + -fx-padding: 0; } -.launch-pane > .jfx-button, .jfx-button * { +.launch-pane > .jfx-button, +.launch-pane > .jfx-button * { -fx-text-fill: -monet-on-primary-container; -fx-font-size: 14px; } @@ -441,10 +467,6 @@ -fx-fill: -monet-on-primary-container; } -.launch-pane > Rectangle { - -fx-fill: -monet-on-surface-variant; -} - /******************************************************************************* * * * JFX Tab Pane * From 80505fa7ec949230a4e2a8d9ccbbfc51868a0798 Mon Sep 17 00:00:00 2001 From: neveler <55753029+neveler@users.noreply.github.com> Date: Mon, 29 Dec 2025 12:49:13 +0800 Subject: [PATCH 4/8] update --- HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java | 1 - 1 file changed, 1 deletion(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java index bd0f365ce3..783d96c1b5 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java @@ -39,7 +39,6 @@ import javafx.scene.layout.HBox; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; -import javafx.scene.shape.Rectangle; import javafx.scene.text.TextFlow; import javafx.util.Duration; import org.jackhuang.hmcl.Metadata; From 8d9f6156ffcf2ca235e8e45070d238979ba5efbf Mon Sep 17 00:00:00 2001 From: neveler <55753029+neveler@users.noreply.github.com> Date: Mon, 29 Dec 2025 12:55:57 +0800 Subject: [PATCH 5/8] update --- HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java index 783d96c1b5..e7d7ec7f3f 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java @@ -256,10 +256,8 @@ public void accept(String currentGame) { menuButton = new JFXButton(); menuButton.getStyleClass().add("menu-button"); menuButton.setOnAction(e -> onMenu()); - Node svg = SVG.ARROW_DROP_UP.createIcon(30); - StackPane.setAlignment(svg, Pos.CENTER_RIGHT); FXUtils.installFastTooltip(menuButton, i18n("version.switch")); - menuButton.setGraphic(svg); + menuButton.setGraphic(SVG.ARROW_DROP_UP.createIcon(30)); EventHandler secondaryClickHandle = event -> { if (event.getButton() == MouseButton.SECONDARY && event.getClickCount() == 1) { From cb6b46850e8fd8db9d6597c512966b04b5003233 Mon Sep 17 00:00:00 2001 From: neveler <55753029+neveler@users.noreply.github.com> Date: Wed, 31 Dec 2025 15:33:58 +0800 Subject: [PATCH 6/8] update --- HMCL/src/main/resources/assets/css/root.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HMCL/src/main/resources/assets/css/root.css b/HMCL/src/main/resources/assets/css/root.css index 52acc1934f..9f5e559312 100644 --- a/HMCL/src/main/resources/assets/css/root.css +++ b/HMCL/src/main/resources/assets/css/root.css @@ -422,7 +422,7 @@ ******************************************************************************/ .launch-pane { - -fx-spacing: 4px; + -fx-spacing: 3px; -fx-max-height: 55px; -fx-min-height: 55px; -fx-max-width: 230px; From 312be86f5dab6900dd70dff2f7ef68d443f074a5 Mon Sep 17 00:00:00 2001 From: neveler <55753029+neveler@users.noreply.github.com> Date: Wed, 31 Dec 2025 15:42:55 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HMCL/src/main/resources/assets/css/root.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HMCL/src/main/resources/assets/css/root.css b/HMCL/src/main/resources/assets/css/root.css index 9f5e559312..8bd0f7021a 100644 --- a/HMCL/src/main/resources/assets/css/root.css +++ b/HMCL/src/main/resources/assets/css/root.css @@ -439,8 +439,8 @@ } .launch-pane > .jfx-button.launch-button { - -fx-max-width: 206px; - -fx-min-width: 206px; + -fx-max-width: 207px; + -fx-min-width: 207px; -fx-background-radius: 2px 0 0 2px; } From 83ca893a3aa41bc6e41c75cc51e7975c45ec4a1e Mon Sep 17 00:00:00 2001 From: neveler <55753029+neveler@users.noreply.github.com> Date: Thu, 1 Jan 2026 21:04:34 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E5=BE=AE=E8=B0=83=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HMCL/src/main/resources/assets/css/root.css | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/HMCL/src/main/resources/assets/css/root.css b/HMCL/src/main/resources/assets/css/root.css index 8bd0f7021a..139970bf83 100644 --- a/HMCL/src/main/resources/assets/css/root.css +++ b/HMCL/src/main/resources/assets/css/root.css @@ -422,18 +422,16 @@ ******************************************************************************/ .launch-pane { - -fx-spacing: 3px; - -fx-max-height: 55px; - -fx-min-height: 55px; + -fx-max-height: 57px; + -fx-min-height: 57px; -fx-max-width: 230px; -fx-min-width: 230px; - -fx-background-color: -monet-on-surface-variant; } .launch-pane > .jfx-button { -fx-translate-y: 1px; - -fx-max-height: 53px; - -fx-min-height: 53px; + -fx-max-height: 55px; + -fx-min-height: 55px; -fx-background-color: -monet-primary-container; -fx-cursor: hand; } @@ -441,14 +439,16 @@ .launch-pane > .jfx-button.launch-button { -fx-max-width: 207px; -fx-min-width: 207px; - -fx-background-radius: 2px 0 0 2px; + -fx-border-width: 0 3px 0 0; + -fx-border-color: -monet-on-surface-variant; + -fx-background-radius: 4px 0 0 4px; } .launch-pane > .jfx-button.menu-button { -fx-max-width: 20px; -fx-min-width: 20px; -fx-font-size: 15px; - -fx-background-radius: 0 2px 2px 0; + -fx-background-radius: 0 4px 4px 0; } .launch-pane > .jfx-button > StackPane > .jfx-rippler {