X-Git-Url: https://git.armaanb.net/?p=lightcards.git;a=blobdiff_plain;f=lightcards%2Fdisplay.py;h=50b741808b14dc0ed18ed417c528322ac83cb2f1;hp=0b7fbd59af5db2fd02835f8b9f89de4f72ed4ed0;hb=b3a470553937ee816bf585bee5a1466bb0d8a28b;hpb=c48140e31b1210c0a684c3a68dfeac4466e994d8 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"""