Skip to content

Commit

Permalink
widget.browserview: fixed padding_right option
Browse files Browse the repository at this point in the history
kind of dirty. need to find a way to hide windows completely
when not needed. ;o;
  • Loading branch information
hut committed Dec 21, 2010
1 parent ad13a31 commit 3fd5f5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ranger/gui/widgets/browsercolumn.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ def has_preview(self):
def poke(self):
Widget.poke(self)
self.target = self.env.at_level(self.level)
if self.target and self.target.is_file and self.has_preview():
self.visible = True

def draw(self):
"""Call either _draw_file() or _draw_directory()"""
Expand Down
4 changes: 4 additions & 0 deletions ranger/gui/widgets/browserview.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ def resize(self, y, x, hei, wid):
if i == last_i:
if not cut_off:
wid = int(self.wid - left + 1 - pad)
else:
self.columns[i].resize(pad, left - 1, hei - pad * 2, 1)
self.columns[i].visible = False
continue

if i == last_i - 1:
self.pager.resize(pad, left, hei - pad * 2, \
Expand Down

0 comments on commit 3fd5f5c

Please sign in to comment.