addtional post item formatting

This commit is contained in:
Morgan McMillian 2020-12-17 08:34:09 -08:00
parent d7beb9c17a
commit c726d5a152
2 changed files with 6 additions and 6 deletions

View file

@ -153,7 +153,7 @@ class Application(Gtk.Application):
self.stack.child_set_property(unified, "icon-name", "user-home-symbolic")
mentions = Timeline('mentions')
self.stack.add_titled(mentions, "mentions", "Mentions")
self.stack.child_set_property(mentions, "icon-name", "preferences-system-notifications-symbolic")
self.stack.child_set_property(mentions, "icon-name", "goa-panel-symbolic")
bookmarks = Timeline('bookmarks')
self.stack.add_titled(bookmarks, "bookmarks", "Bookmarks")
self.stack.child_set_property(bookmarks, "icon-name", "user-bookmarks-symbolic")

View file

@ -239,8 +239,10 @@ class PostItem(Gtk.ListBoxRow):
self.avatar = Handy.Avatar(size=48, text=post.user.username, show_initials=True)
self.avatar.set_image_load_func(self.get_avatar, post.user.content.avatar_image.link)
#self.avatar = Gtk.Image.new_from_pixbuf(self.get_avatar(48, post.user.content.avatar_image.link))
self.source = Gtk.Label(label=post.source.name, xalign=1, yalign=0)
self.h_box.pack_start(self.avatar, False, False, 18)
self.h_box.pack_start(self.name_box, False, False, 0)
self.h_box.pack_end(self.source, False, False, 18)
# content container
self.c_box = Gtk.Box(orientation='vertical')
@ -248,7 +250,7 @@ class PostItem(Gtk.ListBoxRow):
self.content = Gtk.Label(wrap=True, xalign=0)
# TODO: parse content links
if 'content' in post:
self.content.set_text(post.content.text)
self.content.set_markup(post.content.text)
self.t_box.pack_start(self.content, False, False, 18)
self.c_box.pack_start(self.t_box, False, False, 18)
@ -264,10 +266,8 @@ class PostItem(Gtk.ListBoxRow):
# footer container
self.f_box = Gtk.Box(orientation='horizontal')
post_date_local = post.created_at.astimezone(tzlocal())
datetime_label = Gtk.Label(label=post_date_local.strftime("%Y-%m-%d %H:%M"), xalign=0)
self.source = Gtk.Label(label=post.source.name, xalign=1)
self.f_box.pack_start(datetime_label, False, False, 18)
self.f_box.pack_end(self.source, False, False, 18)
datetime_label = Gtk.Label(label=post_date_local.strftime("%Y-%m-%d %H:%M"), xalign=1)
self.f_box.pack_end(datetime_label, False, False, 18)
self.box.pack_start(self.h_box, True, True, 10)
self.box.pack_start(self.c_box, True, True, 10)