diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-04-17 17:08:21 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-04-20 12:25:07 +0200 |
commit | 86f228b819aba71f0d6cd89303d8226d6567209b (patch) | |
tree | 22ac28c0e64fd83e28fdb4808d2d9267b38b140f /src/plugins/platforms/cocoa/qcocoaintegration.mm | |
parent | 164110f7bbea7345de709edd092afa84fdde232c (diff) |
macOS: Restore fallback sizes when setting application or window icons
We removed this logic in 059c3ae66a under the assumption that the icon
would always provide a set of sizes, but for SVG icons this is not
the case.
Change-Id: Ib3cc5740bca32cf4068a71baf99b52fa536da2ca
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaintegration.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaintegration.mm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index 245db429c5..9b57b89529 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -472,7 +472,9 @@ QList<QCocoaWindow *> *QCocoaIntegration::popupWindowStack() void QCocoaIntegration::setApplicationIcon(const QIcon &icon) const { - NSApp.applicationIconImage = [NSImage imageFromQIcon:icon]; + // Fall back to a size that looks good on the highest resolution screen available + auto fallbackSize = NSApp.dockTile.size.width * qGuiApp->devicePixelRatio(); + NSApp.applicationIconImage = [NSImage imageFromQIcon:icon withSize:fallbackSize]; } void QCocoaIntegration::beep() const |