Improve rendering of list view
Fixes appearence when unicode wraps due to wide characters. Not a real fix, but looks nicer.
This commit is contained in:
parent
760a80442c
commit
c6b1d91370
1 changed files with 10 additions and 4 deletions
|
@ -119,10 +119,6 @@ class StatusListWindow:
|
|||
height, width = self.pad.getmaxyx()
|
||||
color = Color.GREEN if highlight else Color.WHITE
|
||||
|
||||
date, time = status['created_at']
|
||||
self.pad.addstr(offset + 1, 1, " " + date.ljust(14), color)
|
||||
self.pad.addstr(offset + 2, 1, " " + time.ljust(14), color)
|
||||
|
||||
trunc_width = width - 15
|
||||
acct = trunc("@" + status['account']['acct'], trunc_width).ljust(trunc_width)
|
||||
display_name = trunc(status['account']['display_name'], trunc_width).ljust(trunc_width)
|
||||
|
@ -133,6 +129,16 @@ class StatusListWindow:
|
|||
else:
|
||||
self.pad.addstr(offset + 1, 14, acct, color)
|
||||
|
||||
date, time = status['created_at']
|
||||
self.pad.addstr(offset + 1, 1, " " + date.ljust(12), color)
|
||||
self.pad.addstr(offset + 2, 1, " " + time.ljust(12), color)
|
||||
|
||||
# Redraw box borders to mitigate unicode overflow issues
|
||||
self.pad.addch(offset + 1, 0, "│")
|
||||
self.pad.addch(offset + 2, 0, "│")
|
||||
self.pad.addch(offset + 1, width - 1, "│")
|
||||
self.pad.addch(offset + 2, width - 1, "│")
|
||||
|
||||
if draw_divider:
|
||||
draw_horizontal_divider(self.pad, offset + 3)
|
||||
|
||||
|
|
Loading…
Reference in a new issue