diff options
author | fiaxh <git@lightrise.org> | 2023-01-28 00:51:31 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2023-01-28 00:52:38 +0100 |
commit | c813a6d2405980c71450cefa10abdf11fab8e995 (patch) | |
tree | 821cb4c0db34785d70e3da525b7582be00f75325 /plugins/omemo | |
parent | 5d9978b38bb0e729dcccecddd08cc59e5585a6cc (diff) | |
download | dino-c813a6d2405980c71450cefa10abdf11fab8e995.tar.gz dino-c813a6d2405980c71450cefa10abdf11fab8e995.zip |
Fix QR code being displayed way too small
fixes #1278
Diffstat (limited to 'plugins/omemo')
-rw-r--r-- | plugins/omemo/data/contact_details_dialog.ui | 4 | ||||
-rw-r--r-- | plugins/omemo/src/ui/contact_details_dialog.vala | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/plugins/omemo/data/contact_details_dialog.ui b/plugins/omemo/data/contact_details_dialog.ui index 9b4042cf..715dbd33 100644 --- a/plugins/omemo/data/contact_details_dialog.ui +++ b/plugins/omemo/data/contact_details_dialog.ui @@ -241,7 +241,9 @@ <property name="margin-top">10</property> <property name="margin-bottom">10</property> <child> - <object class="GtkImage" id="qrcode_image"/> + <object class="GtkPicture" id="qrcode_picture"> + <property name="can-shrink">False</property> + </object> </child> </object> </property> diff --git a/plugins/omemo/src/ui/contact_details_dialog.vala b/plugins/omemo/src/ui/contact_details_dialog.vala index 2de28572..61fae286 100644 --- a/plugins/omemo/src/ui/contact_details_dialog.vala +++ b/plugins/omemo/src/ui/contact_details_dialog.vala @@ -38,7 +38,7 @@ public class ContactDetailsDialog : Gtk.Dialog { [GtkChild] private unowned Switch auto_accept_switch; [GtkChild] private unowned Button copy_button; [GtkChild] private unowned MenuButton show_qrcode_button; - [GtkChild] private unowned Image qrcode_image; + [GtkChild] private unowned Picture qrcode_picture; [GtkChild] private unowned Popover qrcode_popover; private ArrayList<Widget> new_keys_listbox_children = new ArrayList<Widget>(); @@ -105,10 +105,10 @@ public class ContactDetailsDialog : Gtk.Dialog { const int QUIET_ZONE_MODULES = 4; // MUST be at least 4 const int MODULE_SIZE_PX = 4; // arbitrary var qr_paintable = new QRcode(iri, 2) - .to_paintable(MODULE_SIZE_PX * qrcode_image.scale_factor); - qrcode_image.paintable = qr_paintable; - qrcode_image.margin_top = qrcode_image.margin_end = - qrcode_image.margin_bottom = qrcode_image.margin_start = QUIET_ZONE_MODULES*MODULE_SIZE_PX; + .to_paintable(MODULE_SIZE_PX * qrcode_picture.scale_factor); + qrcode_picture.paintable = qr_paintable; + qrcode_picture.margin_top = qrcode_picture.margin_end = + qrcode_picture.margin_bottom = qrcode_picture.margin_start = QUIET_ZONE_MODULES * MODULE_SIZE_PX; qrcode_popover.add_css_class("qrcode-container"); show_qrcode_button.popover = qrcode_popover; |