summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/gui/widgets/browserview.py5
-rw-r--r--ranger/gui/widgets/pager.py4
2 files changed, 4 insertions, 5 deletions
diff --git a/ranger/gui/widgets/browserview.py b/ranger/gui/widgets/browserview.py
index 1c6fc802..7d48eb59 100644
--- a/ranger/gui/widgets/browserview.py
+++ b/ranger/gui/widgets/browserview.py
@@ -343,7 +343,6 @@ class BrowserView(Widget, DisplayableContainer):
         if self.preview and self.is_collapsed != self._collapse():
             if (self.fm.settings.preview_images and
                 self.fm.settings.preview_files):
-                pager = self.columns[-1]
-                pager.need_clear_image = True
-                pager.clear_image()
+                # force clearing the image when resizing preview column
+                self.columns[-1].clear_image(force=True)
             self.resize(self.y, self.x, self.hei, self.wid)
diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py
index 83b2e6f9..de73ddc2 100644
--- a/ranger/gui/widgets/pager.py
+++ b/ranger/gui/widgets/pager.py
@@ -39,8 +39,8 @@ class Pager(Widget):
         self.startx = 0
         self.need_redraw = True
 
-    def clear_image(self):
-        if self.need_clear_image:
+    def clear_image(self, force=False):
+        if force or self.need_clear_image:
             img_display.clear(self.x, self.y, self.wid, self.hei)
             self.need_clear_image = False
             self.image_drawn = False