aboutsummaryrefslogtreecommitdiff
path: root/plugins/omemo
diff options
context:
space:
mode:
authorRahix <rahix@rahix.de>2018-11-11 20:30:07 +0100
committerfiaxh <fiaxh@users.noreply.github.com>2018-11-16 11:24:17 -0600
commit9e5f30487a2ef6bf727afc93aed39be3dc494a2f (patch)
tree77635b3f2308ff03e80a4775ae1b775ce60d252e /plugins/omemo
parentfa731a46235e7d6b46450f339539247d3671514b (diff)
downloaddino-9e5f30487a2ef6bf727afc93aed39be3dc494a2f.tar.gz
dino-9e5f30487a2ef6bf727afc93aed39be3dc494a2f.zip
Add a white border around QR-codes
Signed-off-by: Rahix <rahix@rahix.de>
Diffstat (limited to 'plugins/omemo')
-rw-r--r--plugins/omemo/src/contact_details_dialog.vala15
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/omemo/src/contact_details_dialog.vala b/plugins/omemo/src/contact_details_dialog.vala
index 1865c5f0..62d755d9 100644
--- a/plugins/omemo/src/contact_details_dialog.vala
+++ b/plugins/omemo/src/contact_details_dialog.vala
@@ -58,8 +58,19 @@ public class ContactDetailsDialog : Gtk.Dialog {
copy_button.clicked.connect(() => {Clipboard.get_default(get_display()).set_text(fingerprint, fingerprint.length);});
int sid = plugin.db.identity.row_with(plugin.db.identity.account_id, account.id)[plugin.db.identity.device_id];
- Pixbuf pixbuf = new QRcode(@"xmpp:$(account.bare_jid)?omemo-sid-$(sid)=$(fingerprint)", 2).to_pixbuf();
- pixbuf = pixbuf.scale_simple(150, 150, InterpType.NEAREST);
+ Pixbuf qr_pixbuf = new QRcode(@"xmpp:$(account.bare_jid)?omemo-sid-$(sid)=$(fingerprint)", 2).to_pixbuf();
+ qr_pixbuf = qr_pixbuf.scale_simple(150, 150, InterpType.NEAREST);
+
+ Pixbuf pixbuf = new Pixbuf(
+ qr_pixbuf.colorspace,
+ qr_pixbuf.has_alpha,
+ qr_pixbuf.bits_per_sample,
+ 170,
+ 170
+ );
+ pixbuf.fill(uint32.MAX);
+ qr_pixbuf.copy_area(0, 0, 150, 150, pixbuf, 10, 10);
+
qrcode_image.set_from_pixbuf(pixbuf);
show_qrcode_button.clicked.connect(qrcode_popover.popup);
}