修复通知hint处理图片时的bug

This commit is contained in:
iaom 2023-03-17 17:18:43 +08:00
parent f150ebca0a
commit 37c02a90a1
1 changed files with 5 additions and 6 deletions

View File

@ -285,12 +285,11 @@ void PopupNotification::setHints(const QVariantMap &hints)
auto it = hints.find(QStringLiteral("image-data"));
if (it != end) {
d->m_image = d->parseImageHint(it->value<QDBusArgument>());
if (d->m_image.isNull()) {
return;
}
const QSize max = d->maximumImageSize();
if (d->m_image.size().width() > max.width() || d->m_image.size().height() > max.height()) {
d->m_image = d->m_image.scaled(max, Qt::KeepAspectRatio, Qt::SmoothTransformation);
if (!d->m_image.isNull()) {
const QSize max = d->maximumImageSize();
if (d->m_image.size().width() > max.width() || d->m_image.size().height() > max.height()) {
d->m_image = d->m_image.scaled(max, Qt::KeepAspectRatio, Qt::SmoothTransformation);
}
}
}
if (d->m_image.isNull()) {