[Icon Item] Make "smooth" property actually do something

We had m_smooth but never actually used it in the texture node.
With Plasma SVG icons this shouldn't be used but when passing custom pixmaps
or raster graphics (e.g. custom icon in Kicker, thumbnails in Folder View)

Differential Revision: https://phabricator.kde.org/D5214
This commit is contained in:
Kai Uwe Broulik 2017-03-28 13:44:53 +02:00
parent 8a42b06042
commit 611a4b5920

View File

@ -462,6 +462,7 @@ QSGNode* IconItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *update
if (!textureNode || m_textureChanged) { if (!textureNode || m_textureChanged) {
delete oldNode; delete oldNode;
textureNode = new ManagedTextureNode; textureNode = new ManagedTextureNode;
textureNode->setFiltering(m_smooth ? QSGTexture::Linear : QSGTexture::Nearest);
textureNode->setTexture(QSharedPointer<QSGTexture>(window()->createTextureFromImage(m_iconPixmap.toImage(), QQuickWindow::TextureCanUseAtlas))); textureNode->setTexture(QSharedPointer<QSGTexture>(window()->createTextureFromImage(m_iconPixmap.toImage(), QQuickWindow::TextureCanUseAtlas)));
m_sizeChanged = true; m_sizeChanged = true;
m_textureChanged = false; m_textureChanged = false;