wix: scrolling is not reseted anymore when clicking on a group on contact list

This commit is contained in:
Goffi 2010-07-16 22:22:52 +08:00
commit c95e8a4e70

View file

@ -147,6 +147,7 @@ class ContactList(wx.SimpleHtmlListBox, QuickContactList):
"""Called when a contact is selected."""
data = self.getSelection()
if data == None: #we have a group
first_visible = self.GetVisibleBegin()
group = self.GetClientData(self.GetSelection())
erased = self.__eraseGroup(group)
if not erased: #the group was already erased, we can add again the contacts
@ -156,6 +157,7 @@ class ContactList(wx.SimpleHtmlListBox, QuickContactList):
for contact in contacts:
self.Insert(self.__presentItem(contact), id_insert, contact)
self.SetSelection(wx.NOT_FOUND)
self.ScrollToLine(first_visible)
event.Skip(False)
else:
event.Skip()