Skip to content

Commit 74de26f

Browse files
Deps: Add additional fixes for Mac OS 11 compat
1 parent 13dcad3 commit 74de26f

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/scripts/macos/qt-macos11compat.patch

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,44 @@ index 6b33d94d58c..867389e4c93 100644
7676
}
7777

7878
void QCocoaWindow::updateSafeAreaMarginsIfNeeded()
79+
diff --git a/src/gui/platform/darwin/qappleiconengine.mm b/src/gui/platform/darwin/qappleiconengine.mm
80+
index 5d03782..c9a84b2 100644
81+
--- a/src/gui/platform/darwin/qappleiconengine.mm
82+
+++ b/src/gui/platform/darwin/qappleiconengine.mm
83+
@@ -360,25 +360,67 @@ auto *configuredImage(const NSImage *image, const QColor &color)
84+
auto *config = [NSImageSymbolConfiguration configurationWithPointSize:48
85+
weight:NSFontWeightRegular
86+
scale:NSImageSymbolScaleLarge];
87+
88+
- config = [config configurationByApplyingConfiguration:
89+
- [NSImageSymbolConfiguration configurationWithPaletteColors:@[
90+
- [NSColor colorWithSRGBRed:color.redF() green:color.greenF()
91+
- blue:color.blueF() alpha:color.alphaF()]
92+
- ]]];
93+
94+
+ if (@available(macOS 12.0, *)) {
95+
+ NSColor *tintColor = [NSColor colorWithSRGBRed:color.redF()
96+
+ green:color.greenF()
97+
+ blue:color.blueF()
98+
+ alpha:color.alphaF()];
99+
+ NSImageSymbolConfiguration *paletteCfg =
100+
+ [NSImageSymbolConfiguration configurationWithPaletteColors:@[ tintColor ]];
101+
+
102+
+ config = [config configurationByApplyingConfiguration:paletteCfg];
103+
+ }
104+
105+
- config = [config configurationByApplyingConfiguration:
106+
- [NSImageSymbolConfiguration configurationPreferringMonochrome]];
107+
108+
+ if (@available(macOS 12.0, *)) {
109+
+ if (@available(macOS 13.0, *)) {
110+
+ NSImageSymbolConfiguration *monoCfg =
111+
+ [NSImageSymbolConfiguration configurationPreferringMonochrome];
112+
+
113+
+ config = [config configurationByApplyingConfiguration:monoCfg];
114+
+ }
115+
+ }
116+
117+
return [image imageWithSymbolConfiguration:config];
118+
}
119+

0 commit comments

Comments
 (0)