]> git.armaanb.net Git - lightcards.git/blobdiff - lightcards/display.py
Add ability to star cards
[lightcards.git] / lightcards / display.py
index 42a01f220d2e57228f097925cda50bea07bb2a14..86740d6421b43f0ef6f2b5a9426216687305fc2b 100755 (executable)
@@ -28,6 +28,7 @@ def disp_card(stdscr, stack, headers, obj):
             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())
     except Exception:
         pass
 
@@ -53,5 +54,8 @@ def get_key(stdscr, stack, headers):
             elif key in ["j", "k", "KEY_UP", "KEY_DOWN"]:
                 idx.flip()
                 disp_card(stdscr, stack, headers, idx)
+            elif key in ["i", "/"]:
+                stack[idx.getIdx()].toggleStar()
+                disp_card(stdscr, stack, headers, idx)
         except Exception:
             pass