From d0ddc4d10804305ae9db1c2bba7a180edbf889fc Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 28 Aug 2023 19:57:39 +0300 Subject: [PATCH] Fix loading hiDPI version of cursors. --- src/app/valentina/mainwindow.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index afb3f53c5..ecd055e12 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -813,14 +813,16 @@ void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, cons CancelTool(); emit EnableItemMove(false); m_currentTool = m_lastUsedTool = t; - auto cursorResource = VTheme::GetResourceName(QStringLiteral("cursor"), cursor); + const QString resource = QStringLiteral("toolcursor"); + auto cursorResource = VTheme::GetResourceName(resource, cursor); if (qApp->devicePixelRatio() >= 2) // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast) { // Try to load HiDPI versions of the cursors if availible - auto cursorHidpiResource = QString(cursor).replace(QLatin1String(".png"), QLatin1String("@2x.png")); - if (QFileInfo::exists(cursorResource)) + auto hiDPICursor = QString(cursor).replace(QLatin1String(".png"), QLatin1String("@2x.png")); + auto cursorHiDPIResource = VTheme::GetResourceName(resource, hiDPICursor); + if (QFileInfo::exists(cursorHiDPIResource)) { - cursorResource = cursorHidpiResource; + cursorResource = cursorHiDPIResource; } } QPixmap pixmap(cursorResource);