summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-09-11 04:22:04 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-09-11 04:22:04 +0200
commitb7b1faebdb52e8f041867f19f29a08f64cfaf220 (patch)
tree180c45399c1907c853bdf25585ec203c04fc8e9e /src/tabs.py
parent78c216cd61ab96f7476ce194323517b73b8ee04c (diff)
parentce1fb8af014e90cfc7378022c8cbdd134e45ed4a (diff)
downloadpoezio-b7b1faebdb52e8f041867f19f29a08f64cfaf220.tar.gz
poezio-b7b1faebdb52e8f041867f19f29a08f64cfaf220.tar.bz2
poezio-b7b1faebdb52e8f041867f19f29a08f64cfaf220.tar.xz
poezio-b7b1faebdb52e8f041867f19f29a08f64cfaf220.zip
merge
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 9e55deff..c336adcd 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -14,7 +14,7 @@ Windows are displayed, resized, etc
"""
MIN_WIDTH = 50
-MIN_HEIGHT = 16
+MIN_HEIGHT = 22
import logging
log = logging.getLogger(__name__)
@@ -89,6 +89,10 @@ class Tab(object):
@staticmethod
def resize(scr):
Tab.size = (Tab.height, Tab.width) = scr.getmaxyx()
+ if Tab.height < MIN_HEIGHT or Tab.width < MIN_WIDTH:
+ Tab.visible = False
+ else:
+ Tab.visible = True
def complete_commands(self, the_input):
"""
@@ -671,6 +675,8 @@ class MucTab(ChatTab):
"""
Resize the whole window. i.e. all its sub-windows
"""
+ if not self.visible:
+ return
text_width = (self.width//10)*9
self.topic_win.resize(1, self.width, 0, 0)
self.v_separator.resize(self.height-3, 1, 1, 9*(self.width//10))
@@ -1018,7 +1024,7 @@ class PrivateTab(ChatTab):
self.core.close_tab()
def resize(self):
- if self.core.information_win_size >= self.height-3:
+ if self.core.information_win_size >= self.height-3 or not self.visible:
return
self.text_win.resize(self.height-3-self.core.information_win_size, self.width, 0, 0)
self.text_win.rebuild_everything(self._room)
@@ -1165,6 +1171,8 @@ class RosterInfoTab(Tab):
self.resize()
def resize(self):
+ if not self.visible:
+ return
roster_width = self.width//2
info_width = self.width-roster_width-1
self.v_separator.resize(self.height-2, 1, 0, roster_width)
@@ -1518,7 +1526,7 @@ class ConversationTab(ChatTab):
self.core.close_tab()
def resize(self):
- if self.core.information_win_size >= self.height-3:
+ if self.core.information_win_size >= self.height-3 or not self.visible:
return
self.text_win.resize(self.height-4-self.core.information_win_size, self.width, 1, 0)
self.text_win.rebuild_everything(self._room)
@@ -1635,6 +1643,8 @@ class MucListTab(Tab):
self.input.refresh()
def resize(self):
+ if not self.visible:
+ return
self.upper_message.resize(1, self.width, 0, 0)
column_size = {'node-part': (self.width-5)//4,
'name': (self.width-5)//4*3,
@@ -1761,6 +1771,8 @@ class SimpleTextTab(Tab):
self.core.close_tab()
def resize(self):
+ if not self.visible:
+ return
self.text_win.resize(self.height-2, self.width, 0, 0)
self.input.resize(1, self.width, self.height-1, 0)