fix display of reposted posts
This commit is contained in:
parent
04a6746bd7
commit
fa6dd5126f
1 changed files with 13 additions and 0 deletions
|
@ -362,6 +362,11 @@ class PostItem(Gtk.ListBoxRow):
|
|||
|
||||
def __init__(self, post):
|
||||
super(Gtk.ListBoxRow, self).__init__()
|
||||
if 'repost_of' in post:
|
||||
reposted_by = post.user
|
||||
post = post.repost_of
|
||||
else:
|
||||
reposted_by = None
|
||||
self.post = post
|
||||
|
||||
# Avatar
|
||||
|
@ -433,6 +438,14 @@ class PostItem(Gtk.ListBoxRow):
|
|||
photo = Gtk.Image.new_from_pixbuf(self.get_oembed_thumb(oembed))
|
||||
self.c_box.pack_end(photo, False, False, 10)
|
||||
|
||||
if reposted_by is not None:
|
||||
reposted_label_text = f'<span size="small"><i>reposted by @{reposted_by.username}</i></span>'
|
||||
reposted_label = Gtk.Label(xalign=0)
|
||||
reposted_label.set_margin_left(10)
|
||||
reposted_label.set_margin_top(5)
|
||||
reposted_label.set_markup(reposted_label_text)
|
||||
self.c_box.pack_end(reposted_label, False, False, 0)
|
||||
|
||||
# footer container
|
||||
self.f_box = Gtk.Box(orientation='horizontal')
|
||||
self.f_box.pack_end(self.menu_button, False, False, 5)
|
||||
|
|
Loading…
Reference in a new issue