about 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)
26e9a1a7f4e0cfec4213587'>ce2c1efc ^
c504ca56 ^

7328af20 ^















ce2c1efc ^
7328af20 ^















91624dba ^
7328af20 ^
c504ca56 ^











7328af20 ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73