Browse Source

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.
patch-4
SomberNight 4 years ago
parent
commit
9bba65199e
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 9
      electrum/gui/qt/qrcodewidget.py

9
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)

Loading…
Cancel
Save