diff options
| author | Michel Le Bihan <michel@lebihan.pl> | 2021-02-08 17:54:17 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-10-05 14:32:09 +0200 |
| commit | 125a660af9bb0ea1bb258d3ed426fe3d6e3a47d3 (patch) | |
| tree | 8063a0fbced74714b895e03f04513782fb71e575 | |
| parent | 13b38f55c495221828541ffded5f5e74807791b9 (diff) | |
[feature/handy]: Adapt OMEMO dialog (#985)
* Wrap OMEMO automatically accept label
* Change OMEMO fingerprint label to wrap with max-width
* Set contact OMEMO dialog as resizable
* Disable expanding grid in contact details
| -rw-r--r-- | main/data/contact_details_dialog.ui | 1 | ||||
| -rw-r--r-- | plugins/omemo/data/contact_details_dialog.ui | 7 | ||||
| -rw-r--r-- | plugins/omemo/src/ui/contact_details_dialog.vala | 2 | ||||
| -rw-r--r-- | plugins/omemo/src/ui/util.vala | 3 |
4 files changed, 8 insertions, 5 deletions
diff --git a/main/data/contact_details_dialog.ui b/main/data/contact_details_dialog.ui index 7ebfaaa5..3ba17746 100644 --- a/main/data/contact_details_dialog.ui +++ b/main/data/contact_details_dialog.ui @@ -36,6 +36,7 @@ <property name="margin-top">20</property> <property name="margin-bottom">12</property> <property name="column-spacing">10</property> + <property name="expand">False</property> <property name="visible">True</property> <child> <object class="DinoUiAvatarImage" id="avatar"> diff --git a/plugins/omemo/data/contact_details_dialog.ui b/plugins/omemo/data/contact_details_dialog.ui index 62aded6b..de6607fe 100644 --- a/plugins/omemo/data/contact_details_dialog.ui +++ b/plugins/omemo/data/contact_details_dialog.ui @@ -2,7 +2,6 @@ <interface> <template class="DinoPluginsOmemoContactDetailsDialog"> <property name="modal">True</property> - <property name="resizable">False</property> <child internal-child="vbox"> <object class="GtkBox"> <property name="visible">True</property> @@ -37,6 +36,8 @@ <object class="GtkLabel" id="automatically_accept_new_label"> <property name="visible">True</property> <property name="halign">start</property> + <property name="xalign">0</property> + <property name="wrap">True</property> <attributes> <attribute name="scale" value="1.1"/> </attributes> @@ -114,8 +115,10 @@ <object class="GtkLabel" id="own_fingerprint_label"> <property name="visible">True</property> <property name="halign">start</property> - <property name="justify">right</property> <property name="hexpand">True</property> + <property name="max_width_chars">35</property> + <property name="xalign">0</property> + <property name="wrap">True</property> </object> </child> <child> diff --git a/plugins/omemo/src/ui/contact_details_dialog.vala b/plugins/omemo/src/ui/contact_details_dialog.vala index b4d6d8f0..36817cfd 100644 --- a/plugins/omemo/src/ui/contact_details_dialog.vala +++ b/plugins/omemo/src/ui/contact_details_dialog.vala @@ -299,7 +299,7 @@ public class ContactDetailsDialog : Gtk.Dialog { public class FingerprintRow : ListBoxRow { private Image trust_image = new Image() { visible = true, halign = Align.END, icon_size = IconSize.BUTTON }; - private Label fingerprint_label = new Label("") { use_markup=true, justify=Justification.RIGHT, visible=true, halign = Align.START, valign = Align.CENTER, hexpand = false }; + private Label fingerprint_label = new Label("") { use_markup=true, max_width_chars=35, wrap=true, visible=true, halign = Align.START, valign = Align.CENTER, hexpand = false, xalign = 0 }; private Label trust_label = new Label(null) { visible = true, hexpand = true, xalign = 0 }; public Row row; diff --git a/plugins/omemo/src/ui/util.vala b/plugins/omemo/src/ui/util.vala index cf61ed82..0b0c4a9f 100644 --- a/plugins/omemo/src/ui/util.vala +++ b/plugins/omemo/src/ui/util.vala @@ -51,9 +51,8 @@ public static string fingerprint_markup(string s) { b = (uint8) (b * factor); } - if (i % 32 == 0 && i != 0) markup += "\n"; markup += @"<span foreground=\"$("#%02x%02x%02x".printf(r, g, b))\">$four_chars</span>"; - if (i % 8 == 4 && i % 32 != 28) markup += " "; + if (i % 8 == 4) markup += " "; } return "<span font_family='monospace' font='8'>" + markup + "</span>"; |
