summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@hut.pm>2017-07-16 07:11:47 +0200
committerhut <hut@hut.pm>2017-07-16 07:11:47 +0200
commit0ebabf81cbab14301a81de0a28ba7da6fe153c3d (patch)
tree0fd771ed5188c6808f3e44dc11c0512197aeaad4 /ranger
parent5c0555501aeb32301dacd4bf1c973b216b207644 (diff)
downloadranger-0ebabf81cbab14301a81de0a28ba7da6fe153c3d.tar.gz
widgets.statusbar: add visual indicator for "freeze_files" option
Diffstat (limited to 'ranger')
-rw-r--r--ranger/colorschemes/default.py3
-rw-r--r--ranger/gui/context.py2
-rw-r--r--ranger/gui/ui.py4
-rw-r--r--ranger/gui/widgets/statusbar.py5
4 files changed, 13 insertions, 1 deletions
diff --git a/ranger/colorschemes/default.py b/ranger/colorschemes/default.py
index 7d2b124f..c88cdc7c 100644
--- a/ranger/colorschemes/default.py
+++ b/ranger/colorschemes/default.py
@@ -98,6 +98,9 @@ class Default(ColorScheme):
             if context.marked:
                 attr |= bold | reverse
                 fg = yellow
+            if context.frozen:
+                attr |= bold | reverse
+                fg = cyan
             if context.message:
                 if context.bad:
                     attr |= bold
diff --git a/ranger/gui/context.py b/ranger/gui/context.py
index 7c7f1727..d8d1957c 100644
--- a/ranger/gui/context.py
+++ b/ranger/gui/context.py
@@ -16,7 +16,7 @@ CONTEXT_KEYS = [
     'good', 'bad',
     'space', 'permissions', 'owner', 'group', 'mtime', 'nlink',
     'scroll', 'all', 'bot', 'top', 'percentage', 'filter',
-    'flat', 'marked', 'tagged', 'tag_marker', 'cut', 'copied',
+    'flat', 'marked', 'tagged', 'tag_marker', 'cut', 'copied', 'frozen',
     'help_markup',  # COMPAT
     'seperator', 'key', 'special', 'border',  # COMPAT
     'title', 'text', 'highlight', 'bars', 'quotes', 'tab', 'loaded',
diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py
index 5d53603f..5877e484 100644
--- a/ranger/gui/ui.py
+++ b/ranger/gui/ui.py
@@ -102,6 +102,7 @@ class UI(  # pylint: disable=too-many-instance-attributes,too-many-public-method
             pass
 
         self.settings.signal_bind('setopt.mouse_enabled', _setup_mouse)
+        self.settings.signal_bind('setopt.freeze_files', self.redraw_statusbar)
         _setup_mouse(dict(value=self.settings.mouse_enabled))
 
         if not self.is_set_up:
@@ -452,6 +453,9 @@ class UI(  # pylint: disable=too-many-instance-attributes,too-many-public-method
     def redraw_main_column(self):
         self.browser.main_column.need_redraw = True
 
+    def redraw_statusbar(self):
+        self.status.need_redraw = True
+
     def close_taskview(self):
         self.taskview.visible = False
         self.browser.visible = True
diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py
index 980945dc..266d48ca 100644
--- a/ranger/gui/widgets/statusbar.py
+++ b/ranger/gui/widgets/statusbar.py
@@ -302,6 +302,11 @@ class StatusBar(Widget):  # pylint: disable=too-many-instance-attributes
         else:
             right.add('0/0  All', base, 'all')
 
+        if self.settings.freeze_files:
+            # Indicate that files are frozen and will not be loaded
+            right.add("  ", "space")
+            right.add('FROZEN', base, 'frozen')
+
     def _print_result(self, result):
         self.win.move(0, 0)
         for part in result: