diff options
-rw-r--r-- | data/default_config.cfg | 6 | ||||
-rw-r--r-- | src/windows.py | 15 |
2 files changed, 18 insertions, 3 deletions
diff --git a/data/default_config.cfg b/data/default_config.cfg index 5284579f..a717fbc2 100644 --- a/data/default_config.cfg +++ b/data/default_config.cfg @@ -198,6 +198,12 @@ vertical_tab_list_size = 20 vertical_tab_list_sort = desc +# Show the user list at the bottom when in a MUC +# (useful when you want to look at the bottom of the screen only) +# possible values: desc, asc +user_list_sort = desc + + # The nick of people who join, part, change their status, etc. in a MUC will # be displayed using their nick color if true. display_user_color_in_join_part = false diff --git a/src/windows.py b/src/windows.py index 91363f26..542c027d 100644 --- a/src/windows.py +++ b/src/windows.py @@ -222,15 +222,24 @@ class UserList(Win): log.debug('Refresh: %s',self.__class__.__name__) with g_lock: self._win.erase() - y = 0 - users = sorted(users) + if config.get('user_list_sort', 'desc').lower() == 'asc': + y, x = self._win.getmaxyx() + y -= 1 + users = sorted(users, reverse=True) + else: + y = 0 + users = sorted(users) + if self.pos >= len(users) and self.pos != 0: self.pos = len(users)-1 for user in users[self.pos:]: self.draw_role_affiliation(y, user) self.draw_status_chatstate(y, user) self.addstr(y, 2, user.nick[:self.width-2], to_curses_attr(user.color)) - y += 1 + if config.get('user_list_sort', 'desc').lower() == 'asc': + y -= 1 + else: + y += 1 if y == self.height: break # draw indicators of position in the list |