From 315e5d51c8b17a48c6c68d9d9bde79b5cb9ce0bf Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Sat, 11 Jun 2005 10:53:54 +0000 Subject: [PATCH] applying patch by dcraven to make the muc list prettier --- src/groupchat_window.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/groupchat_window.py b/src/groupchat_window.py index 053de2bfa..49babed8b 100644 --- a/src/groupchat_window.py +++ b/src/groupchat_window.py @@ -196,7 +196,7 @@ class GroupchatWindow(chat.Chat): role_iter = self.get_role_iter(room_jid, role) if not role_iter: role_iter = model.append(None, - (self.plugin.roster.jabber_state_images['closed'], role + 's', + (self.plugin.roster.jabber_state_images['closed'], '%ss' % role.capitalize(), role, '')) iter = model.append(role_iter, (image, nick, jid, show)) self.list_treeview[room_jid].expand_row((model.get_path(role_iter)), @@ -683,7 +683,9 @@ class GroupchatWindow(chat.Chat): column.add_attribute(renderer_image, 'image', 0) renderer_text = gtk.CellRendererText() column.pack_start(renderer_text, expand = True) - column.add_attribute(renderer_text, 'text', 1) + column.set_attributes(renderer_text, markup=1) + column.set_cell_data_func(renderer_image, self.tree_cell_data_func, None) + column.set_cell_data_func(renderer_text, self.tree_cell_data_func, None) self.list_treeview[room_jid].append_column(column) self.list_treeview[room_jid].set_model(store) @@ -700,6 +702,15 @@ class GroupchatWindow(chat.Chat): self.show_title() conversation_textview.grab_focus() + def tree_cell_data_func(self, column, renderer, model, iter, data=None): + if not model.iter_parent(iter): # is iter toplevel? (ie. group) + bgcolor = gajim.config.get('groupbgcolor') + renderer.set_property('cell-background', bgcolor) + renderer.set_property('cell-background', bgcolor) + else: # iter is a user, background is white + renderer.set_property('cell-background', '#FFFFFF') + renderer.set_property('cell-background', '#FFFFFF') + def on_actions_button_clicked(self, button): """popup action menu""" self.gc_actions_menu.popup(None, None, None, 1, 0)