mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
PR #1510 Feedback: set min height, use AppServices url handling
This commit is contained in:
parent
bf457620db
commit
2aac365039
1 changed files with 2 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue