summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-02-03 05:34:12 +0100
committerhut <hut@lavabit.com>2013-02-03 05:34:12 +0100
commit229a1487ce27feccf0bf0e1c99d476736384ad18 (patch)
treec948cae32ba4b3e9e42fa318030b77420f084b5b
parent78a5a5c0267d97a3c30cc9db8b715a9b0df0d7af (diff)
downloadranger-229a1487ce27feccf0bf0e1c99d476736384ad18.tar.gz
widgets.pager: draw the image at the very end
-rw-r--r--ranger/gui/widgets/browserview.py2
-rw-r--r--ranger/gui/widgets/pager.py19
2 files changed, 11 insertions, 10 deletions
diff --git a/ranger/gui/widgets/browserview.py b/ranger/gui/widgets/browserview.py
index 0f74931e..e4ab2166 100644
--- a/ranger/gui/widgets/browserview.py
+++ b/ranger/gui/widgets/browserview.py
@@ -108,6 +108,7 @@ class BrowserView(Widget, DisplayableContainer):
 				self.fm.ui.win.move(self.main_column.y, self.main_column.x)
 			except:
 				pass
+			self.pager.draw_image()
 		else:
 			try:
 				x = self.main_column.x
@@ -116,6 +117,7 @@ class BrowserView(Widget, DisplayableContainer):
 				self.fm.ui.win.move(y, x)
 			except:
 				pass
+			self.columns[-1].draw_image()
 
 	def _draw_borders(self):
 		win = self.win
diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py
index 0945021e..ffb4a647 100644
--- a/ranger/gui/widgets/pager.py
+++ b/ranger/gui/widgets/pager.py
@@ -64,18 +64,9 @@ class Pager(Widget):
 		self.need_redraw = True
 
 		if self.need_redraw:
-			self.win.erase()
-
 			self.clear_image()
 
-			if self.image:
-				self.source = None
-				self.fm.ui.win.refresh()
-				try:
-					img_display.draw(self.image, self.x, self.y, self.wid, self.hei)
-				except Exception as e:
-					self.fm.notify(e, bad=True)
-			else:
+			if not self.image:
 				line_gen = self._generate_lines(
 						starty=self.scroll_begin, startx=self.startx)
 
@@ -84,6 +75,14 @@ class Pager(Widget):
 
 			self.need_redraw = False
 
+	def draw_image(self):
+		if self.image:
+			self.source = None
+			try:
+				img_display.draw(self.image, self.x, self.y, self.wid, self.hei)
+			except Exception as e:
+				self.fm.notify(e, bad=True)
+
 	def _draw_line(self, i, line):
 		if self.markup is None:
 			self.addstr(i, 0, line)