diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/CreateAccountPane.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/CreateAccountPane.java index 6145bb5c7..781a91771 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/CreateAccountPane.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/CreateAccountPane.java @@ -272,9 +272,9 @@ public class CreateAccountPane extends JFXDialogLayout implements DialogAware { }); HBox box = new HBox(8); - Hyperlink birthLink = new Hyperlink(i18n("account.methods.microsoft.birth")); + JFXHyperlink birthLink = new JFXHyperlink(i18n("account.methods.microsoft.birth")); birthLink.setOnAction(e -> FXUtils.openLink("https://support.microsoft.com/zh-cn/account-billing/如何更改-microsoft-帐户上的出生日期-837badbc-999e-54d2-2617-d19206b9540a")); - Hyperlink profileLink = new Hyperlink(i18n("account.methods.microsoft.profile")); + JFXHyperlink profileLink = new JFXHyperlink(i18n("account.methods.microsoft.profile")); profileLink.setOnAction(e -> FXUtils.openLink("https://account.live.com/editprof.aspx")); box.getChildren().setAll(profileLink, birthLink); GridPane.setColumnSpan(box, 2); @@ -415,7 +415,7 @@ public class CreateAccountPane extends JFXDialogLayout implements DialogAware { if (factory instanceof YggdrasilAccountFactory) { HBox box = new HBox(); - Hyperlink migrationLink = new Hyperlink(i18n("account.methods.yggdrasil.migration")); + JFXHyperlink migrationLink = new JFXHyperlink(i18n("account.methods.yggdrasil.migration")); migrationLink.setOnAction(e -> FXUtils.openLink("https://help.minecraft.net/hc/en-us/articles/360050865492-JAVA-Account-Migration-FAQ")); GridPane.setColumnSpan(box, 2); box.getChildren().setAll(migrationLink); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/JFXHyperlink.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/JFXHyperlink.java new file mode 100644 index 000000000..c22be6692 --- /dev/null +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/JFXHyperlink.java @@ -0,0 +1,31 @@ +/* + * Hello Minecraft! Launcher + * Copyright (C) 2021 huangyuhui and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.jackhuang.hmcl.ui.construct; + +import javafx.scene.control.Hyperlink; +import org.jackhuang.hmcl.setting.Theme; +import org.jackhuang.hmcl.ui.SVG; + +public class JFXHyperlink extends Hyperlink { + public JFXHyperlink(String text) { + super(text); + + setGraphic(SVG.launchOutline(Theme.blackFillBinding(), 16, 16)); + } +} + diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TwoLineListItem.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TwoLineListItem.java index c0600fef7..f309e83f1 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TwoLineListItem.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TwoLineListItem.java @@ -22,10 +22,14 @@ import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; +import javafx.geometry.Insets; +import javafx.scene.Node; import javafx.scene.control.Label; +import javafx.scene.layout.FlowPane; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import org.jackhuang.hmcl.ui.FXUtils; +import org.jackhuang.hmcl.util.AggregatedObservableList; import org.jackhuang.hmcl.util.javafx.MappedObservableList; public class TwoLineListItem extends VBox { @@ -35,7 +39,8 @@ public class TwoLineListItem extends VBox { private final ObservableList tags = FXCollections.observableArrayList(); private final StringProperty subtitle = new SimpleStringProperty(this, "subtitle"); - private final ObservableList