diff --git a/resources/qml/Avatar.qml b/resources/qml/Avatar.qml index 34b029a6..4adff572 100644 --- a/resources/qml/Avatar.qml +++ b/resources/qml/Avatar.qml @@ -33,7 +33,7 @@ Rectangle { asynchronous: true fillMode: Image.PreserveAspectCrop mipmap: true - smooth: false + smooth: true sourceSize.width: avatar.width sourceSize.height: avatar.height layer.enabled: true diff --git a/resources/qml/delegates/ImageMessage.qml b/resources/qml/delegates/ImageMessage.qml index 5c3dac95..e8e325f0 100644 --- a/resources/qml/delegates/ImageMessage.qml +++ b/resources/qml/delegates/ImageMessage.qml @@ -29,6 +29,8 @@ Item { source: model.data.url.replace("mxc://", "image://MxcImage/") asynchronous: true fillMode: Image.PreserveAspectFit + smooth: true + mipmap: true MouseArea { id: mouseArea diff --git a/src/ui/Avatar.cpp b/src/ui/Avatar.cpp index 70ebfcf2..0d1bb924 100644 --- a/src/ui/Avatar.cpp +++ b/src/ui/Avatar.cpp @@ -121,7 +121,9 @@ Avatar::paintEvent(QPaintEvent *) bool rounded = QSettings().value("user/avatar_circles", true).toBool(); QPainter painter(this); - painter.setRenderHint(QPainter::Antialiasing); + + painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform | + QPainter::TextAntialiasing); QRectF r = rect(); const int hs = size_ / 2; diff --git a/src/ui/Painter.h b/src/ui/Painter.h index 2bb0981b..c69dca95 100644 --- a/src/ui/Painter.h +++ b/src/ui/Painter.h @@ -139,18 +139,10 @@ public: PainterHighQualityEnabler(Painter &p) : _painter(p) { - static constexpr QPainter::RenderHint Hints[] = {QPainter::Antialiasing, - QPainter::SmoothPixmapTransform, - QPainter::TextAntialiasing}; + hints_ = QPainter::Antialiasing | QPainter::SmoothPixmapTransform | + QPainter::TextAntialiasing; - auto hints = _painter.renderHints(); - for (const auto &hint : Hints) { - if (!(hints & hint)) - hints_ |= hint; - } - - if (hints_) - _painter.setRenderHints(hints_); + _painter.setRenderHints(hints_); } ~PainterHighQualityEnabler()