mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 12:38:48 +03:00
Fix request for empty image
This commit is contained in:
parent
05ba0c8835
commit
d2c616ee67
4 changed files with 8 additions and 4 deletions
|
@ -57,7 +57,9 @@ AbstractButton {
|
||||||
fillMode: avatar.crop ? Image.PreserveAspectCrop : Image.PreserveAspectFit
|
fillMode: avatar.crop ? Image.PreserveAspectCrop : Image.PreserveAspectFit
|
||||||
mipmap: true
|
mipmap: true
|
||||||
smooth: 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");
|
return avatar.url + "?radius=" + (Settings.avatarCircles ? 100 : 25) + ((avatar.crop) ? "" : "&scale");
|
||||||
} else if (avatar.url.startsWith(':/')) {
|
} else if (avatar.url.startsWith(':/')) {
|
||||||
return "image://colorimage/" + avatar.url + "?" + textColor;
|
return "image://colorimage/" + avatar.url + "?" + textColor;
|
||||||
|
|
|
@ -146,8 +146,10 @@ Page {
|
||||||
url: {
|
url: {
|
||||||
if (model.avatarUrl.startsWith("mxc://"))
|
if (model.avatarUrl.startsWith("mxc://"))
|
||||||
return model.avatarUrl.replace("mxc://", "image://MxcImage/");
|
return model.avatarUrl.replace("mxc://", "image://MxcImage/");
|
||||||
else
|
else if (model.avatarUrl.length > 0)
|
||||||
return "image://colorimage/" + model.avatarUrl + "?" + communityItem.unimportantText;
|
return "image://colorimage/" + model.avatarUrl + "?" + communityItem.unimportantText;
|
||||||
|
else
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
width: avatarSize
|
width: avatarSize
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ Popup {
|
||||||
font.pixelSize: Math.ceil(quickSwitcher.textHeight * 0.6)
|
font.pixelSize: Math.ceil(quickSwitcher.textHeight * 0.6)
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
Keys.onPressed: (event) => {
|
Keys.onPressed: event => {
|
||||||
if (event.key == Qt.Key_Up || event.key == Qt.Key_Backtab) {
|
if (event.key == Qt.Key_Up || event.key == Qt.Key_Backtab) {
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
completerPopup.up();
|
completerPopup.up();
|
||||||
|
|
|
@ -568,8 +568,8 @@ Page {
|
||||||
spacing: Nheko.paddingSmall
|
spacing: Nheko.paddingSmall
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.alignment: Qt.AlignBottom
|
Layout.alignment: Qt.AlignBottom
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
ElidedLabel {
|
ElidedLabel {
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
|
Loading…
Reference in a new issue