From f6fcb2a821ef9b5f4d30cf36d72a26567b8cbee0 Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Tue, 27 Aug 2019 14:55:02 +0200 Subject: [PATCH] Timeline: add divider, move columns, boost icon --- toot/tui/NOTES.md | 1 + toot/tui/timeline.py | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/toot/tui/NOTES.md b/toot/tui/NOTES.md index 7759df5..489e690 100644 --- a/toot/tui/NOTES.md +++ b/toot/tui/NOTES.md @@ -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 diff --git a/toot/tui/timeline.py b/toot/tui/timeline.py index a72192a..33b53c8 100644 --- a/toot/tui/timeline.py +++ b/toot/tui/timeline.py @@ -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"), ])