mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-02 12:26: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.setAlignment(Pos.TOP_LEFT);
|
||||||
contentBox.setPadding(new Insets(10, 30, 10, 30));
|
contentBox.setPadding(new Insets(10, 30, 10, 30));
|
||||||
contentBox.setPrefWidth(400); // Set preferred width for wrapping
|
contentBox.setPrefWidth(400); // Set preferred width for wrapping
|
||||||
|
contentBox.setMinHeight(60);
|
||||||
|
|
||||||
// Define the regex pattern to match URLs
|
// Define the regex pattern to match URLs
|
||||||
String urlPattern = "(\\[https?://\\S+])";
|
String urlPattern = "(\\[https?://\\S+])";
|
||||||
|
@ -211,13 +212,7 @@ public class TitledDescriptionPane extends TitledPane {
|
||||||
Hyperlink hyperlink = new Hyperlink(url);
|
Hyperlink hyperlink = new Hyperlink(url);
|
||||||
hyperlink.setMaxWidth(400); // Set maximum width for wrapping
|
hyperlink.setMaxWidth(400); // Set maximum width for wrapping
|
||||||
hyperlink.setWrapText(true); // Ensure text wrapping in the hyperlink
|
hyperlink.setWrapText(true); // Ensure text wrapping in the hyperlink
|
||||||
hyperlink.setOnAction(e -> {
|
hyperlink.setOnAction(_ -> AppServices.get().getApplication().getHostServices().showDocument(url));
|
||||||
try {
|
|
||||||
java.awt.Desktop.getDesktop().browse(new java.net.URI(url));
|
|
||||||
} catch (Exception ex) {
|
|
||||||
// TODO: handle failure to launch link
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return hyperlink;
|
return hyperlink;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue