mirror of
https://github.com/TakeV-Lambda/Tooth.git
synced 2024-10-31 21:20:24 +00:00
feat(profile): use avatar as cover if missing
This commit is contained in:
parent
7fe8828a62
commit
f187f49e60
2 changed files with 8 additions and 1 deletions
|
@ -54,7 +54,11 @@ public class Tooth.Views.Profile : Views.Timeline {
|
||||||
avatar.account = account;
|
avatar.account = account;
|
||||||
note.content = account.note;
|
note.content = account.note;
|
||||||
|
|
||||||
|
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);
|
image_cache.request_paintable (account.header, on_cache_response);
|
||||||
|
}
|
||||||
|
|
||||||
if (account.fields != null) {
|
if (account.fields != null) {
|
||||||
foreach (API.AccountField f in account.fields) {
|
foreach (API.AccountField f in account.fields) {
|
||||||
|
|
|
@ -8,6 +8,9 @@ public class Tooth.Widgets.Avatar : Button {
|
||||||
get { return avatar.size; }
|
get { return avatar.size; }
|
||||||
set { avatar.size = value; }
|
set { avatar.size = value; }
|
||||||
}
|
}
|
||||||
|
public Paintable? custom_image {
|
||||||
|
get { return avatar.custom_image; }
|
||||||
|
}
|
||||||
|
|
||||||
protected Adw.Avatar? avatar {
|
protected Adw.Avatar? avatar {
|
||||||
get { return child as Adw.Avatar; }
|
get { return child as Adw.Avatar; }
|
||||||
|
|
Loading…
Reference in a new issue