I'm trying to make a gnome-shell extension where I need to load an image from an URL / URI.
I can do that with St.TextureCache and that works great. I then try to put it in an St.Bin container, but the texture overflows the container (as shown in the screenshot). Is there a way (CSS maybe?) such that this does not happen?
The reason I want that is to give the image rounded corners, with the idea that I can give rounded corners easily to the St.Bin with CSS but it seems I can't style the texture directly. If there is another way to round the corners of the image that is also fine
A screenshot showing the problem. The St.Bin has a red border, but the texture clearly overflows it
The relevant code:
let file = Gio.File.new_for_uri(url_to_picture);
let bin = new St.Bin({
style_class: 'icon-custom',
y_expand: false,
y_align: Clutter.ActorAlign.START,
visible: true,
});
let texture = St.TextureCache.get_default().load_file_async(file, -1, 120, 1, 1);
bin.set_child(texture);
and CSS:
.icon-custom {
border: 3px solid red;
border-radius: 20px;
}
