Title: [264443] trunk/Tools/MiniBrowser/mac
Revision
264443
Author
[email protected]
Date
2020-07-15 19:21:47 -0700 (Wed, 15 Jul 2020)

Log Message

Unreviewed fix for Catalina.

Use a #if rather than @available so we don't have to
forward declare the Big Sur things.

* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController windowDidLoad]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController updateTitle:]):

Modified Paths

Diff

Modified: trunk/Tools/MiniBrowser/mac/BrowserWindowController.m (264442 => 264443)


--- trunk/Tools/MiniBrowser/mac/BrowserWindowController.m	2020-07-16 02:16:02 UTC (rev 264442)
+++ trunk/Tools/MiniBrowser/mac/BrowserWindowController.m	2020-07-16 02:21:47 UTC (rev 264443)
@@ -43,18 +43,18 @@
 
 - (void)windowDidLoad
 {
-    if (@available(macOS 11, *)) {
-        // FIXME: We should probably adopt the default unified style, but we'd need
-        // somewhere to put the window/page title.
-        self.window.toolbarStyle = NSWindowToolbarStyleExpanded;
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000
+    // FIXME: We should probably adopt the default unified style, but we'd need
+    // somewhere to put the window/page title.
+    self.window.toolbarStyle = NSWindowToolbarStyleExpanded;
 
-        reloadButton.image = [NSImage imageWithSystemSymbolName:@"arrow.clockwise" accessibilityDescription:@"Reload"];
-        // FIXME: Should these be localized?
-        backButton.image = [NSImage imageWithSystemSymbolName:@"chevron.left" accessibilityDescription:@"Go back"];
-        forwardButton.image = [NSImage imageWithSystemSymbolName:@"chevron.right" accessibilityDescription:@"Go forward"];
-        share.image = [NSImage imageWithSystemSymbolName:@"square.and.arrow.up" accessibilityDescription:@"Share"];
-        toggleUseShrinkToFitButton.image = [NSImage imageWithSystemSymbolName:@"arrow.up.left.and.arrow.down.right" accessibilityDescription:@"Use Shrink to fit"];
-    }
+    reloadButton.image = [NSImage imageWithSystemSymbolName:@"arrow.clockwise" accessibilityDescription:@"Reload"];
+    // FIXME: Should these be localized?
+    backButton.image = [NSImage imageWithSystemSymbolName:@"chevron.left" accessibilityDescription:@"Go back"];
+    forwardButton.image = [NSImage imageWithSystemSymbolName:@"chevron.right" accessibilityDescription:@"Go forward"];
+    share.image = [NSImage imageWithSystemSymbolName:@"square.and.arrow.up" accessibilityDescription:@"Share"];
+    toggleUseShrinkToFitButton.image = [NSImage imageWithSystemSymbolName:@"arrow.up.left.and.arrow.down.right" accessibilityDescription:@"Use Shrink to fit"];
+#endif
     [share sendActionOn:NSEventMaskLeftMouseDown];
     [super windowDidLoad];
 }

Modified: trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m (264442 => 264443)


--- trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m	2020-07-16 02:16:02 UTC (rev 264442)
+++ trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m	2020-07-16 02:21:47 UTC (rev 264443)
@@ -514,11 +514,12 @@
         title = url.lastPathComponent ?: url._web_userVisibleString;
     }
 
-    if (@available(macOS 11, *)) {
-        self.window.title = title;
-        self.window.subtitle = [NSString stringWithFormat:@"[WK2 %d]%@%@", _webView._webProcessIdentifier, _isPrivateBrowsingWindow ? @" 🙈" : @"", _webView._editable ? @" ✏️" : @""];
-    } else
-        self.window.title = [NSString stringWithFormat:@"%@%@ [WK2 %d]%@", _isPrivateBrowsingWindow ? @"🙈 " : @"", title, _webView._webProcessIdentifier, _webView._editable ? @" [Editable]" : @""];
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000
+    self.window.title = title;
+    self.window.subtitle = [NSString stringWithFormat:@"[WK2 %d]%@%@", _webView._webProcessIdentifier, _isPrivateBrowsingWindow ? @" 🙈" : @"", _webView._editable ? @" ✏️" : @""];
+#else
+    self.window.title = [NSString stringWithFormat:@"%@%@ [WK2 %d]%@", _isPrivateBrowsingWindow ? @"🙈 " : @"", title, _webView._webProcessIdentifier, _webView._editable ? @" [Editable]" : @""];
+#endif
 }
 
 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to