kopia lustrzana https://github.com/ihabunek/toot
Put edit box and button in list box with source
This makes it much easier to focus them, just scroll down.pull/308/head
rodzic
cc1809db31
commit
5606d95c93
|
@ -13,25 +13,19 @@ class StatusSource(urwid.Padding):
|
|||
"""Shows status data, as returned by the server, as formatted JSON."""
|
||||
def __init__(self, status):
|
||||
self.source = json.dumps(status.data, indent=4)
|
||||
walker = urwid.SimpleFocusListWalker([
|
||||
urwid.Text(self.source)
|
||||
])
|
||||
list = urwid.ListBox(walker)
|
||||
|
||||
self.filename_edit = EditBox(caption="Filename: ", edit_text="status.json")
|
||||
self.save_button = Button("Save", on_press=self.save_json)
|
||||
self.status_text = urwid.Text("")
|
||||
|
||||
walker = urwid.SimpleFocusListWalker([
|
||||
urwid.Text(self.source),
|
||||
urwid.BoxAdapter(urwid.SolidFill(" "), 2),
|
||||
self.filename_edit,
|
||||
Button("Save", on_press=self.save_json)
|
||||
])
|
||||
|
||||
frame = urwid.Frame(
|
||||
body=list,
|
||||
footer=urwid.Pile(
|
||||
[
|
||||
urwid.BoxAdapter(urwid.SolidFill(" "), 2),
|
||||
self.filename_edit,
|
||||
self.save_button,
|
||||
self.status_text,
|
||||
]
|
||||
),
|
||||
body=urwid.ListBox(walker),
|
||||
footer=self.status_text
|
||||
)
|
||||
super().__init__(frame)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue