added status icons

This commit is contained in:
Morgan McMillian 2020-12-17 10:27:52 -08:00
parent c726d5a152
commit b428c40d6e

View file

@ -268,6 +268,25 @@ class PostItem(Gtk.ListBoxRow):
post_date_local = post.created_at.astimezone(tzlocal())
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)
pad = Gtk.Label(label="")
self.f_box.pack_start(pad, False, False, 9)
if post.id != int(post.thread_id):
thread_icon = Gtk.Image.new_from_icon_name("user-available-symbolic", Gtk.IconSize.SMALL_TOOLBAR)
self.f_box.pack_start(thread_icon, False, False, 9)
if post.counts.bookmarks > 0:
if post.you_bookmarked:
star_icon = Gtk.Image.new_from_icon_name("starred-symbolic", Gtk.IconSize.SMALL_TOOLBAR)
else:
star_icon = Gtk.Image.new_from_icon_name("non-starred-symbolic", Gtk.IconSize.SMALL_TOOLBAR)
star_count = Gtk.Label(label=post.counts.bookmarks)
self.f_box.pack_start(star_icon, False, False, 9)
self.f_box.pack_start(star_count, False, False, 0)
if post.counts.reposts > 0:
repost_icon = Gtk.Image.new_from_icon_name("media-playlist-repeat-symbolic", Gtk.IconSize.SMALL_TOOLBAR)
repost_count = Gtk.Label(label=post.counts.reposts)
self.f_box.pack_start(repost_icon, False, False, 9)
self.f_box.pack_start(repost_count, False, False, 0)
self.box.pack_start(self.h_box, True, True, 10)
self.box.pack_start(self.c_box, True, True, 10)