From 7d339677e47eb0312d581bc2ca8d3e7c78cac58b Mon Sep 17 00:00:00 2001 From: Glavo Date: Thu, 24 Oct 2024 21:50:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=85=AC=E5=91=8A=E4=B8=AD?= =?UTF-8?q?=E8=B6=85=E9=93=BE=E6=8E=A5=E7=9A=84=E9=A3=8E=E6=A0=BC=20(#3377?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 调整 MessageDialogPane 中超链接的风格 * Fix checkstyle * fix --- HMCL/src/main/java/org/jackhuang/hmcl/ui/FXUtils.java | 11 +++++++---- .../main/resources/assets/lang/I18N_zh_CN.properties | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/FXUtils.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/FXUtils.java index 41e5d1cd6..35705f367 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/FXUtils.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/FXUtils.java @@ -28,6 +28,7 @@ import javafx.beans.property.Property; import javafx.beans.value.*; import javafx.geometry.Insets; import javafx.geometry.Pos; +import javafx.scene.Cursor; import javafx.scene.Node; import javafx.scene.control.Label; import javafx.scene.control.ScrollPane; @@ -52,7 +53,6 @@ import org.glavo.png.PNGWriter; import org.glavo.png.javafx.PNGJavaFXUtils; import org.jackhuang.hmcl.task.Task; import org.jackhuang.hmcl.ui.animation.AnimationUtils; -import org.jackhuang.hmcl.ui.construct.JFXHyperlink; import org.jackhuang.hmcl.util.Holder; import org.jackhuang.hmcl.util.ResourceNotFoundError; import org.jackhuang.hmcl.util.StringUtils; @@ -986,8 +986,8 @@ public final class FXUtils { Element element = (Element) node; if ("a".equals(element.getTagName())) { String href = element.getAttribute("href"); - JFXHyperlink hyperlink = new JFXHyperlink(element.getTextContent()); - hyperlink.setOnAction(e -> { + Text text = new Text(element.getTextContent()); + text.setOnMouseClicked(e -> { String link = href; try { link = new URI(href).toASCIIString(); @@ -995,7 +995,10 @@ public final class FXUtils { } hyperlinkAction.accept(link); }); - texts.add(hyperlink); + text.setCursor(Cursor.HAND); + text.setUnderline(true); + text.setFill(Color.web("#283593")); + texts.add(text); } else if ("b".equals(element.getTagName())) { Text text = new Text(element.getTextContent()); text.getStyleClass().add("bold"); diff --git a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties index fd2618091..62127bcfd 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties @@ -1097,14 +1097,14 @@ update.changelog=更新日志 update.channel.dev=开发版 update.channel.dev.hint=你正在使用 HMCL 开发版。开发版包含一些未在稳定版中包含的测试性功能,仅用于体验新功能。\n\ 开发版功能未受充分验证,使用起来可能不稳定!下载稳定版\n\ - 如果你使用时遇到了问题,可以通过设置中 反馈页面 提供的渠道进行反馈。欢迎关注 B 站账号 @huanghongxun 以关注 HMCL 的开发进展。\n\ + 如果你使用时遇到了问题,可以通过设置中反馈页面提供的渠道进行反馈。欢迎关注 B 站账号 @huanghongxun 以关注 HMCL 的开发进展。\n\ \n\ 为当前版本隐藏该提示。 update.channel.dev.title=开发版提示 update.channel.nightly=预览版 update.channel.nightly.hint=你正在使用 HMCL 预览版。预览版更新较为频繁,包含一些未在稳定版和开发版中包含的测试性功能,仅用于体验新功能。\n\ 预览版功能未受充分验证,使用起来可能不稳定!下载稳定版\n\ - 如果你使用时遇到了问题,可以通过设置中 反馈页面 提供的渠道进行反馈。欢迎关注 B 站账号 @huanghongxun 以关注 HMCL 的开发进展。 + 如果你使用时遇到了问题,可以通过设置中反馈页面提供的渠道进行反馈。欢迎关注 B 站账号 @huanghongxun 以关注 HMCL 的开发进展。 update.channel.nightly.title=预览版提示 update.channel.stable=稳定版 update.checking=正在检查更新