summaryrefslogtreecommitdiff
path: root/src/tabs/basetabs.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-05-03 02:27:19 +0200
committermathieui <mathieui@mathieui.net>2014-05-03 02:27:19 +0200
commitb46f0f5e266c321632738ca40839759486b47a7e (patch)
tree83ecb7a530dfc6bf9eb5af45b75407bf8d142f4d /src/tabs/basetabs.py
parentea935ded091571ffec14fc020176c6a03f269efc (diff)
downloadpoezio-b46f0f5e266c321632738ca40839759486b47a7e.tar.gz
poezio-b46f0f5e266c321632738ca40839759486b47a7e.tar.bz2
poezio-b46f0f5e266c321632738ca40839759486b47a7e.tar.xz
poezio-b46f0f5e266c321632738ca40839759486b47a7e.zip
Fix #2072 (only resize a tab if the size changed since the last display)
Diffstat (limited to 'src/tabs/basetabs.py')
-rw-r--r--src/tabs/basetabs.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/tabs/basetabs.py b/src/tabs/basetabs.py
index 9759431d..84469df4 100644
--- a/src/tabs/basetabs.py
+++ b/src/tabs/basetabs.py
@@ -95,10 +95,10 @@ class Tab(object):
self._state = 'normal'
self._prev_state = None
- self.need_resize = False
self.key_func = {} # each tab should add their keys in there
# and use them in on_input
self.commands = {} # and their own commands
+ self._saved_size = (-1, -1)
@property
@@ -184,6 +184,13 @@ class Tab(object):
elif not self._prev_state:
self._state = 'normal'
+ def push_size(self):
+ self._saved_size = (self.height, self.width)
+
+ @property
+ def need_resize(self):
+ return self._saved_size != (self.height, self.width)
+
@staticmethod
def resize(scr):
with g_lock: