From 9bba65199e80556de0c6efd28258344777ac5a6d Mon Sep 17 00:00:00 2001 From: SomberNight Date: Sun, 6 Sep 2020 17:55:11 +0200 Subject: [PATCH] Qt QR code: when saving QR code as image file, don't include stretch The stretch to the right of the QR was included in the image previously. This resolves the FIXME. --- electrum/gui/qt/qrcodewidget.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/electrum/gui/qt/qrcodewidget.py b/electrum/gui/qt/qrcodewidget.py index 2fc79d245..0c9a49e57 100644 --- a/electrum/gui/qt/qrcodewidget.py +++ b/electrum/gui/qt/qrcodewidget.py @@ -106,8 +106,13 @@ class QRDialog(WindowModalDialog): WindowModalDialog.__init__(self, parent, title) vbox = QVBoxLayout() + qrw = QRCodeWidget(data) - vbox.addWidget(qrw, 1) + qr_hbox = QHBoxLayout() + qr_hbox.addWidget(qrw) + qr_hbox.addStretch(1) + vbox.addLayout(qr_hbox) + help_text = data if show_text else help_text if help_text: text_label = WWLabel() @@ -124,7 +129,7 @@ class QRDialog(WindowModalDialog): filename, __ = QFileDialog.getSaveFileName(self, _("Select where to save file"), "qrcode.png") if not filename: return - p = qrw.grab() # FIXME also grabs neutral colored padding + p = qrw.grab() p.save(filename, 'png') self.show_message(_("QR code saved to file") + " " + filename)