Daniel Brötzmann pushed to branch mainwindow at gajim / gajim
Commits: d3202015 by wurstsalat at 2021-12-02T19:30:20+01:00 ContactInfo: Add JID label
- - - - - 6129f010 by wurstsalat at 2021-12-02T19:33:22+01:00 VCardGrid: Don’t set min width for scrolled textview
This avoids an un-centered layout of widgets
- - - - -
3 changed files:
- gajim/data/gui/contact_info.ui - gajim/gtk/contact_info.py - gajim/gtk/vcard_grid.py
Changes:
===================================== gajim/data/gui/contact_info.ui ===================================== @@ -147,6 +147,25 @@ <property name="position">1</property> </packing> </child> + <child> + <object class="GtkLabel" id="contact_jid_label"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="margin-bottom">6</property> + <property name="selectable">True</property> + <property name="ellipsize">end</property> + <property name="single-line-mode">True</property> + <property name="max-width-chars">50</property> + <style> + <class name="dim-label"/> + </style> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> <child> <!-- n-columns=2 n-rows=2 --> <object class="GtkGrid" id="group_chat_grid"> @@ -186,7 +205,7 @@ <object class="GtkLabel"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="halign">start</property> + <property name="halign">end</property> <property name="label" translatable="yes">Affiliation</property> <style> <class name="dim-label"/> @@ -212,7 +231,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> </object>
===================================== gajim/gtk/contact_info.py ===================================== @@ -107,7 +107,15 @@ def __init__(self, account, contact, page=None): self._load_avatar()
self._ui.contact_name_label.set_text(contact.name) + self._ui.contact_jid_label.set_text(str(contact.jid)) + self._ui.contact_jid_label.set_tooltip_text(str(contact.jid)) + if contact.is_pm_contact: + if contact.real_jid is not None: + self._ui.contact_jid_label.set_text( + str(contact.real_jid.bare)) + self._ui.contact_jid_label.set_tooltip_text( + str(contact.real_jid.bare)) self._ui.role_label.set_text(get_uf_role(contact.role)) self._ui.affiliation_label.set_text( get_uf_affiliation(contact.affiliation))
===================================== gajim/gtk/vcard_grid.py ===================================== @@ -604,7 +604,7 @@ def __init__(self, prop, _account): Gtk.PolicyType.AUTOMATIC) self._edit_scrolled.add(self._edit_text_view) self._edit_scrolled.set_valign(Gtk.Align.CENTER) - self._edit_scrolled.set_size_request(350, 100) + self._edit_scrolled.set_size_request(-1, 100) self._edit_scrolled.get_style_context().add_class('profile-scrolled')
self._read_text_view = ValueTextView(prop) @@ -617,7 +617,7 @@ def __init__(self, prop, _account): Gtk.PolicyType.AUTOMATIC) self._read_scrolled.add(self._read_text_view) self._read_scrolled.set_valign(Gtk.Align.CENTER) - self._read_scrolled.set_size_request(350, 100) + self._read_scrolled.set_size_request(-1, 100) self._read_scrolled.get_style_context().add_class( 'profile-scrolled-read')
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/a8720627ce2c5a811c67ba7f8cf3630f...