From 2116cfd7896d5a56b6c9e8368920802eed804cf3 Mon Sep 17 00:00:00 2001 From: Burning_TNT <88144530+burningtnt@users.noreply.github.com> Date: Sat, 13 Jan 2024 11:27:10 +0800 Subject: [PATCH] Render title in white at anytime (#2389) --- .../java/org/jackhuang/hmcl/ui/decorator/DecoratorSkin.java | 2 ++ HMCL/src/main/resources/assets/css/root.css | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/decorator/DecoratorSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/decorator/DecoratorSkin.java index 04b2aad42..21b33277a 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/decorator/DecoratorSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/decorator/DecoratorSkin.java @@ -141,6 +141,8 @@ public class DecoratorSkin extends SkinBase { titleContainer.setPickOnBounds(false); titleContainer.getStyleClass().addAll("jfx-tool-bar"); + // Maybe, we can automatically identify whether the top part of the picture is light-coloured or dark when the title is transparent, + // and decide whether the whole top bar should be rendered in white or black. TODO FXUtils.onChangeAndOperate(skinnable.titleTransparentProperty(), titleTransparent -> { if (titleTransparent) { wrapper.backgroundProperty().bind(skinnable.contentBackgroundProperty()); diff --git a/HMCL/src/main/resources/assets/css/root.css b/HMCL/src/main/resources/assets/css/root.css index aea759d2a..36c589bbe 100644 --- a/HMCL/src/main/resources/assets/css/root.css +++ b/HMCL/src/main/resources/assets/css/root.css @@ -553,7 +553,7 @@ } .jfx-tool-bar.gray-background Label { - -fx-text-fill: BLACK; + /* -fx-text-fill: BLACK; */ } .jfx-tool-bar .jfx-options-burger {