fix avatar picture
This commit is contained in:
parent
c4721dc84c
commit
2af1431c5a
2 changed files with 10 additions and 6 deletions
|
|
@ -528,7 +528,7 @@ void App::initCore() {
|
||||||
if (mSettings) setLocale(mSettings->getConfigLocale());
|
if (mSettings) setLocale(mSettings->getConfigLocale());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const QUrl url(u"qrc:/qt/qml/Linphone/view/Page/Window/Main/MainWindow.qml"_qs);
|
const QUrl url("qrc:/qt/qml/Linphone/view/Page/Window/Main/MainWindow.qml");
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
mEngine, &QQmlApplicationEngine::objectCreated, this,
|
mEngine, &QQmlApplicationEngine::objectCreated, this,
|
||||||
[this, url, coreStarted](QObject *obj, const QUrl &objUrl) {
|
[this, url, coreStarted](QObject *obj, const QUrl &objUrl) {
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ Loader{
|
||||||
: displayNameObj
|
: displayNameObj
|
||||||
? displayNameObj.value
|
? displayNameObj.value
|
||||||
: ""
|
: ""
|
||||||
property bool haveAvatar: (account && account.core?.pictureUri || false)
|
property bool haveAvatar: (account && account.core.pictureUri)
|
||||||
|| (contact && contact.core.pictureUri)
|
|| (contact && contact.core.pictureUri)
|
||||||
|| computedAvatarUri.length != 0
|
|| computedAvatarUri.length != 0
|
||||||
property var avatarObj: UtilsCpp.findAvatarByAddress(_address)
|
property var avatarObj: UtilsCpp.findAvatarByAddress(_address)
|
||||||
|
|
@ -75,7 +75,9 @@ Loader{
|
||||||
|
|
||||||
Connections{
|
Connections{
|
||||||
target: mainItem
|
target: mainItem
|
||||||
onHaveAvatarChanged: function(haveAvatar) {stackView.replace(haveAvatar ? avatar : initials, StackView.Immediate)}
|
onHaveAvatarChanged: {
|
||||||
|
console.log("have avatar changed", mainItem.haveAvatar, mainItem._address)
|
||||||
|
stackView.replace(mainItem.haveAvatar ? avatar : initials, StackView.Immediate)}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
@ -198,9 +200,11 @@ Loader{
|
||||||
sourceSize.height: avatarItem.height
|
sourceSize.height: avatarItem.height
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
source: mainItem.account && mainItem.account.core.pictureUri
|
source: mainItem.account
|
||||||
|| mainItem.contact && mainItem.contact.core.pictureUri
|
? mainItem.account.core.pictureUri
|
||||||
|| computedAvatarUri
|
: mainItem.contact
|
||||||
|
? mainItem.contact.core.pictureUri
|
||||||
|
: computedAvatarUri
|
||||||
mipmap: true
|
mipmap: true
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue