diff --git a/src/widgets.py b/src/widgets.py index e8e1458..ad6401a 100644 --- a/src/widgets.py +++ b/src/widgets.py @@ -22,6 +22,8 @@ import pnutpy import logging import requests +from dateutil.tz import tzlocal + gi.require_version('GdkPixbuf', '2.0') gi.require_version('Gdk', '3.0') gi.require_version('Gtk', '3.0') @@ -259,8 +261,17 @@ class PostItem(Gtk.ListBoxRow): photo = Gtk.Image.new_from_pixbuf(self.get_oembed_thumb(oembed)) self.c_box.pack_end(photo, False, False, 18) + # 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) + self.box.pack_start(self.h_box, True, True, 10) self.box.pack_start(self.c_box, True, True, 10) + self.box.pack_start(self.f_box, True, True, 10) def get_avatar(self, size, url): # TODO: needs a cache