From 3fd5f5caf66d8c3ddd34dd0d3b44855f42e2c250 Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 21 Dec 2010 23:08:41 +0100 Subject: widget.browserview: fixed padding_right option kind of dirty. need to find a way to hide windows completely when not needed. ;o; --- ranger/gui/widgets/browsercolumn.py | 2 ++ ranger/gui/widgets/browserview.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py index 5422b960..c0d22658 100644 --- a/ranger/gui/widgets/browsercolumn.py +++ b/ranger/gui/widgets/browsercolumn.py @@ -113,6 +113,8 @@ class BrowserColumn(Pager): 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()""" diff --git a/ranger/gui/widgets/browserview.py b/ranger/gui/widgets/browserview.py index a4626412..54fc28f2 100644 --- a/ranger/gui/widgets/browserview.py +++ b/ranger/gui/widgets/browserview.py @@ -235,6 +235,10 @@ class BrowserView(Widget, DisplayableContainer): 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, \ -- cgit 1.4.1-2-gfad0