mirror of
https://github.com/ihabunek/toot.git
synced 2024-09-29 04:35:54 -04:00
Don't draw empty line when account has no name
This commit is contained in:
parent
53cd9442f8
commit
5463e86d5d
@ -115,11 +115,14 @@ class StatusListWindow:
|
|||||||
self.pad.addstr(offset + 2, 1, " " + time.ljust(14), color)
|
self.pad.addstr(offset + 2, 1, " " + time.ljust(14), color)
|
||||||
|
|
||||||
trunc_width = width - 15
|
trunc_width = width - 15
|
||||||
acct = trunc(status['account']['acct'], trunc_width).ljust(trunc_width)
|
acct = trunc("@" + status['account']['acct'], trunc_width).ljust(trunc_width)
|
||||||
display_name = trunc(status['account']['display_name'], trunc_width).ljust(trunc_width)
|
display_name = trunc(status['account']['display_name'], trunc_width).ljust(trunc_width)
|
||||||
|
|
||||||
self.pad.addstr(offset + 1, 14, display_name, color)
|
if status['account']['display_name']:
|
||||||
self.pad.addstr(offset + 2, 14, acct, color)
|
self.pad.addstr(offset + 1, 14, display_name, color)
|
||||||
|
self.pad.addstr(offset + 2, 14, acct, color)
|
||||||
|
else:
|
||||||
|
self.pad.addstr(offset + 1, 14, acct, color)
|
||||||
|
|
||||||
if draw_divider:
|
if draw_divider:
|
||||||
draw_horizontal_divider(self.pad, offset + 3)
|
draw_horizontal_divider(self.pad, offset + 3)
|
||||||
@ -167,7 +170,8 @@ class StatusDetailWindow:
|
|||||||
acct = status['account']['acct']
|
acct = status['account']['acct']
|
||||||
name = status['account']['display_name']
|
name = status['account']['display_name']
|
||||||
|
|
||||||
yield name, Color.YELLOW
|
if name:
|
||||||
|
yield name, Color.YELLOW
|
||||||
yield "@" + acct, Color.GREEN
|
yield "@" + acct, Color.GREEN
|
||||||
yield
|
yield
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user