From 7d6d9d88eb070ca8e488400286225a0d64ddcacf Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Sat, 16 Jun 2018 14:56:20 +1000 Subject: [PATCH] Made the cursor always white. - With the dimmer status colors a white cursor always stands out. - Also made yellow a little darker to help. --- tests/golden-files/help | 2 +- vigil/__main__.py | 6 ++---- vigil/termstr.py | 2 ++ vigil/tools.py | 9 +-------- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/tests/golden-files/help b/tests/golden-files/help index cb8d541..b8ce8e7 100644 --- a/tests/golden-files/help +++ b/tests/golden-files/help @@ -31,7 +31,7 @@ │ (B (B Problem │ │ (B (B Not applicable │ │ (B (B Running │ -│ (B (B Paused │ +│ (B (B Paused │ │ (B (B Timed out │ │ . Pending │ │ (BE(B Error │ diff --git a/vigil/__main__.py b/vigil/__main__.py index 6605fe4..0d1d0bd 100755 --- a/vigil/__main__.py +++ b/vigil/__main__.py @@ -98,10 +98,8 @@ class Entry(collections.UserList): result_selected = self.widget[self.highlighted] status_color = tools._STATUS_COLORS.get( result_selected.status, None) - fg_color = tools.STATUS_CURSOR_COLORS.get(result_selected.status, - termstr.Color.white) return fill3.Text(termstr.TermStr("+", termstr.CharStyle( - fg_color=fg_color, bg_color=status_color))) + fg_color=termstr.Color.white, bg_color=status_color))) def appearance_min(self): # 'appearance' local variable exists because appearance_cache can @@ -894,7 +892,7 @@ class Screen: progress_bar_size): ordering_text = "directory" if is_directory_sort else "type " paused_indicator = (termstr.TermStr("paused ").fg_color( - termstr.Color.yellow) if is_paused else termstr.TermStr("running"). + termstr.Color.dark_yellow) if is_paused else termstr.TermStr("running"). fg_color(termstr.Color.light_blue)) indicators = " " + paused_indicator + f" order:{ordering_text} " spacing = " " * (width - len(self._STATUS_BAR) - len(indicators)) diff --git a/vigil/termstr.py b/vigil/termstr.py index 48ccd96..e87d710 100644 --- a/vigil/termstr.py +++ b/vigil/termstr.py @@ -43,6 +43,8 @@ class Color: dark_red = (139, 0, 0) lime = (0, 255, 0) yellow = (255, 255, 0) + dark_yellow = (255, 211, 0) + # dark_yellow = (204, 204, 0) grey_50 = (50, 50, 50) grey_100 = (100, 100, 100) grey_150 = (150, 150, 150) diff --git a/vigil/tools.py b/vigil/tools.py index e9ce3a3..5c060ed 100644 --- a/vigil/tools.py +++ b/vigil/tools.py @@ -58,7 +58,7 @@ _STATUS_COLORS = {Status.ok: termstr.Color.green, Status.normal: termstr.Color.grey_150, Status.not_applicable: termstr.Color.grey_100, Status.running: termstr.Color.light_blue, - Status.paused: termstr.Color.yellow, + Status.paused: termstr.Color.dark_yellow, Status.timed_out: termstr.Color.purple} STATUS_MEANINGS = [ (Status.normal, "Normal"), (Status.ok, "Ok"), @@ -73,13 +73,6 @@ _STATUS_TO_TERMSTR = { _STATUS_TO_TERMSTR[Status.error] = termstr.TermStr( "E", termstr.CharStyle(bg_color=termstr.Color.red)) _STATUS_TO_TERMSTR[Status.pending] = "." -STATUS_CURSOR_COLORS = {Status.ok: termstr.Color.black, - Status.problem: termstr.Color.white, - Status.normal: termstr.Color.black, - Status.not_applicable: termstr.Color.white, - Status.running: termstr.Color.white, - Status.paused: termstr.Color.black, - Status.timed_out: termstr.Color.white} def get_ls_color_codes():