From 16ac6f0bd6c71a886de23293018aab9c2fac4e64 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 24 Apr 2013 21:16:07 +0200 Subject: 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. --- ranger/core/actions.py | 12 +++++++++--- ranger/gui/ui.py | 2 ++ 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: -- cgit 1.4.1-2-gfad0