Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

fix-multimonitor-icons

konero3a53045d08f7
diff --git a/toonz/sources/toonzqt/gutil.cpp b/toonz/sources/toonzqt/gutil.cpp
index 427521234..833d2773f 100644
--- a/toonz/sources/toonzqt/gutil.cpp
+++ b/toonz/sources/toonzqt/gutil.cpp
@@ -511,11 +511,19 @@ QIcon createQIcon(const QString &iconSVGName, bool useFullOpacity,
// there can be scaling artifacts with high dpi and load these in addition
if (baseImg.width() == (16 * devPixRatio) &&
baseImg.height() == (16 * devPixRatio)) {
- QSize expandSize(20, 20);
- QImage toolBaseImg(compositeImage(baseImg, expandSize));
- QImage toolOverImg(compositeImage(overImg, expandSize));
- QImage toolOnImg(compositeImage(onImg, expandSize));
- addImagesToIcon(icon, toolBaseImg, toolOverImg, toolOnImg, useFullOpacity);
+ for (auto screen : QApplication::screens()) {
+ QSize expandSize(20, 20);
+ int otherDevPixRatio = screen->devicePixelRatio();
+ if (otherDevPixRatio != devPixRatio) {
+ expandSize.setWidth(16 * otherDevPixRatio);
+ expandSize.setHeight(16 * otherDevPixRatio);
+ }
+ QImage toolBaseImg(compositeImage(baseImg, expandSize));
+ QImage toolOverImg(compositeImage(overImg, expandSize));
+ QImage toolOnImg(compositeImage(onImg, expandSize));
+ addImagesToIcon(icon, toolBaseImg, toolOverImg, toolOnImg,
+ useFullOpacity);
+ }
}
return icon;