Do not limit the size of the windows, fixes #2246

This commit is contained in:
Florent Le Coz 2011-09-20 21:21:26 +02:00
parent 324fcf817c
commit 6debaa6c3f
2 changed files with 2 additions and 11 deletions

View file

@ -13,9 +13,6 @@ Each Tab object has different refresh() and resize() methods, defining how its
Windows are displayed, resized, etc Windows are displayed, resized, etc
""" """
MIN_WIDTH = 50
MIN_HEIGHT = 22
import logging import logging
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -89,10 +86,7 @@ class Tab(object):
@staticmethod @staticmethod
def resize(scr): def resize(scr):
Tab.size = (Tab.height, Tab.width) = scr.getmaxyx() Tab.size = (Tab.height, Tab.width) = scr.getmaxyx()
if Tab.height < MIN_HEIGHT or Tab.width < MIN_WIDTH: Tab.visible = True
Tab.visible = False
else:
Tab.visible = True
def complete_commands(self, the_input): def complete_commands(self, the_input):
""" """

View file

@ -30,9 +30,6 @@ from contact import Contact, Resource
from roster import RosterGroup, roster from roster import RosterGroup, roster
from poopt import cut_text from poopt import cut_text
# from message import Line
from tabs import MIN_WIDTH, MIN_HEIGHT
from sleekxmpp.xmlstream.stanzabase import JID from sleekxmpp.xmlstream.stanzabase import JID
import core import core
@ -69,8 +66,8 @@ class Win(object):
if not self._win: if not self._win:
self._win = curses.newwin(height, width, y, x) self._win = curses.newwin(height, width, y, x)
else: else:
self._win.resize(height, width)
try: try:
self._win.resize(height, width)
self._win.mvwin(y, x) self._win.mvwin(y, x)
except: except:
log.debug('DEBUG: mvwin returned ERR. Please investigate') log.debug('DEBUG: mvwin returned ERR. Please investigate')