From c54ffecd313609d2e82fc5fb4720b9c67717c1bb Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 17 Oct 2011 18:00:27 +0200 Subject: [PATCH] remove buttons from infobar just before adding new instead of when hidding infobar --- src/chat_control.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/chat_control.py b/src/chat_control.py index 998af5341..db77f0d2b 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -3150,8 +3150,16 @@ class ChatControl(ChatControlBase): return markup, buttons, args, type_ = self.info_bar_queue[0] self.info_bar_label.set_markup(markup) + + # Remove old buttons + area = self.info_bar.get_action_area() + for b in area.get_children(): + area.remove(b) + + # Add new buttons for button in buttons: self.info_bar.add_action_widget(button, 0) + self.info_bar.set_message_type(type_) self.info_bar.set_no_show_all(False) self.info_bar.show_all() @@ -3269,9 +3277,6 @@ class ChatControl(ChatControlBase): self.info_bar_queue.remove(ib_msg) if i == 0: # We are removing the one currently displayed - area = self.info_bar.get_action_area() - for b in area.get_children(): - area.remove(b) self.info_bar.hide() # show next one? gobject.idle_add(self._info_bar_show_message)