summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2012-11-30 13:47:11 +0100
committerFlorent Le Coz <louiz@louiz.org>2012-11-30 15:14:47 +0100
commit5bfbbb2c245ac8eb16268856d8c06559ced1a7fe (patch)
tree0dcf8084750134e9feb49bf4bcf4004e64964f74 /src
parent5db91443033d10af188206f6d5dc705bac22b0e8 (diff)
downloadpoezio-5bfbbb2c245ac8eb16268856d8c06559ced1a7fe.tar.gz
poezio-5bfbbb2c245ac8eb16268856d8c06559ced1a7fe.tar.bz2
poezio-5bfbbb2c245ac8eb16268856d8c06559ced1a7fe.tar.xz
poezio-5bfbbb2c245ac8eb16268856d8c06559ced1a7fe.zip
Add a hide_user_lits option that does what it says.
fix #2170
Diffstat (limited to 'src')
-rw-r--r--src/tabs.py19
-rw-r--r--src/windows.py2
2 files changed, 15 insertions, 6 deletions
diff --git a/src/tabs.py b/src/tabs.py
index a76489ea..0d99e19c 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -1157,12 +1157,15 @@ class MucTab(ChatTab):
if not self.visible:
return
self.need_resize = False
- text_width = (self.width//10)*9
+ if config.get("hide_user_list", "false") == "true":
+ text_width = self.width
+ else:
+ text_width = (self.width//10)*9
+ self.user_win.resize(self.height-3-self.core.information_win_size - Tab.tab_win_height(), self.width-(self.width//10)*9-1, 1, (self.width//10)*9+1)
self.topic_win.resize(1, self.width, 0, 0)
self.v_separator.resize(self.height-2 - Tab.tab_win_height(), 1, 1, 9*(self.width//10))
self.text_win.resize(self.height-3-self.core.information_win_size - Tab.tab_win_height(), text_width, 1, 0)
self.text_win.rebuild_everything(self._text_buffer)
- self.user_win.resize(self.height-3-self.core.information_win_size - Tab.tab_win_height(), self.width-text_width-1, 1, text_width+1)
self.info_header.resize(1, self.width, self.height-2-self.core.information_win_size - Tab.tab_win_height(), 0)
self.input.resize(1, self.width, self.height-1, 0)
@@ -1172,8 +1175,9 @@ class MucTab(ChatTab):
log.debug(' TAB Refresh: %s',self.__class__.__name__)
self.topic_win.refresh(self.get_single_line_topic())
self.text_win.refresh()
- self.v_separator.refresh()
- self.user_win.refresh(self.users)
+ if config.get("hide_user_list", "false") == "false":
+ self.v_separator.refresh()
+ self.user_win.refresh(self.users)
self.info_header.refresh(self, self.text_win)
self.refresh_tab_win()
self.info_win.refresh()
@@ -1248,10 +1252,13 @@ class MucTab(ChatTab):
def on_info_win_size_changed(self):
if self.core.information_win_size >= self.height-3:
return
- text_width = (self.width//10)*9
+ if config.get("hide_user_list", "false") == "true":
+ text_width = self.width
+ else:
+ text_width = (self.width//10)*9
+ self.user_win.resize(self.height-3-self.core.information_win_size - Tab.tab_win_height(), self.width-(self.width//10)*9-1, 1, (self.width//10)*9+1)
self.text_win.resize(self.height-3-self.core.information_win_size - Tab.tab_win_height(), text_width, 1, 0)
self.info_header.resize(1, self.width, self.height-2-self.core.information_win_size - Tab.tab_win_height(), 0)
- self.user_win.resize(self.height-3-self.core.information_win_size - Tab.tab_win_height(), self.width-text_width-1, 1, text_width+1)
def handle_presence(self, presence):
from_nick = presence['from'].resource
diff --git a/src/windows.py b/src/windows.py
index 751c6c39..1b23cd03 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -227,6 +227,8 @@ class UserList(Win):
def refresh(self, users):
log.debug('Refresh: %s',self.__class__.__name__)
+ if config.get("hide_user_list", "false") == "true":
+ return # do not refresh if this win is hidden.
with g_lock:
self._win.erase()
if config.get('user_list_sort', 'desc').lower() == 'asc':