Browse Source

add a color pair for qr code

283
ThomasV 9 years ago
parent
commit
47e5bd653a
  1. 5
      gui/text.py

5
gui/text.py

@ -35,6 +35,7 @@ class ElectrumGui:
curses.use_default_colors()
curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLUE)
curses.init_pair(2, curses.COLOR_WHITE, curses.COLOR_CYAN)
curses.init_pair(3, curses.COLOR_BLACK, curses.COLOR_WHITE);
self.stdscr.keypad(1)
self.stdscr.border(0)
self.maxy, self.maxx = self.stdscr.getmaxyx()
@ -181,12 +182,12 @@ class ElectrumGui:
s = StringIO.StringIO()
self.qr = qrcode.QRCode()
self.qr.add_data(data)
self.qr.print_ascii(out=s, invert=True)
self.qr.print_ascii(out=s, invert=False)
msg = s.getvalue()
lines = msg.split('\n')
for i, l in enumerate(lines):
l = l.encode("utf-8")
self.stdscr.addstr(i+5, 5, l)
self.stdscr.addstr(i+5, 5, l, curses.color_pair(3))
def print_list(self, list, firstline = None):
self.maxpos = len(list)

Loading…
Cancel
Save