From: Armaan Bhojwani Date: Sat, 13 Feb 2021 04:03:58 +0000 (-0500) Subject: Move percent done from right to left X-Git-Tag: v0.7.0~39 X-Git-Url: https://git.armaanb.net/?p=lightcards.git;a=commitdiff_plain;h=b3a470553937ee816bf585bee5a1466bb0d8a28b Move percent done from right to left --- diff --git a/lightcards/display.py b/lightcards/display.py index 0b7fbd5..50b7418 100644 --- a/lightcards/display.py +++ b/lightcards/display.py @@ -306,11 +306,6 @@ class Display: else: star_color = curses.color_pair(1) - progress = ( - f"[{percent}% (" - f"{str(self.obj.index).zfill(len(str(len(self.stack))))})]" - ) - # Compose bar text bar_start = "[" bar_middle = self.current_card().printStar() @@ -333,9 +328,15 @@ class Display: curses.color_pair(1), ) + progress = ( + f"[{percent}% (" + f"{str(self.obj.index + 1).zfill(len(str(len(self.stack))))}" + f"/{str(len(self.stack))})] " + ) + self.win.addstr( height + 1, - mcols - len(progress) - 1, + 0, progress, curses.color_pair(1), ) @@ -345,12 +346,14 @@ class Display: self.obj.index / (len(self.stack) - 1) * (mcols - len(progress)) - - 2 + - 1 ) ): # TODO: Use the variying width unicode block characters to make a # super accurate bar - self.win.addch(height + 1, i, "»", curses.color_pair(1)) + self.win.addch( + height + 1, i + len(progress), "»", curses.color_pair(1) + ) def wrap_width(self): """Calculate the width at which the body text should wrap"""