summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/actions.py12
-rw-r--r--ranger/gui/ui.py2
2 files changed, 11 insertions, 3 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 0856c9f7..438b85e6 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -778,7 +778,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
         if not self.thisfile or not self.thisfile.is_file:
             return
 
-        pager = self.ui.open_embedded_pager()
+        pager = self.ui.open_pager()
         if self.settings.preview_images and self.thisfile.image:
             pager.set_image(self.thisfile.realpath)
         else:
@@ -795,7 +795,10 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
             return False
 
     def get_preview(self, file, width, height):
-        pager = self.ui.browser.pager
+        if self.ui.pager.visible:
+            pager = self.ui.pager
+        else:
+            pager = self.ui.browser.pager
         path = file.realpath
 
         if self.settings.preview_images and file.image:
@@ -869,7 +872,10 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
                     if self.thisfile and self.thisfile.realpath == path:
                         self.ui.browser.need_redraw = True
                     data['loading'] = False
-                    pager = self.ui.browser.pager
+                    if self.ui.pager.visible:
+                        pager = self.ui.pager
+                    else:
+                        pager = self.ui.browser.pager
                     if self.thisfile and self.thisfile.is_file:
                         pager.set_source(self.thisfile.get_preview_source(
                             pager.wid, pager.hei))
diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py
index 5c40509c..145e57c5 100644
--- a/ranger/gui/ui.py
+++ b/ranger/gui/ui.py
@@ -310,6 +310,8 @@ class UI(DisplayableContainer):
         """Finalize every object in container and refresh the window"""
         DisplayableContainer.finalize(self)
         self.win.refresh()
+        if self.pager.visible:
+            self.pager.draw_image()
 
     def close_pager(self):
         if self.console.visible: