From 11e3add379562764d59982bc5dd0a0682a336509 Mon Sep 17 00:00:00 2001 From: Ethan Kiang Date: Thu, 5 Nov 2020 21:13:46 +0800 Subject: Use "draw_borders_multipane" instead and "draw_borders" as fallback --- ranger/container/settings.py | 1 + ranger/gui/widgets/view_multipane.py | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ranger/container/settings.py b/ranger/container/settings.py index b38b31b5..67b4d3b8 100644 --- a/ranger/container/settings.py +++ b/ranger/container/settings.py @@ -40,6 +40,7 @@ ALLOWED_SETTINGS = { "display_free_space_in_status_bar": bool, 'display_tags_in_all_columns': bool, 'draw_borders': str, + 'draw_borders_multipane': str, 'draw_progress_bar_in_status_bar': bool, 'flushinput': bool, 'freeze_files': bool, diff --git a/ranger/gui/widgets/view_multipane.py b/ranger/gui/widgets/view_multipane.py index 923c077f..f55687d5 100644 --- a/ranger/gui/widgets/view_multipane.py +++ b/ranger/gui/widgets/view_multipane.py @@ -17,7 +17,10 @@ class ViewMultipane(ViewBase): # pylint: disable=too-many-ancestors self.fm.signal_bind('tab.change', self._tabchange_handler) self.rebuild() - self.old_draw_borders = self.settings.draw_borders + self.old_draw_borders = self._draw_borders_setting() + + def _draw_borders_setting(self): + return self.settings.draw_borders_multipane or self.settings.draw_borders def _layoutchange_handler(self): if self.fm.ui.browser == self: @@ -54,8 +57,8 @@ class ViewMultipane(ViewBase): # pylint: disable=too-many-ancestors ViewBase.draw(self) - if self.settings.draw_borders: - draw_borders = self.settings.draw_borders.lower() + if self._draw_borders_setting(): + draw_borders = self._draw_borders_setting() if draw_borders in ['both', 'true']: # 'true' for backwards compat. border_types = ['separators', 'outline'] else: @@ -123,7 +126,7 @@ class ViewMultipane(ViewBase): # pylint: disable=too-many-ancestors def resize(self, y, x, hei=None, wid=None): ViewBase.resize(self, y, x, hei, wid) - border_type = self.settings.draw_borders.lower() + border_type = self._draw_borders_setting() if border_type in ['outline', 'both', 'true', 'active-pane']: # 'true' for backwards compat., no height pad needed for 'separators' pad = 1 @@ -141,6 +144,6 @@ class ViewMultipane(ViewBase): # pylint: disable=too-many-ancestors def poke(self): ViewBase.poke(self) - if self.old_draw_borders != self.settings.draw_borders: + if self.old_draw_borders != self._draw_borders_setting(): self.resize(self.y, self.x, self.hei, self.wid) - self.old_draw_borders = self.settings.draw_borders + self.old_draw_borders = self._draw_borders_setting() -- cgit 1.4.1-2-gfad0