修复部分控件颜色错误的问题 (#4887)

This commit is contained in:
Glavo
2025-11-30 21:23:39 +08:00
committed by GitHub
parent cda45db222
commit 68fc2d7cd9
4 changed files with 33 additions and 21 deletions

View File

@@ -142,7 +142,7 @@ public final class StyleSheets {
} }
private static void addColor(StringBuilder builder, ColorScheme scheme, ColorRole role, double opacity) { 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(": ").append(ThemeColor.getColorDisplayNameWithOpacity(scheme.getColor(role), opacity))
.append(";\n"); .append(";\n");
} }

View File

@@ -292,7 +292,7 @@ public class GameCrashWindow extends Stage {
private final class View extends VBox { private final class View extends VBox {
View() { View() {
setStyle("-fx-background-color: white"); this.getStyleClass().add("game-crash-window");
HBox titlePane = new HBox(); HBox titlePane = new HBox();
{ {
@@ -395,6 +395,7 @@ public class GameCrashWindow extends Stage {
reasonTitle.getStyleClass().add("two-line-item-second-large-title"); reasonTitle.getStyleClass().add("two-line-item-second-large-title");
ScrollPane reasonPane = new ScrollPane(reasonTextFlow); ScrollPane reasonPane = new ScrollPane(reasonTextFlow);
reasonTextFlow.getStyleClass().add("crash-reason-text-flow");
reasonPane.setFitToWidth(true); reasonPane.setFitToWidth(true);
reasonPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); reasonPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
reasonPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED); reasonPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
@@ -411,6 +412,7 @@ public class GameCrashWindow extends Stage {
} }
HBox toolBar = new HBox(); HBox toolBar = new HBox();
VBox.setMargin(toolBar, new Insets(0, 0, 4, 0));
{ {
JFXButton exportGameCrashInfoButton = FXUtils.newRaisedButton(i18n("logwindow.export_game_crash_logs")); JFXButton exportGameCrashInfoButton = FXUtils.newRaisedButton(i18n("logwindow.export_game_crash_logs"));
exportGameCrashInfoButton.setOnAction(e -> exportGameCrashInfo()); exportGameCrashInfoButton.setOnAction(e -> exportGameCrashInfo());
@@ -422,7 +424,6 @@ public class GameCrashWindow extends Stage {
helpButton.setOnAction(e -> FXUtils.openLink(Metadata.CONTACT_URL)); helpButton.setOnAction(e -> FXUtils.openLink(Metadata.CONTACT_URL));
FXUtils.installFastTooltip(helpButton, i18n("logwindow.help")); FXUtils.installFastTooltip(helpButton, i18n("logwindow.help"));
toolBar.setPadding(new Insets(8)); toolBar.setPadding(new Insets(8));
toolBar.setSpacing(8); toolBar.setSpacing(8);
toolBar.getStyleClass().add("jfx-tool-bar"); toolBar.getStyleClass().add("jfx-tool-bar");

View File

@@ -76,6 +76,7 @@ public class TaskExecutorDialogPane extends BorderPane {
bottom.setLeft(lblProgress); bottom.setLeft(lblProgress);
btnCancel = new JFXButton(i18n("button.cancel")); btnCancel = new JFXButton(i18n("button.cancel"));
btnCancel.getStyleClass().add("dialog-cancel");
bottom.setRight(btnCancel); bottom.setRight(btnCancel);
} }

View File

@@ -16,10 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/* TODO: Monet */
.root { .root {
-fx-base-check-color: derive(-monet-primary-container, 30%);
-fx-base-text-fill: -monet-on-primary-container;
} }
.svg { .svg {
@@ -156,10 +153,6 @@
-jfx-rippler-fill: #a2a2a2; -jfx-rippler-fill: #a2a2a2;
} }
.rippler-container:selected .label {
-fx-text-fill: -fx-base-text-fill;
}
.advanced-list-item > .rippler-container > .container { .advanced-list-item > .rippler-container > .container {
-fx-padding: 10 16 10 16; -fx-padding: 10 16 10 16;
-fx-background-color: null; -fx-background-color: null;
@@ -317,16 +310,28 @@
} }
.two-line-item-second-large > .first-line > .title, .two-line-item-second-large-title { .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-weight: normal;
-fx-font-size: 12px; -fx-font-size: 12px;
} }
.two-line-item-second-large > HBox > .subtitle { .two-line-item-second-large > HBox > .subtitle {
-fx-text-fill: #292929; -fx-text-fill: -monet-on-surface;
-fx-font-size: 15px; -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 { .wrap-text > HBox > .subtitle {
-fx-wrap-text: true; -fx-wrap-text: true;
} }
@@ -395,6 +400,10 @@
-fx-font-size: 14px; -fx-font-size: 14px;
} }
.launch-pane .svg {
-fx-fill: -monet-on-primary-container;
}
.launch-pane > Rectangle { .launch-pane > Rectangle {
-fx-fill: -monet-primary-container; -fx-fill: -monet-primary-container;
} }
@@ -417,15 +426,16 @@
******************************************************************************/ ******************************************************************************/
.tab-header-background { .tab-header-background {
-fx-background-color: -fx-base-check-color; -fx-background-color: -monet-surface;
} }
.tab-selected-line { .tab-selected-line {
-fx-background-color: derive(-monet-primary-container, -30%); -fx-background-color: derive(-monet-primary-container, -30%);
} }
/* TODO: It seems not actually used */
.tab-rippler { .tab-rippler {
-jfx-rippler-fill: -fx-base-check-color; -jfx-rippler-fill: derive(-monet-primary-container, 30%);
} }
.jfx-tab-pane .jfx-rippler { .jfx-tab-pane .jfx-rippler {
@@ -585,7 +595,7 @@
} }
.jfx-tool-bar .jfx-decorator-button .svg { .jfx-tool-bar .jfx-decorator-button .svg {
-fx-fill: -fx-base-text-fill; -fx-fill: -monet-on-primary-container;
} }
.jfx-tool-bar Label { .jfx-tool-bar Label {
@@ -611,13 +621,13 @@
.jfx-tool-bar-second { .jfx-tool-bar-second {
-fx-pref-height: 42; -fx-pref-height: 42;
-fx-padding: 2 2 2 2; -fx-padding: 2 2 2 2;
-fx-background-color: -fx-base-check-color; -fx-background-color: -monet-primary-container;
-fx-alignment: CENTER-LEFT; -fx-alignment: CENTER-LEFT;
-fx-spacing: 8; -fx-spacing: 8;
} }
.jfx-tool-bar-second .label { .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-size: 16;
-fx-font-weight: bold; -fx-font-weight: bold;
} }
@@ -851,7 +861,7 @@
/*.list-cell:odd:selected > .jfx-rippler > StackPane,*/ /*.list-cell:odd:selected > .jfx-rippler > StackPane,*/
/*.list-cell:even: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 { .jfx-list-view {
@@ -1143,7 +1153,7 @@
-fx-min-height: -fx-toggle-icon-tiny-size; -fx-min-height: -fx-toggle-icon-tiny-size;
-fx-background-radius: 25px; -fx-background-radius: 25px;
-fx-background-color: transparent; -fx-background-color: transparent;
-jfx-toggle-color: -fx-base-check-color; -jfx-toggle-color: -monet-primary;
-jfx-untoggle-color: transparent; -jfx-untoggle-color: transparent;
} }
@@ -1153,7 +1163,7 @@
} }
.toggle-icon-tiny .jfx-rippler { .toggle-icon-tiny .jfx-rippler {
-jfx-rippler-fill: -fx-base-check-color; -jfx-rippler-fill: -monet-primary;
-jfx-mask-type: CIRCLE; -jfx-mask-type: CIRCLE;
} }
@@ -1170,7 +1180,7 @@
} }
.announcement-close-button .jfx-rippler { .announcement-close-button .jfx-rippler {
-jfx-rippler-fill: -fx-base-check-color; -jfx-rippler-fill: -monet-primary;
-jfx-mask-type: CIRCLE; -jfx-mask-type: CIRCLE;
} }