|
|
|
@ -22,6 +22,7 @@ def decorate_button(button): |
|
|
|
|
def wrap_in_frame( |
|
|
|
|
widget, |
|
|
|
|
title, |
|
|
|
|
subtitle=None, |
|
|
|
|
on_back=None, |
|
|
|
|
on_next=None, |
|
|
|
|
next_btn=None, |
|
|
|
@ -53,7 +54,7 @@ def wrap_in_frame( |
|
|
|
|
footer_height = 2 |
|
|
|
|
elif message_text is not None: |
|
|
|
|
footer = urwid.Pile([message_text, footer]) |
|
|
|
|
footer_height = 6 # ??? |
|
|
|
|
footer_height = 7 # ??? |
|
|
|
|
footer_height += 1 # add 1 for the bottom padding |
|
|
|
|
footer = urwid.Filler(footer, valign='bottom', bottom=1) |
|
|
|
|
body = urwid.Pile([widget, (footer_height, footer)]) |
|
|
|
@ -63,8 +64,10 @@ def wrap_in_frame( |
|
|
|
|
flash_text = urwid.WidgetDisable(flash_text) |
|
|
|
|
footer = urwid.Filler(flash_text, valign='bottom', bottom=1) |
|
|
|
|
body = urwid.Pile([body, (2, footer)]) |
|
|
|
|
header = urwid.Pile([ |
|
|
|
|
urwid.Text(('bold', title), align='center'), |
|
|
|
|
urwid.Divider() |
|
|
|
|
]) |
|
|
|
|
header_elems = [urwid.Text(('bold', title), align='center')] |
|
|
|
|
if subtitle is not None: |
|
|
|
|
header_elems.append(urwid.Text(subtitle, align='center')) |
|
|
|
|
else: |
|
|
|
|
header_elems.append(urwid.Divider()) |
|
|
|
|
header = urwid.Pile(header_elems) |
|
|
|
|
return urwid.Frame(body, header) |
|
|
|
|