Fix request for empty image

This commit is contained in:
Nicolas Werner 2023-06-02 23:03:56 +02:00
parent 05ba0c8835
commit d2c616ee67
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
4 changed files with 8 additions and 4 deletions

View file

@ -57,7 +57,9 @@ AbstractButton {
fillMode: avatar.crop ? Image.PreserveAspectCrop : Image.PreserveAspectFit
mipmap: true
smooth: true
source: if (avatar.url.startsWith('image://')) {
source: if (avatar.url.startsWith('image://colorimage')) {
return avatar.url + "&radius=" + (Settings.avatarCircles ? 100 : 25) + ((avatar.crop) ? "" : "&scale");
} else if (avatar.url.startsWith('image://')) {
return avatar.url + "?radius=" + (Settings.avatarCircles ? 100 : 25) + ((avatar.crop) ? "" : "&scale");
} else if (avatar.url.startsWith(':/')) {
return "image://colorimage/" + avatar.url + "?" + textColor;

View file

@ -146,8 +146,10 @@ Page {
url: {
if (model.avatarUrl.startsWith("mxc://"))
return model.avatarUrl.replace("mxc://", "image://MxcImage/");
else
else if (model.avatarUrl.length > 0)
return "image://colorimage/" + model.avatarUrl + "?" + communityItem.unimportantText;
else
return "";
}
width: avatarSize

View file

@ -41,7 +41,7 @@ Popup {
font.pixelSize: Math.ceil(quickSwitcher.textHeight * 0.6)
width: parent.width
Keys.onPressed: (event) => {
Keys.onPressed: event => {
if (event.key == Qt.Key_Up || event.key == Qt.Key_Backtab) {
event.accepted = true;
completerPopup.up();

View file

@ -568,8 +568,8 @@ Page {
spacing: Nheko.paddingSmall
Item {
Layout.fillWidth: true
Layout.alignment: Qt.AlignBottom
Layout.fillWidth: true
ElidedLabel {
anchors.bottom: parent.bottom