From 455b1e06dd8b738a63eedaef100b1a6de95b542e Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Sat, 30 Jan 2021 20:43:44 -0500 Subject: [PATCH] Update status bar --- lightcards/display.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/lightcards/display.py b/lightcards/display.py index 86740d6..349d77a 100755 --- a/lightcards/display.py +++ b/lightcards/display.py @@ -16,19 +16,20 @@ def disp_card(stdscr, stack, headers, obj): stdscr.addstr("\n" + str(stack[obj.getIdx()][obj.getSide()])) (mlines, mcols) = stdscr.getmaxyx() - mlines -= 1 - mcols -= 5 - try: - stdscr.insch(mlines, mcols, str(obj.getIdx() + 1)) - stdscr.insch(mlines, mcols+1, '-') - if obj.getSide() == 0: - stdscr.insch(mlines, mcols+2, '1') - else: - stdscr.insch(mlines, mcols+2, '2') - stdscr.insch(mlines, mcols+3, '/') - stdscr.insch(mlines, mcols+4, str(len(stack))) - stdscr.insstr(mlines, 1, stack[obj.getIdx()].getStar()) + stdscr.insstr(mlines - 1, 1, + "[" + + stack[obj.getIdx()].getStar() + + "] [" + + str(round(obj.getIdx() / (len(stack) - 1) * 100)).zfill(3) + + "% (" + + str(obj.getIdx() + 1) + + "/" + + str(len(stack)) + + ")]" + + " [" + + headers[obj.getSide()] + + "]") except Exception: pass -- 2.39.2