diff options
author | mathieui <mathieui@mathieui.net> | 2013-06-09 15:36:50 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2013-06-09 15:36:50 +0200 |
commit | 2668df740bd62945df3df5a42d4f39fcc740000a (patch) | |
tree | 8e9149f8e5f36ebe84438ae420b63b4ceb25b2c5 | |
parent | 103d097acf2e96392482677107852cd2b06550c8 (diff) | |
download | poezio-2668df740bd62945df3df5a42d4f39fcc740000a.tar.gz poezio-2668df740bd62945df3df5a42d4f39fcc740000a.tar.bz2 poezio-2668df740bd62945df3df5a42d4f39fcc740000a.tar.xz poezio-2668df740bd62945df3df5a42d4f39fcc740000a.zip |
Fix #1892 (keep the contact selected in the roster)
-rw-r--r-- | src/windows.py | 4 |
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 |