From 68fc2d7cd99a04b008b5796455fdc812c9ee2248 Mon Sep 17 00:00:00 2001 From: Glavo Date: Sun, 30 Nov 2025 21:23:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E9=A2=9C=E8=89=B2=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#4887)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jackhuang/hmcl/setting/StyleSheets.java | 2 +- .../jackhuang/hmcl/ui/GameCrashWindow.java | 5 +- .../ui/construct/TaskExecutorDialogPane.java | 1 + HMCL/src/main/resources/assets/css/root.css | 46 +++++++++++-------- 4 files changed, 33 insertions(+), 21 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/setting/StyleSheets.java b/HMCL/src/main/java/org/jackhuang/hmcl/setting/StyleSheets.java index 69765f48d..57f37a915 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/setting/StyleSheets.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/setting/StyleSheets.java @@ -142,7 +142,7 @@ public final class StyleSheets { } private static void addColor(StringBuilder builder, ColorScheme scheme, ColorRole role, double opacity) { - builder.append(" ").append(role.getVariableName()).append("-transparent-").append((int) (100 * opacity)) + builder.append(" ").append(role.getVariableName()).append("-transparent-%02d".formatted((int) (100 * opacity))) .append(": ").append(ThemeColor.getColorDisplayNameWithOpacity(scheme.getColor(role), opacity)) .append(";\n"); } diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/GameCrashWindow.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/GameCrashWindow.java index 86d966256..2ffec1691 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/GameCrashWindow.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/GameCrashWindow.java @@ -292,7 +292,7 @@ public class GameCrashWindow extends Stage { private final class View extends VBox { View() { - setStyle("-fx-background-color: white"); + this.getStyleClass().add("game-crash-window"); HBox titlePane = new HBox(); { @@ -395,6 +395,7 @@ public class GameCrashWindow extends Stage { reasonTitle.getStyleClass().add("two-line-item-second-large-title"); ScrollPane reasonPane = new ScrollPane(reasonTextFlow); + reasonTextFlow.getStyleClass().add("crash-reason-text-flow"); reasonPane.setFitToWidth(true); reasonPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); reasonPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED); @@ -411,6 +412,7 @@ public class GameCrashWindow extends Stage { } HBox toolBar = new HBox(); + VBox.setMargin(toolBar, new Insets(0, 0, 4, 0)); { JFXButton exportGameCrashInfoButton = FXUtils.newRaisedButton(i18n("logwindow.export_game_crash_logs")); exportGameCrashInfoButton.setOnAction(e -> exportGameCrashInfo()); @@ -422,7 +424,6 @@ public class GameCrashWindow extends Stage { helpButton.setOnAction(e -> FXUtils.openLink(Metadata.CONTACT_URL)); FXUtils.installFastTooltip(helpButton, i18n("logwindow.help")); - toolBar.setPadding(new Insets(8)); toolBar.setSpacing(8); toolBar.getStyleClass().add("jfx-tool-bar"); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java index 32581f9f1..cf4bd06c7 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java @@ -76,6 +76,7 @@ public class TaskExecutorDialogPane extends BorderPane { bottom.setLeft(lblProgress); btnCancel = new JFXButton(i18n("button.cancel")); + btnCancel.getStyleClass().add("dialog-cancel"); bottom.setRight(btnCancel); } diff --git a/HMCL/src/main/resources/assets/css/root.css b/HMCL/src/main/resources/assets/css/root.css index aa3a9823d..804fd9463 100644 --- a/HMCL/src/main/resources/assets/css/root.css +++ b/HMCL/src/main/resources/assets/css/root.css @@ -16,10 +16,7 @@ * along with this program. If not, see . */ -/* TODO: Monet */ .root { - -fx-base-check-color: derive(-monet-primary-container, 30%); - -fx-base-text-fill: -monet-on-primary-container; } .svg { @@ -156,10 +153,6 @@ -jfx-rippler-fill: #a2a2a2; } -.rippler-container:selected .label { - -fx-text-fill: -fx-base-text-fill; -} - .advanced-list-item > .rippler-container > .container { -fx-padding: 10 16 10 16; -fx-background-color: null; @@ -317,16 +310,28 @@ } .two-line-item-second-large > .first-line > .title, .two-line-item-second-large-title { - -fx-text-fill: rgba(0, 0, 0, 0.5); + -fx-text-fill: -monet-on-surface-variant; -fx-font-weight: normal; -fx-font-size: 12px; } .two-line-item-second-large > HBox > .subtitle { - -fx-text-fill: #292929; + -fx-text-fill: -monet-on-surface; -fx-font-size: 15px; } +.game-crash-window { + -fx-background-color: -monet-surface-container; +} + +.game-crash-window .crash-reason-text-flow Text { + -fx-fill: -monet-on-surface; +} + +.game-crash-window .crash-reason-text-flow .hyperlink { + -fx-fill: #0070E0; +} + .wrap-text > HBox > .subtitle { -fx-wrap-text: true; } @@ -395,6 +400,10 @@ -fx-font-size: 14px; } +.launch-pane .svg { + -fx-fill: -monet-on-primary-container; +} + .launch-pane > Rectangle { -fx-fill: -monet-primary-container; } @@ -417,15 +426,16 @@ ******************************************************************************/ .tab-header-background { - -fx-background-color: -fx-base-check-color; + -fx-background-color: -monet-surface; } .tab-selected-line { -fx-background-color: derive(-monet-primary-container, -30%); } +/* TODO: It seems not actually used */ .tab-rippler { - -jfx-rippler-fill: -fx-base-check-color; + -jfx-rippler-fill: derive(-monet-primary-container, 30%); } .jfx-tab-pane .jfx-rippler { @@ -585,7 +595,7 @@ } .jfx-tool-bar .jfx-decorator-button .svg { - -fx-fill: -fx-base-text-fill; + -fx-fill: -monet-on-primary-container; } .jfx-tool-bar Label { @@ -611,13 +621,13 @@ .jfx-tool-bar-second { -fx-pref-height: 42; -fx-padding: 2 2 2 2; - -fx-background-color: -fx-base-check-color; + -fx-background-color: -monet-primary-container; -fx-alignment: CENTER-LEFT; -fx-spacing: 8; } .jfx-tool-bar-second .label { - -fx-text-fill: -fx-base-text-fill; + -fx-text-fill: -monet-on-primary-container; -fx-font-size: 16; -fx-font-weight: bold; } @@ -851,7 +861,7 @@ /*.list-cell:odd:selected > .jfx-rippler > StackPane,*/ /*.list-cell:even:selected > .jfx-rippler > StackPane {*/ -/* -fx-background-color: derive(-fx-base-check-color, 30%);*/ +/* -fx-background-color: derive(-monet-primary, 30%);*/ /*}*/ .jfx-list-view { @@ -1143,7 +1153,7 @@ -fx-min-height: -fx-toggle-icon-tiny-size; -fx-background-radius: 25px; -fx-background-color: transparent; - -jfx-toggle-color: -fx-base-check-color; + -jfx-toggle-color: -monet-primary; -jfx-untoggle-color: transparent; } @@ -1153,7 +1163,7 @@ } .toggle-icon-tiny .jfx-rippler { - -jfx-rippler-fill: -fx-base-check-color; + -jfx-rippler-fill: -monet-primary; -jfx-mask-type: CIRCLE; } @@ -1170,7 +1180,7 @@ } .announcement-close-button .jfx-rippler { - -jfx-rippler-fill: -fx-base-check-color; + -jfx-rippler-fill: -monet-primary; -jfx-mask-type: CIRCLE; }