From: Armaan Bhojwani Date: Sun, 31 Jan 2021 01:43:44 +0000 (-0500) Subject: Update status bar X-Git-Tag: v0.1.0~10 X-Git-Url: https://git.armaanb.net/?p=lightcards.git;a=commitdiff_plain;h=455b1e06dd8b738a63eedaef100b1a6de95b542e Update status bar --- 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