Revision: 12126
http://sourceforge.net/p/skim-app/code/12126
Author: hofman
Date: 2021-02-26 15:11:39 +0000 (Fri, 26 Feb 2021)
Log Message:
-----------
make sure toolbar and titlebar are not integrated on Big Sur
Modified Paths:
--------------
trunk/SKCompatibility.h
trunk/SKMainWindowController.m
Modified: trunk/SKCompatibility.h
===================================================================
--- trunk/SKCompatibility.h 2021-02-26 14:10:19 UTC (rev 12125)
+++ trunk/SKCompatibility.h 2021-02-26 15:11:39 UTC (rev 12126)
@@ -59,6 +59,9 @@
#ifndef MAC_OS_X_VERSION_10_16
#define MAC_OS_X_VERSION_10_16 101600
#endif
+#ifndef MAC_OS_X_VERSION_11_0
+ #define MAC_OS_VERSION_11_0 110000
+#endif
#if SDK_BEFORE(10_13)
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2021-02-26 14:10:19 UTC (rev 12125)
+++ trunk/SKMainWindowController.m 2021-02-26 15:11:39 UTC (rev 12126)
@@ -189,6 +189,20 @@
@end
#endif
+#if SDK_BEFORE(11_0)
+typedef NS_ENUM(NSInteger, NSWindowToolbarStyle) {
+ NSWindowToolbarStyleAutomatic,
+ NSWindowToolbarStyleExpanded,
+ NSWindowToolbarStylePreference,
+ NSWindowToolbarStyleUnified,
+ NSWindowToolbarStyleUnifiedCompact
+};
+@interface NSWindow (SKBigSurExtensions)
+- (NSWindowToolbarStyle)toolbarStyle;
+- (void)setToolbarStyle:(NSWindowToolbarStyle)style;
+@end
+#endif
+
#pragma mark -
@interface SKMainWindowController (SKPrivate)
@@ -401,6 +415,11 @@
[window setCollectionBehavior:[window collectionBehavior] |
NSWindowCollectionBehaviorFullScreenPrimary];
[window setStyleMask:[window styleMask] | NSFullSizeContentViewWindowMask];
+ if ([window respondsToSelector:@selector(setToolbarStyle:)])
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpartial-availability"
+ [window setToolbarStyle:NSWindowToolbarStyleExpanded];
+#pragma clang diagnostic pop
[[splitView superview] setFrame:[window contentLayoutRect]];
[window addObserver:self forKeyPath:CONTENTLAYOUTRECT_KEY options:0
context:&SKMainWindowContentLayoutRectObservationContext];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit