Commit 6c9c4c1a authored by Daniel Brötzmann's avatar Daniel Brötzmann Committed by Philipp Hörist

ChatBanners: Unify display of contact name

parent 564068c2
Pipeline #4039 passed with stages
in 2 minutes and 31 seconds
......@@ -732,8 +732,6 @@ class ChatControl(ChatControlBase):
status = contact.status
if status is not None:
banner_name_label.set_ellipsize(Pango.EllipsizeMode.END)
self.banner_status_label.set_ellipsize(Pango.EllipsizeMode.END)
status_reduced = helpers.reduce_chars_newlines(status, max_lines=1)
else:
status_reduced = ''
......
......@@ -364,15 +364,14 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="hbox3004">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkEventBox" id="avatar_eventbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="visible_window">False</property>
<child>
<object class="GtkImage" id="avatar_image">
......@@ -395,17 +394,22 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="margin_left">5</property>
<property name="hexpand">True</property>
<property name="row_spacing">2</property>
<property name="row_spacing">3</property>
<property name="column_spacing">3</property>
<child>
<object class="GtkLabel" id="banner_name_label">
<property name="name">ChatControl-BannerNameLabel</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label">&lt;span weight="heavy" size="large"&gt;Contact name&lt;/span&gt;</property>
<property name="use_markup">True</property>
<property name="halign">start</property>
<property name="hexpand">True</property>
<property name="label">Contact name</property>
<property name="ellipsize">end</property>
<property name="xalign">0</property>
<style>
<class name="large-header"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -418,12 +422,16 @@
<property name="name">ChatControl-BannerLabel</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="hexpand">True</property>
<property name="label">label</property>
<property name="use_markup">True</property>
<property name="selectable">True</property>
<property name="ellipsize">end</property>
<property name="xalign">0</property>
<signal name="populate-popup" handler="on_banner_label_populate_popup" swapped="no"/>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="left_attach">1</property>
......
......@@ -115,19 +115,21 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="hbox3024">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkImage" id="gc_banner_status_image">
<property name="width_request">48</property>
<property name="height_request">48</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
......@@ -136,10 +138,15 @@
<property name="name">GroupChatControl-BannerNameLabel</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label">&lt;span weight="heavy" size="large"&gt;room jid&lt;/span&gt;</property>
<property name="use_markup">True</property>
<property name="hexpand">True</property>
<property name="label">Group Chat Name</property>
<property name="selectable">True</property>
<property name="ellipsize">end</property>
<property name="single_line_mode">True</property>
<property name="xalign">0</property>
<style>
<class name="large-header"/>
</style>
</object>
<packing>
<property name="expand">False</property>
......
......@@ -9,11 +9,6 @@
.gajim-state-tab-muc-msg {
color: rgb(0, 0, 205)
}
.gajim-banner {
font-size: 13pt;
font-weight: 700
}
.chatcontrol-actionbar-button {
padding: 0px 5px 0px 5px;
......@@ -43,8 +38,6 @@
.chatcontrol-separator {margin-bottom: 5px;}
#SubjectPopover box { padding: 10px; }
.link-button { min-height: 0px }
/* VCardWindow */
......
......@@ -280,6 +280,7 @@ class GroupchatControl(ChatControlBase):
self.banner_actionbar = self.xml.get_object('banner_actionbar')
self.hide_roster_button = Gtk.Button.new_from_icon_name(
'go-next-symbolic', Gtk.IconSize.MENU)
self.hide_roster_button.set_valign(Gtk.Align.CENTER)
self.hide_roster_button.connect('clicked',
lambda *args: self.show_roster())
self.banner_actionbar.pack_end(self.hide_roster_button)
......@@ -1072,7 +1073,7 @@ class GroupchatControl(ChatControlBase):
if self.is_connected:
if self.contact.avatar_sha:
surface = app.interface.get_avatar(self.contact,
AvatarSize.ROSTER,
AvatarSize.CHAT,
self.scale_factor)
banner_status_img.set_from_surface(surface)
return
......@@ -1103,7 +1104,6 @@ class GroupchatControl(ChatControlBase):
Draw the text in the fat line at the top of the window that houses the
room jid
"""
self.name_label.set_ellipsize(Pango.EllipsizeMode.END)
self.name_label.set_text(self.room_name)
def _nec_update_avatar(self, obj):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment