Make horizontal lines go full length, and center headings
- def __init__(self, outer):
+ def __init__(self, outer, mlines=20, mcols=52):
"""Initialize help screen"""
self.outer = outer
"""Initialize help screen"""
self.outer = outer
- (self.win, self.panel) = panel_create(20, 52)
+ (self.win, self.panel) = panel_create(mlines, mcols)
self.panel.top()
self.panel.hide()
self.win.clear()
self.panel.top()
self.panel.hide()
self.win.clear()
- 1, 1, "LIGHTCARDS HELP", curses.color_pair(1) + curses.A_BOLD
+ 1,
+ int(mcols / 2) - 8,
+ "LIGHTCARDS HELP",
+ curses.color_pair(1) + curses.A_BOLD,
- self.win.hline(2, 1, curses.ACS_HLINE, 15)
+ self.win.hline(2, 1, curses.ACS_HLINE, mcols)
for t in enumerate(text):
self.win.addstr(t[0] + 3, 1, t[1])
for t in enumerate(text):
self.win.addstr(t[0] + 3, 1, t[1])
- def __init__(self, outer):
+ def __init__(self, outer, mlines=17, mcols=44):
"""Initialize the menu with content"""
self.outer = outer
"""Initialize the menu with content"""
self.outer = outer
- (self.win, self.panel) = panel_create(17, 44)
+ (self.win, self.panel) = panel_create(mlines, mcols)
self.panel.top()
self.panel.hide()
self.win.addstr(
self.panel.top()
self.panel.hide()
self.win.addstr(
- 1, 1, "LIGHTCARDS MENU", curses.color_pair(1) + curses.A_BOLD
+ 1,
+ int(mcols / 2) - 8,
+ "LIGHTCARDS MENU",
+ curses.color_pair(1) + curses.A_BOLD,
- self.win.hline(2, 1, curses.ACS_HLINE, 15)
+ self.win.hline(2, 1, curses.ACS_HLINE, mcols)
text = [
"[y]: reset stack to original state",
"[a]: alphabetize stack",
text = [
"[y]: reset stack to original state",
"[a]: alphabetize stack",
Display the statusbar at the bottom of the screen with progress, star
status, and card side.
"""
Display the statusbar at the bottom of the screen with progress, star
status, and card side.
"""
- (mlines, _) = self.win.getmaxyx()
+ (mlines, mcols) = self.win.getmaxyx()
+ self.win.hline(mlines - 2, 0, 0, mcols)
# Calculate percent done
if len(self.stack) <= 1:
# Calculate percent done
if len(self.stack) <= 1:
- lin_width = header_width
- if len(top) < header_width:
- lin_width = len(top)
- self.main_win.hline(1, 0, curses.ACS_HLINE, lin_width)
+ self.main_win.hline(1, 0, curses.ACS_HLINE, mcols)
# Show current side
self.main_win.addstr(
# Show current side
self.main_win.addstr(
self.update_panels()
self.disp_bar()
self.disp_sidebar()
self.update_panels()
self.disp_bar()
self.disp_sidebar()
- self.win.hline(mlines - 2, 0, 0, mcols)
def current_card(self):
"""Get current card object"""
def current_card(self):
"""Get current card object"""
curses.color_pair(3) + curses.A_BOLD,
)
self.win.vline(0, mcols - 20, 0, mlines - 2)
curses.color_pair(3) + curses.A_BOLD,
)
self.win.vline(0, mcols - 20, 0, mlines - 2)
- self.win.hline(1, left, 0, mlines)
nstarred = self.nstarred()
if mlines - 5 < len(self.nstarred()):
nstarred = self.nstarred()
if mlines - 5 < len(self.nstarred()):