summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-12-21 23:08:41 +0100
committerhut <hut@lavabit.com>2010-12-21 23:12:43 +0100
commit3fd5f5caf66d8c3ddd34dd0d3b44855f42e2c250 (patch)
treec5258929315c2933289894ca969a7c146eb47442
parentad13a3136975b7a1dd7f1c17cc1c637dfb33357f (diff)
downloadranger-3fd5f5caf66d8c3ddd34dd0d3b44855f42e2c250.tar.gz
widget.browserview: fixed padding_right option
kind of dirty. need to find a way to hide windows completely
when not needed. ;o;
-rw-r--r--ranger/gui/widgets/browsercolumn.py2
-rw-r--r--ranger/gui/widgets/browserview.py4
2 files changed, 6 insertions, 0 deletions
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, \