From 81a1901d386fb36a3e14d9031621fbd8c156d106 Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Sat, 21 Dec 2019 12:50:46 +1000 Subject: [PATCH] Center the status bar. - Without any indicators on the right, the bar can be centered. --- eris/__main__.py | 3 +-- tests/golden-files/help | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/eris/__main__.py b/eris/__main__.py index 127e6de..e1b4243 100755 --- a/eris/__main__.py +++ b/eris/__main__.py @@ -963,8 +963,7 @@ class Screen: @functools.lru_cache(maxsize=2) def _get_status_bar_appearance(self, width, progress_bar_size): bar_transparency = 0.7 - spacing = " " * (width - len(self._STATUS_BAR)) - bar = (self._STATUS_BAR[:width] + spacing)[:width] + bar = self._STATUS_BAR.center(width)[:width] fraction, whole = math.modf(progress_bar_size) whole = int(whole) if whole < len(bar) and bar[whole].data == " ": diff --git a/tests/golden-files/help b/tests/golden-files/help index 47490f1..57aaa16 100644 --- a/tests/golden-files/help +++ b/tests/golden-files/help @@ -57,4 +57,4 @@ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ - help quit tab:focus turn log edit next order refresh fullscreen xdg-open  \ No newline at end of file + help quit tab:focus turn log edit next order refresh fullscreen xdg-open  \ No newline at end of file