From 2dc548110189dfd4a9c79d01abdcf4474a3a5193 Mon Sep 17 00:00:00 2001 From: woodser Date: Fri, 2 Dec 2022 17:25:33 +0000 Subject: [PATCH] adjust QR code size and resolution --- .../java/bisq/desktop/main/funds/deposit/DepositView.java | 4 +++- .../main/java/bisq/desktop/main/offer/MutableOfferView.java | 2 +- .../bisq/desktop/main/offer/takeoffer/TakeOfferView.java | 2 +- .../bisq/desktop/main/overlays/windows/QRCodeWindow.java | 5 ++++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/funds/deposit/DepositView.java b/desktop/src/main/java/bisq/desktop/main/funds/deposit/DepositView.java index c5cf3fa800..c5328e4812 100644 --- a/desktop/src/main/java/bisq/desktop/main/funds/deposit/DepositView.java +++ b/desktop/src/main/java/bisq/desktop/main/funds/deposit/DepositView.java @@ -165,6 +165,8 @@ public class DepositView extends ActivatableView { 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 { 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(); diff --git a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java index 0599c10e04..833311c34c 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java @@ -765,7 +765,7 @@ public abstract class MutableOfferView> 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(); diff --git a/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferView.java b/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferView.java index d20236b99a..01de7c40f6 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferView.java @@ -489,7 +489,7 @@ public class TakeOfferView extends ActivatableViewAndModel { 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;