修复通知hint处理图片时的bug
This commit is contained in:
parent
f150ebca0a
commit
37c02a90a1
|
@ -285,14 +285,13 @@ void PopupNotification::setHints(const QVariantMap &hints)
|
||||||
auto it = hints.find(QStringLiteral("image-data"));
|
auto it = hints.find(QStringLiteral("image-data"));
|
||||||
if (it != end) {
|
if (it != end) {
|
||||||
d->m_image = d->parseImageHint(it->value<QDBusArgument>());
|
d->m_image = d->parseImageHint(it->value<QDBusArgument>());
|
||||||
if (d->m_image.isNull()) {
|
if (!d->m_image.isNull()) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
const QSize max = d->maximumImageSize();
|
const QSize max = d->maximumImageSize();
|
||||||
if (d->m_image.size().width() > max.width() || d->m_image.size().height() > max.height()) {
|
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);
|
d->m_image = d->m_image.scaled(max, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (d->m_image.isNull()) {
|
if (d->m_image.isNull()) {
|
||||||
it = hints.find(QStringLiteral("image-path"));
|
it = hints.find(QStringLiteral("image-path"));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue