Omemo contact details dialog: Only show inactive keys Expander if there are any

This commit is contained in:
fiaxh 2019-12-13 16:27:05 +01:00
parent d194eae61d
commit 21c01dcdcb
2 changed files with 8 additions and 6 deletions

View file

@ -235,8 +235,8 @@
</object> </object>
</child> </child>
<child> <child>
<object class="GtkExpander"> <object class="GtkExpander" id="inactive_keys_expander">
<property name="visible">True</property> <property name="visible">False</property>
<child type="label"> <child type="label">
<object class="GtkLabel" id="inactive_expander_label"> <object class="GtkLabel" id="inactive_expander_label">
<property name="visible">True</property> <property name="visible">True</property>
@ -256,7 +256,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="propagate_natural_height">True</property> <property name="propagate_natural_height">True</property>
<child> <child>
<object class="GtkListBox" id="unused_keys_listbox"> <object class="GtkListBox" id="inactive_keys_listbox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="selection-mode">none</property> <property name="selection-mode">none</property>
</object> </object>

View file

@ -30,7 +30,8 @@ public class ContactDetailsDialog : Gtk.Dialog {
[GtkChild] private ListBox new_keys_listbox; [GtkChild] private ListBox new_keys_listbox;
[GtkChild] private Box keys_container; [GtkChild] private Box keys_container;
[GtkChild] private ListBox keys_listbox; [GtkChild] private ListBox keys_listbox;
[GtkChild] private ListBox unused_keys_listbox; [GtkChild] private Expander inactive_keys_expander;
[GtkChild] private ListBox inactive_keys_listbox;
[GtkChild] private Switch auto_accept_switch; [GtkChild] private Switch auto_accept_switch;
[GtkChild] private Button copy_button; [GtkChild] private Button copy_button;
[GtkChild] private Button show_qrcode_button; [GtkChild] private Button show_qrcode_button;
@ -59,7 +60,7 @@ public class ContactDetailsDialog : Gtk.Dialog {
} }
keys_listbox.row_activated.connect(on_key_entry_clicked); keys_listbox.row_activated.connect(on_key_entry_clicked);
unused_keys_listbox.row_activated.connect(on_key_entry_clicked); inactive_keys_listbox.row_activated.connect(on_key_entry_clicked);
auto_accept_switch.state_set.connect(on_auto_accept_toggled); auto_accept_switch.state_set.connect(on_auto_accept_toggled);
int identity_id = plugin.db.identity.get_id(account.id); int identity_id = plugin.db.identity.get_id(account.id);
@ -134,7 +135,8 @@ public class ContactDetailsDialog : Gtk.Dialog {
keys_container.visible = true; keys_container.visible = true;
keys_listbox.add(fingerprint_row); keys_listbox.add(fingerprint_row);
} else { } else {
unused_keys_listbox.add(fingerprint_row); inactive_keys_expander.visible=true;
inactive_keys_listbox.add(fingerprint_row);
} }
} }