summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-06-09 15:36:50 +0200
committermathieui <mathieui@mathieui.net>2013-06-09 15:36:50 +0200
commit2668df740bd62945df3df5a42d4f39fcc740000a (patch)
tree8e9149f8e5f36ebe84438ae420b63b4ceb25b2c5 /src
parent103d097acf2e96392482677107852cd2b06550c8 (diff)
downloadpoezio-2668df740bd62945df3df5a42d4f39fcc740000a.tar.gz
poezio-2668df740bd62945df3df5a42d4f39fcc740000a.tar.bz2
poezio-2668df740bd62945df3df5a42d4f39fcc740000a.tar.xz
poezio-2668df740bd62945df3df5a42d4f39fcc740000a.zip
Fix #1892 (keep the contact selected in the roster)
Diffstat (limited to 'src')
-rw-r--r--src/windows.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/windows.py b/src/windows.py
index d046ddd7..33d7f55e 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -1829,6 +1829,8 @@ class RosterWin(Win):
for resource in contact.get_resources():
self.roster_cache.append(resource)
roster.last_built = datetime.now()
+ if self.selected_row in self.roster_cache:
+ self.pos = self.roster_cache.index(self.selected_row)
def refresh(self, roster):
"""
@@ -1846,6 +1848,8 @@ class RosterWin(Win):
y = 1
group = "none"
# draw the roster from the cache
+ if self.start_pos+self.height < self.pos:
+ self.start_pos = self.pos - (self.height//2)
for item in self.roster_cache[self.start_pos-1:self.start_pos+self.height]:
draw_selected = False