summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-04-24 21:16:07 +0200
committerhut <hut@lavabit.com>2013-04-24 21:45:35 +0200
commit16ac6f0bd6c71a886de23293018aab9c2fac4e64 (patch)
tree6dfe2cbf2f84010dc117e17150928d190b274941 /ranger
parent05db678e26d6a3170026205bae8936133b84b1ef (diff)
downloadranger-16ac6f0bd6c71a886de23293018aab9c2fac4e64.tar.gz
core.actions: pressing "i" opens ui.pager, not ui.browser.pager
ui.pager makes use of the whole width,
ui.browser.pager "pushes" the main column away to the left.

The former seems more efficient to me for the "i" key.
Diffstat (limited to 'ranger')
-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: