Timeline: add divider, move columns, boost icon
This commit is contained in:
parent
9784fb8eb5
commit
f6fcb2a821
|
@ -19,6 +19,7 @@ TODO/Ideas:
|
||||||
* download media and use local image viewer?
|
* download media and use local image viewer?
|
||||||
* convert to ascii art?
|
* convert to ascii art?
|
||||||
* use signals to avoid tightly coupling components
|
* use signals to avoid tightly coupling components
|
||||||
|
* interaction with clipboard - how to copy a status to clipbard?
|
||||||
|
|
||||||
Questions:
|
Questions:
|
||||||
* is it possible to make a span a urwid.Text selectable? e.g. for urls and hashtags
|
* is it possible to make a span a urwid.Text selectable? e.g. for urls and hashtags
|
||||||
|
|
|
@ -29,6 +29,7 @@ class Timeline(urwid.Columns):
|
||||||
|
|
||||||
super().__init__([
|
super().__init__([
|
||||||
("weight", 40, self.status_list),
|
("weight", 40, self.status_list),
|
||||||
|
("weight", 0, urwid.AttrWrap(urwid.SolidFill("│"), "blue_selected")),
|
||||||
("weight", 60, self.status_details),
|
("weight", 60, self.status_details),
|
||||||
], dividechars=1)
|
], dividechars=1)
|
||||||
|
|
||||||
|
@ -67,7 +68,7 @@ class Timeline(urwid.Columns):
|
||||||
|
|
||||||
def draw_status_details(self, status):
|
def draw_status_details(self, status):
|
||||||
self.status_details = StatusDetails(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):
|
def keypress(self, size, key):
|
||||||
# If down is pressed on last status in list emit a signal to load more.
|
# 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):
|
def __init__(self, status):
|
||||||
created_at = status.created_at.strftime("%Y-%m-%d %H:%M")
|
created_at = status.created_at.strftime("%Y-%m-%d %H:%M")
|
||||||
favourited = ("yellow", "★") if status.favourited else " "
|
favourited = ("yellow", "★") if status.favourited else " "
|
||||||
reblogged = ("yellow", "⤶") if status.reblogged else " "
|
reblogged = ("yellow", "♺") if status.reblogged else " "
|
||||||
|
|
||||||
return super().__init__([
|
return super().__init__([
|
||||||
("pack", SelectableText(("blue", created_at), wrap="clip")),
|
("pack", SelectableText(("blue", created_at), wrap="clip")),
|
||||||
("pack", urwid.Text(" ")),
|
("pack", urwid.Text(" ")),
|
||||||
urwid.Text(("green", status.account), wrap="clip"),
|
|
||||||
("pack", urwid.Text(" ")),
|
|
||||||
("pack", urwid.Text(favourited)),
|
("pack", urwid.Text(favourited)),
|
||||||
("pack", urwid.Text(" ")),
|
("pack", urwid.Text(" ")),
|
||||||
("pack", urwid.Text(reblogged)),
|
("pack", urwid.Text(reblogged)),
|
||||||
|
("pack", urwid.Text(" ")),
|
||||||
|
urwid.Text(("green", status.account), wrap="clip"),
|
||||||
])
|
])
|
||||||
|
|
Loading…
Reference in New Issue