From 8e6eb9eb5f8f879818565f7f2255af53896671d6 Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Sun, 31 Jan 2021 14:02:30 -0500 Subject: [PATCH] Print yellow in the footer if card is starred --- lightcards/display.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lightcards/display.py b/lightcards/display.py index d541a12..8e7bba4 100755 --- a/lightcards/display.py +++ b/lightcards/display.py @@ -20,11 +20,15 @@ def disp_bar(stdscr, stack, headers, obj): else: percent = str(round(obj.getIdx() / (len(stack) - 1) * 100)).zfill(3) + # Print yellow if starred + stdscr.addstr(mlines - 1, 0, "[", curses.color_pair(1)) + if stack[obj.getIdx()].getStar(): + stdscr.addstr(stack[obj.getIdx()].printStar(), curses.color_pair(3)) + else: + stdscr.addstr(stack[obj.getIdx()].printStar(), curses.color_pair(1)) + # Put all the info together - stdscr.insstr(mlines - 1, 0, - "[" + - stack[obj.getIdx()].printStar() + - "] [" + + stdscr.addstr("] [" + percent + "% (" + str(obj.getIdx() + 1).zfill(len(str(len(stack)))) + @@ -167,6 +171,7 @@ def init_disp(stdscr, stack, headers, idx): curses.curs_set(0) # Hide cursor curses.init_pair(1, curses.COLOR_CYAN, 0) curses.init_pair(2, curses.COLOR_RED, 0) + curses.init_pair(3, curses.COLOR_YELLOW, 0) get_key(stdscr, stack, headers, idx) -- 2.39.2