diff options
author | hut <hut@lavabit.com> | 2009-12-29 16:47:28 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2009-12-29 16:47:28 +0100 |
commit | 23c450bf891ddf1da7ebee326e7fb1248448e84c (patch) | |
tree | 25ef2b21a134f72c8752dab6f10b8cdb5347fb7c | |
parent | 3f77e62a6dc8b700a736b5d0a7e9cf51dd0018df (diff) | |
download | ranger-23c450bf891ddf1da7ebee326e7fb1248448e84c.tar.gz |
be less strict with resizes
-rw-r--r-- | ranger/gui/displayable.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ranger/gui/displayable.py b/ranger/gui/displayable.py index 404f66a0..6ce81df5 100644 --- a/ranger/gui/displayable.py +++ b/ranger/gui/displayable.py @@ -136,8 +136,8 @@ class Displayable(EnvironmentAware, FileManagerAware, SettingsAware): if x < 0 or y < 0: raise OutOfBoundsException("Starting point below zero!") - if wid < 1 or hei < 1: - raise OutOfBoundsException("WID and HEI must be >=1!") + #if wid < 1 or hei < 1: + # raise OutOfBoundsException("WID and HEI must be >=1!") if x + wid > maxx and y + hei > maxy: raise OutOfBoundsException("X and Y out of bounds!") @@ -155,23 +155,27 @@ class Displayable(EnvironmentAware, FileManagerAware, SettingsAware): # Not enough space for resizing... try: self.win.mvderwin(0, 0) + self.absy, self.absx = self.win.getbegyx() self.win.resize(hei, wid) except: - raise OutOfBoundsException("Resizing Failed!") + pass + #raise OutOfBoundsException("Resizing Failed!") if y != self.absy or x != self.absx: - self.win.mvderwin(y, x) + try: + self.win.mvderwin(y, x) + except: + pass self.yy, self.xx = y, x if self.parent: self.yy += self.parent.yy self.xx += self.parent.xx - self.absy, self.absx = y, x + self.absy, self.absx = self.win.getbegyx() self.x = 0 self.y = 0 - self.wid = wid - self.hei = hei + self.hei, self.wid = self.win.getmaxyx() class DisplayableContainer(Displayable): |