remove buttons from infobar just before adding new instead of when hidding infobar

This commit is contained in:
Yann Leboulanger 2011-10-17 18:00:27 +02:00
parent 8b2669ad8c
commit c54ffecd31
1 changed files with 8 additions and 3 deletions

View File

@ -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)