mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-08-04 03:46:57 -04:00
调整公告中超链接的风格 (#3377)
* 调整 MessageDialogPane 中超链接的风格 * Fix checkstyle * fix
This commit is contained in:
parent
c9d259d7f1
commit
7d339677e4
@ -28,6 +28,7 @@ import javafx.beans.property.Property;
|
|||||||
import javafx.beans.value.*;
|
import javafx.beans.value.*;
|
||||||
import javafx.geometry.Insets;
|
import javafx.geometry.Insets;
|
||||||
import javafx.geometry.Pos;
|
import javafx.geometry.Pos;
|
||||||
|
import javafx.scene.Cursor;
|
||||||
import javafx.scene.Node;
|
import javafx.scene.Node;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.control.ScrollPane;
|
import javafx.scene.control.ScrollPane;
|
||||||
@ -52,7 +53,6 @@ import org.glavo.png.PNGWriter;
|
|||||||
import org.glavo.png.javafx.PNGJavaFXUtils;
|
import org.glavo.png.javafx.PNGJavaFXUtils;
|
||||||
import org.jackhuang.hmcl.task.Task;
|
import org.jackhuang.hmcl.task.Task;
|
||||||
import org.jackhuang.hmcl.ui.animation.AnimationUtils;
|
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.Holder;
|
||||||
import org.jackhuang.hmcl.util.ResourceNotFoundError;
|
import org.jackhuang.hmcl.util.ResourceNotFoundError;
|
||||||
import org.jackhuang.hmcl.util.StringUtils;
|
import org.jackhuang.hmcl.util.StringUtils;
|
||||||
@ -986,8 +986,8 @@ public final class FXUtils {
|
|||||||
Element element = (Element) node;
|
Element element = (Element) node;
|
||||||
if ("a".equals(element.getTagName())) {
|
if ("a".equals(element.getTagName())) {
|
||||||
String href = element.getAttribute("href");
|
String href = element.getAttribute("href");
|
||||||
JFXHyperlink hyperlink = new JFXHyperlink(element.getTextContent());
|
Text text = new Text(element.getTextContent());
|
||||||
hyperlink.setOnAction(e -> {
|
text.setOnMouseClicked(e -> {
|
||||||
String link = href;
|
String link = href;
|
||||||
try {
|
try {
|
||||||
link = new URI(href).toASCIIString();
|
link = new URI(href).toASCIIString();
|
||||||
@ -995,7 +995,10 @@ public final class FXUtils {
|
|||||||
}
|
}
|
||||||
hyperlinkAction.accept(link);
|
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())) {
|
} else if ("b".equals(element.getTagName())) {
|
||||||
Text text = new Text(element.getTextContent());
|
Text text = new Text(element.getTextContent());
|
||||||
text.getStyleClass().add("bold");
|
text.getStyleClass().add("bold");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user