Gui: Fix too small link icon on high dpi (#22359)

* Gui: Fix too small link icon on high dpi

* Gui: suppress warning in ViewProvideLink.cpp

---------

Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
This commit is contained in:
Kacper Donat
2025-07-07 00:37:34 +02:00
committed by GitHub
parent 8d1f65e992
commit dffdfb1a3b

View File

@@ -673,8 +673,11 @@ public:
QIcon getIcon(QPixmap px) {
static int iconSize = -1;
if(iconSize < 0)
iconSize = QApplication::style()->standardPixmap(QStyle::SP_DirClosedIcon).width();
if (iconSize < 0) {
auto sampleIcon = QApplication::style()->standardPixmap(QStyle::SP_DirClosedIcon);
double pixelRatio = sampleIcon.devicePixelRatio();
iconSize = static_cast<int>(sampleIcon.width() / pixelRatio);
}
if(!isLinked())
return QIcon();