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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user