Show media in status details
This commit is contained in:
parent
5213eb1835
commit
ab1fc6961b
3 changed files with 13 additions and 0 deletions
|
@ -3,6 +3,9 @@ Interesting urwid implementations:
|
|||
* https://github.com/TomasTomecek/sen/blob/master/sen/tui/ui.py
|
||||
* https://github.com/rndusr/stig/tree/master/stig/tui
|
||||
|
||||
Check out:
|
||||
* https://github.com/rr-/urwid_readline - better edit box?
|
||||
|
||||
TODO/Ideas:
|
||||
* pack left column in timeline view
|
||||
* allow scrolling of toot contents if they don't fit the screen, perhaps using
|
||||
|
|
|
@ -19,6 +19,7 @@ PALETTE = [
|
|||
('link', ',italics', ''),
|
||||
|
||||
# Colors
|
||||
('bold', ',bold', ''),
|
||||
('blue', 'light blue', ''),
|
||||
('blue_bold', 'light blue, bold', ''),
|
||||
('blue_selected', 'white', 'dark blue'),
|
||||
|
|
|
@ -191,6 +191,15 @@ class StatusDetails(urwid.Pile):
|
|||
for line in format_content(status.data["content"]):
|
||||
yield ("pack", urwid.Text(highlight_hashtags(line)))
|
||||
|
||||
media = status.data["media_attachments"]
|
||||
if media:
|
||||
for m in media:
|
||||
yield ("pack", urwid.AttrMap(urwid.Divider("-"), "gray"))
|
||||
yield ("pack", urwid.Text([("bold", "Media attachment"), " (", m["type"], ")"]))
|
||||
if m["description"]:
|
||||
yield ("pack", urwid.Text(m["description"]))
|
||||
yield ("pack", urwid.Text(("link", m["url"])))
|
||||
|
||||
poll = status.data.get("poll")
|
||||
if poll:
|
||||
yield ("pack", urwid.Divider())
|
||||
|
|
Loading…
Reference in a new issue