summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-12-22 01:59:00 +0100
committerhut <hut@lavabit.com>2010-12-22 02:11:15 +0100
commitcc69d0d8867b02ea8c9fa96a58e46a2ce31b24ce (patch)
treee8903119efaac4918ace1efc7292cccfa7594e93 /ranger
parentf1505e09b1d9e4cee9fcd7e6521d2caac91ccce7 (diff)
downloadranger-cc69d0d8867b02ea8c9fa96a58e46a2ce31b24ce.tar.gz
widgets.browserview: Cleaner solution for commit 3fd5f5caf6
Diffstat (limited to 'ranger')
-rw-r--r--ranger/gui/widgets/browsercolumn.py2
-rw-r--r--ranger/gui/widgets/browserview.py8
2 files changed, 8 insertions, 2 deletions
diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py
index c0d22658..5422b960 100644
--- a/ranger/gui/widgets/browsercolumn.py
+++ b/ranger/gui/widgets/browsercolumn.py
@@ -113,8 +113,6 @@ 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 54fc28f2..2be3ca92 100644
--- a/ranger/gui/widgets/browserview.py
+++ b/ranger/gui/widgets/browserview.py
@@ -289,5 +289,13 @@ class BrowserView(Widget, DisplayableContainer):
 
 	def poke(self):
 		DisplayableContainer.poke(self)
+
+		# Show the preview column when it has a preview but has
+		# been hidden (e.g. because of padding_right = False)
+		if not self.pager.visible and not self.columns[-1].visible and \
+		self.columns[-1].target and self.columns[-1].target.is_directory \
+		or self.columns[-1].has_preview():
+			self.columns[-1].visible = True
+
 		if self.preview and self.is_collapsed != self._collapse():
 			self.resize(self.y, self.x, self.hei, self.wid)