~thrrgilag/squeak

fa6dd5126fe046074b74241a277f44fba0e7b83e — Morgan McMillian a month ago 04a6746
fix display of reposted posts
1 files changed, 13 insertions(+), 0 deletions(-)

M src/widgets.py
M src/widgets.py => src/widgets.py +13 -0
@@ 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)