feat(profile): use avatar as cover if missing

This commit is contained in:
Evangelos Paterakis 2022-12-05 04:00:43 +02:00
parent 7fe8828a62
commit f187f49e60
No known key found for this signature in database
GPG key ID: FE5185F095BFC8C9
2 changed files with 8 additions and 1 deletions

View file

@ -54,7 +54,11 @@ public class Tooth.Views.Profile : Views.Timeline {
avatar.account = account;
note.content = account.note;
image_cache.request_paintable (account.header, on_cache_response);
if (account.header.contains("/headers/original/missing.png")) {
avatar.bind_property("custom_image", background, "paintable", GLib.BindingFlags.SYNC_CREATE);
} else {
image_cache.request_paintable (account.header, on_cache_response);
}
if (account.fields != null) {
foreach (API.AccountField f in account.fields) {

View file

@ -8,6 +8,9 @@ public class Tooth.Widgets.Avatar : Button {
get { return avatar.size; }
set { avatar.size = value; }
}
public Paintable? custom_image {
get { return avatar.custom_image; }
}
protected Adw.Avatar? avatar {
get { return child as Adw.Avatar; }