From 2aac365039847e12f6aeb4b027f0e67b1fe46e6b Mon Sep 17 00:00:00 2001 From: David Cavaceci Date: Mon, 7 Oct 2024 09:59:58 -0500 Subject: [PATCH] PR #1510 Feedback: set min height, use AppServices url handling --- .../sparrow/control/TitledDescriptionPane.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/TitledDescriptionPane.java b/src/main/java/com/sparrowwallet/sparrow/control/TitledDescriptionPane.java index 118c567b..f6c542e3 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/TitledDescriptionPane.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/TitledDescriptionPane.java @@ -132,6 +132,7 @@ public class TitledDescriptionPane extends TitledPane { contentBox.setAlignment(Pos.TOP_LEFT); contentBox.setPadding(new Insets(10, 30, 10, 30)); contentBox.setPrefWidth(400); // Set preferred width for wrapping + contentBox.setMinHeight(60); // Define the regex pattern to match URLs String urlPattern = "(\\[https?://\\S+])"; @@ -211,13 +212,7 @@ public class TitledDescriptionPane extends TitledPane { Hyperlink hyperlink = new Hyperlink(url); hyperlink.setMaxWidth(400); // Set maximum width for wrapping hyperlink.setWrapText(true); // Ensure text wrapping in the hyperlink - hyperlink.setOnAction(e -> { - try { - java.awt.Desktop.getDesktop().browse(new java.net.URI(url)); - } catch (Exception ex) { - // TODO: handle failure to launch link - } - }); + hyperlink.setOnAction(_ -> AppServices.get().getApplication().getHostServices().showDocument(url)); return hyperlink; } }