mirror of
https://github.com/boldsuck/haveno.git
synced 2024-12-22 20:19:21 +00:00
adjust QR code size and resolution
This commit is contained in:
parent
dd0a307a84
commit
2dc5481101
4 changed files with 9 additions and 4 deletions
|
@ -165,6 +165,8 @@ public class DepositView extends ActivatableView<VBox, Void> {
|
|||
titledGroupBg.getStyleClass().add("last");
|
||||
|
||||
qrCodeImageView = new ImageView();
|
||||
qrCodeImageView.setFitHeight(150);
|
||||
qrCodeImageView.setFitWidth(150);
|
||||
qrCodeImageView.getStyleClass().add("qr-code");
|
||||
Tooltip.install(qrCodeImageView, new Tooltip(Res.get("shared.openLargeQRWindow")));
|
||||
qrCodeImageView.setOnMouseClicked(e -> UserThread.runAfter(
|
||||
|
@ -275,7 +277,7 @@ public class DepositView extends ActivatableView<VBox, Void> {
|
|||
if (addressTextField.getAddress() != null && !addressTextField.getAddress().isEmpty()) {
|
||||
final byte[] imageBytes = QRCode
|
||||
.from(getPaymentUri())
|
||||
.withSize(150, 150) // code has 41 elements 8 px is border with 150 we get 3x scale and min. border
|
||||
.withSize(300, 300)
|
||||
.to(ImageType.PNG)
|
||||
.stream()
|
||||
.toByteArray();
|
||||
|
|
|
@ -765,7 +765,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
|
|||
if (!newValue.toString().equals("")) {
|
||||
final byte[] imageBytes = QRCode
|
||||
.from(getMoneroURI())
|
||||
.withSize(98, 98) // code has 41 elements 8 px is border with 98 we get double scale and min. border
|
||||
.withSize(300, 300)
|
||||
.to(ImageType.PNG)
|
||||
.stream()
|
||||
.toByteArray();
|
||||
|
|
|
@ -489,7 +489,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
|||
|
||||
final byte[] imageBytes = QRCode
|
||||
.from(getMoneroURI())
|
||||
.withSize(98, 98) // code has 41 elements 8 px is border with 98 we get double scale and min. border
|
||||
.withSize(300, 300)
|
||||
.to(ImageType.PNG)
|
||||
.stream()
|
||||
.toByteArray();
|
||||
|
|
|
@ -48,12 +48,15 @@ public class QRCodeWindow extends Overlay<QRCodeWindow> {
|
|||
this.bitcoinURI = bitcoinURI;
|
||||
final byte[] imageBytes = QRCode
|
||||
.from(bitcoinURI)
|
||||
.withSize(250, 250)
|
||||
.withSize(300, 300)
|
||||
.to(ImageType.PNG)
|
||||
.stream()
|
||||
.toByteArray();
|
||||
Image qrImage = new Image(new ByteArrayInputStream(imageBytes));
|
||||
qrCodeImageView = new ImageView(qrImage);
|
||||
qrCodeImageView.setFitHeight(250);
|
||||
qrCodeImageView.setFitWidth(250);
|
||||
qrCodeImageView.getStyleClass().add("qr-code");
|
||||
|
||||
type = Type.Information;
|
||||
width = 468;
|
||||
|
|
Loading…
Reference in a new issue