summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2019-11-03 01:17:40 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2019-11-23 20:06:15 +0100
commit4f7a45a0a6b28255fb4c1ccbb53fcf8a6958843a (patch)
tree226eeb41532e78245e60d1ff997b7d03e7b2fb64 /src
parentfixup bad room list translation commit (diff)
downloadnheko-4f7a45a0a6b28255fb4c1ccbb53fcf8a6958843a.tar.xz
Improve avatar look and layouting
Thanks to red_sky for the feedback!
Diffstat (limited to 'src')
-rw-r--r--src/MxcImageProvider.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/MxcImageProvider.cpp b/src/MxcImageProvider.cpp

index 86dbcabc..556b019b 100644 --- a/src/MxcImageProvider.cpp +++ b/src/MxcImageProvider.cpp
@@ -6,7 +6,7 @@ void MxcImageResponse::run() { if (m_requestedSize.isValid()) { - QString fileName = QString("%1_%2x%3") + QString fileName = QString("%1_%2x%3_crop") .arg(m_id) .arg(m_requestedSize.width()) .arg(m_requestedSize.height()); @@ -23,7 +23,7 @@ MxcImageResponse::run() opts.mxc_url = "mxc://" + m_id.toStdString(); opts.width = m_requestedSize.width() > 0 ? m_requestedSize.width() : -1; opts.height = m_requestedSize.height() > 0 ? m_requestedSize.height() : -1; - opts.method = "scale"; + opts.method = "crop"; http::client()->get_thumbnail( opts, [this, fileName](const std::string &res, mtx::http::RequestErr err) { if (err) { @@ -38,8 +38,6 @@ MxcImageResponse::run() auto data = QByteArray(res.data(), res.size()); cache::client()->saveImage(fileName, data); m_image.loadFromData(data); - m_image = m_image.scaled( - m_requestedSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); m_image.setText("mxc url", "mxc://" + m_id); emit finished();