CodedOre / NewCaw

Development on Cawbird 2.0
GNU General Public License v3.0
97 stars 5 forks source link

Standardize the loading of Media #24

Closed CodedOre closed 2 years ago

CodedOre commented 2 years ago

We have different places where we load media:

All 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 a Gdk.Paintable, either Gtk.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.

IBBoard commented 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 🙂

CodedOre commented 2 years ago

This should've been closed a while back, so doing it now.