Timeline: add divider, move columns, boost icon

pull/112/head
Ivan Habunek 2019-08-27 14:55:02 +02:00
rodzic 9784fb8eb5
commit f6fcb2a821
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: CDBD63C43A30BB95
2 zmienionych plików z 6 dodań i 4 usunięć

Wyświetl plik

@ -19,6 +19,7 @@ TODO/Ideas:
* download media and use local image viewer?
* convert to ascii art?
* use signals to avoid tightly coupling components
* interaction with clipboard - how to copy a status to clipbard?
Questions:
* is it possible to make a span a urwid.Text selectable? e.g. for urls and hashtags

Wyświetl plik

@ -29,6 +29,7 @@ class Timeline(urwid.Columns):
super().__init__([
("weight", 40, self.status_list),
("weight", 0, urwid.AttrWrap(urwid.SolidFill(""), "blue_selected")),
("weight", 60, self.status_details),
], dividechars=1)
@ -67,7 +68,7 @@ class Timeline(urwid.Columns):
def draw_status_details(self, status):
self.status_details = StatusDetails(status)
self.contents[1] = self.status_details, ("weight", 50, False)
self.contents[2] = self.status_details, ("weight", 50, False)
def keypress(self, size, key):
# If down is pressed on last status in list emit a signal to load more.
@ -223,14 +224,14 @@ class StatusListItem(SelectableColumns):
def __init__(self, status):
created_at = status.created_at.strftime("%Y-%m-%d %H:%M")
favourited = ("yellow", "") if status.favourited else " "
reblogged = ("yellow", "") if status.reblogged else " "
reblogged = ("yellow", "") if status.reblogged else " "
return super().__init__([
("pack", SelectableText(("blue", created_at), wrap="clip")),
("pack", urwid.Text(" ")),
urwid.Text(("green", status.account), wrap="clip"),
("pack", urwid.Text(" ")),
("pack", urwid.Text(favourited)),
("pack", urwid.Text(" ")),
("pack", urwid.Text(reblogged)),
("pack", urwid.Text(" ")),
urwid.Text(("green", status.account), wrap="clip"),
])