Closed CodedOre closed 2 years ago
Makes sense to me. If you can pass in a URL, a proxy (because media in DMs may need OAuth) and a surface/Paintable to put it on then I don't see why you couldn't standardise it 🙂
This should've been closed a while back, so doing it now.
We have different places where we load media:
UserAvatar
for the user avatarMediaPreviewItem
for the preview in a postMediaDisplayItem
for the main media displayProfileCard
for the profile headerAll these widget perform a similar task: Get the
MediaLoader
, begin loading and, when it's done, place the loaded media inside a widget capable of holding aGdk.Paintable
, eitherGtk.Picture
,CroppedPicture
and (eventually)ScrollablePicture
.Since these are at least 10 lines of code almost identical in each one I though if we could (and should) combine this into a universal method used by all of them, and how to ideally accomplish this.