Title: [264441] trunk/Tools
Revision
264441
Author
d...@apple.com
Date
2020-07-15 18:39:30 -0700 (Wed, 15 Jul 2020)

Log Message

MiniBrowser toolbar is ugly with default macOS Big Sur style
https://bugs.webkit.org/show_bug.cgi?id=214390
rdar://65637420

Reviewed by Tim Horton.

Rather than using the Big Sur default "unified" style, explicitly
ask for the "expanded" style.

While here, use symbols for the toolbar buttons, and move the
progress indicator to the end of the toolbar. I hope this
change to the xib file won't break the Catalina version.

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

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (264440 => 264441)


--- trunk/Tools/ChangeLog	2020-07-16 00:55:56 UTC (rev 264440)
+++ trunk/Tools/ChangeLog	2020-07-16 01:39:30 UTC (rev 264441)
@@ -1,3 +1,24 @@
+2020-07-15  Dean Jackson  <d...@apple.com>
+
+        MiniBrowser toolbar is ugly with default macOS Big Sur style
+        https://bugs.webkit.org/show_bug.cgi?id=214390
+        rdar://65637420
+
+        Reviewed by Tim Horton.
+
+        Rather than using the Big Sur default "unified" style, explicitly
+        ask for the "expanded" style.
+
+        While here, use symbols for the toolbar buttons, and move the
+        progress indicator to the end of the toolbar. I hope this
+        change to the xib file won't break the Catalina version.
+
+        * MiniBrowser/mac/BrowserWindow.xib:
+        * MiniBrowser/mac/BrowserWindowController.m:
+        (-[BrowserWindowController windowDidLoad]):
+        * MiniBrowser/mac/WK2BrowserWindowController.m:
+        (-[WK2BrowserWindowController updateTitle:]):
+
 2020-07-15  Jonathan Bedard  <jbed...@apple.com>
 
         [webkitcorepy] Spin off general webkitpy tools into a pip module

Modified: trunk/Tools/MiniBrowser/mac/BrowserWindow.xib (264440 => 264441)


--- trunk/Tools/MiniBrowser/mac/BrowserWindow.xib	2020-07-16 00:55:56 UTC (rev 264440)
+++ trunk/Tools/MiniBrowser/mac/BrowserWindow.xib	2020-07-16 01:39:30 UTC (rev 264441)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11191" systemVersion="16D17a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17132" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
     <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11191"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17132"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="BrowserWindowController">
@@ -21,16 +21,16 @@
         </customObject>
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" _oneShot_="NO" frameAutosaveName="Main Window" animationBehavior="default" id="1">
-            <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" unifiedTitleAndToolbar="YES" fullSizeContentView="YES"/>
+        <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" frameAutosaveName="Main Window" animationBehavior="default" id="1">
+            <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="517" y="330" width="776" height="608"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1177"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
             <view key="contentView" id="2">
                 <rect key="frame" x="0.0" y="0.0" width="776" height="608"/>
-                <autoresizingMask key="autoresizingMask"/>
+                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                 <subviews>
-                    <customView id="9">
+                    <customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9">
                         <rect key="frame" x="0.0" y="0.0" width="776" height="608"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                     </customView>
@@ -40,7 +40,7 @@
                 <allowedToolbarItems>
                     <toolbarItem implicitItemIdentifier="73DE9F4B-73E2-4036-A134-2D9E029DA980" label="Go Back" paletteLabel="Go Back" image="NSGoLeftTemplate" id="56" customClass="MBToolbarItem">
                         <nil key="toolTip"/>
-                        <size key="minSize" width="32" height="27"/>
+                        <size key="minSize" width="32" height="25"/>
                         <size key="maxSize" width="32" height="25"/>
                         <button key="view" verticalHuggingPriority="750" id="40">
                             <rect key="frame" x="10" y="14" width="32" height="25"/>
@@ -56,7 +56,7 @@
                     </toolbarItem>
                     <toolbarItem implicitItemIdentifier="E1A9D32A-59E3-467B-9ABA-A95780416E69" label="Go Forward" paletteLabel="Go Forward" image="NSGoRightTemplate" id="57" customClass="MBToolbarItem">
                         <nil key="toolTip"/>
-                        <size key="minSize" width="32" height="27"/>
+                        <size key="minSize" width="32" height="25"/>
                         <size key="maxSize" width="32" height="27"/>
                         <button key="view" verticalHuggingPriority="750" id="42">
                             <rect key="frame" x="18" y="14" width="32" height="25"/>
@@ -72,7 +72,7 @@
                     </toolbarItem>
                     <toolbarItem implicitItemIdentifier="88C16109-D40F-4682-BCE4-CBEE2EDE32D2" label="Refresh" paletteLabel="Refresh" image="NSRefreshTemplate" id="58" customClass="MBToolbarItem">
                         <nil key="toolTip"/>
-                        <size key="minSize" width="29" height="27"/>
+                        <size key="minSize" width="29" height="25"/>
                         <size key="maxSize" width="29" height="27"/>
                         <button key="view" verticalHuggingPriority="750" id="23">
                             <rect key="frame" x="10" y="14" width="29" height="25"/>
@@ -88,7 +88,7 @@
                     </toolbarItem>
                     <toolbarItem implicitItemIdentifier="76DCF2B0-1DDE-47D2-9212-705E6E310CCE" label="Use Shrink To Fit" paletteLabel="Use Shrink To Fit" image="NSEnterFullScreenTemplate" id="81" customClass="MBToolbarItem">
                         <nil key="toolTip"/>
-                        <size key="minSize" width="29" height="27"/>
+                        <size key="minSize" width="29" height="25"/>
                         <size key="maxSize" width="29" height="27"/>
                         <button key="view" verticalHuggingPriority="750" id="82">
                             <rect key="frame" x="34" y="14" width="29" height="25"/>
@@ -104,7 +104,7 @@
                     </toolbarItem>
                     <toolbarItem implicitItemIdentifier="F1738B7F-895C-48F7-955D-0915E150BE1B" label="Share" paletteLabel="Share" image="NSShareTemplate" id="dJx-dw-gcC" customClass="MBToolbarItem">
                         <nil key="toolTip"/>
-                        <size key="minSize" width="29" height="27"/>
+                        <size key="minSize" width="29" height="25"/>
                         <size key="maxSize" width="29" height="27"/>
                         <button key="view" verticalHuggingPriority="750" id="1hB-AH-eUl">
                             <rect key="frame" x="5" y="14" width="29" height="25"/>
@@ -127,7 +127,7 @@
                             <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
                             <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="11">
                                 <font key="font" metaFont="system"/>
-                                <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                                 <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                             </textFieldCell>
                             <connections>
@@ -135,10 +135,8 @@
                             </connections>
                         </textField>
                     </toolbarItem>
-                    <toolbarItem implicitItemIdentifier="86912BAA-B8D0-400F-BFEE-71FC166986E6" label="Progress" paletteLabel="Progress" tag="-1" id="60">
+                    <toolbarItem implicitItemIdentifier="86912BAA-B8D0-400F-BFEE-71FC166986E6" label="Progress" paletteLabel="Progress" tag="-1" sizingBehavior="auto" id="60">
                         <nil key="toolTip"/>
-                        <size key="minSize" width="16" height="16"/>
-                        <size key="maxSize" width="16" height="16"/>
                         <progressIndicator key="view" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="1" displayedWhenStopped="NO" bezeled="NO" controlSize="small" style="spinning" id="21">
                             <rect key="frame" x="19" y="14" width="16" height="16"/>
                             <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
@@ -150,20 +148,21 @@
                     <toolbarItem reference="57"/>
                     <toolbarItem reference="58"/>
                     <toolbarItem reference="59"/>
+                    <toolbarItem reference="dJx-dw-gcC"/>
                     <toolbarItem reference="60"/>
-                    <toolbarItem reference="dJx-dw-gcC"/>
                 </defaultToolbarItems>
             </toolbar>
             <connections>
                 <outlet property="delegate" destination="-2" id="4"/>
             </connections>
+            <point key="canvasLocation" x="-136" y="158"/>
         </window>
     </objects>
     <resources>
-        <image name="NSEnterFullScreenTemplate" width="15" height="15"/>
-        <image name="NSGoLeftTemplate" width="9" height="12"/>
-        <image name="NSGoRightTemplate" width="9" height="12"/>
-        <image name="NSRefreshTemplate" width="11" height="15"/>
-        <image name="NSShareTemplate" width="11" height="16"/>
+        <image name="NSEnterFullScreenTemplate" width="16" height="15"/>
+        <image name="NSGoLeftTemplate" width="10" height="14"/>
+        <image name="NSGoRightTemplate" width="10" height="14"/>
+        <image name="NSRefreshTemplate" width="14" height="16"/>
+        <image name="NSShareTemplate" width="15" height="17"/>
     </resources>
 </document>

Modified: trunk/Tools/MiniBrowser/mac/BrowserWindowController.m (264440 => 264441)


--- trunk/Tools/MiniBrowser/mac/BrowserWindowController.m	2020-07-16 00:55:56 UTC (rev 264440)
+++ trunk/Tools/MiniBrowser/mac/BrowserWindowController.m	2020-07-16 01:39:30 UTC (rev 264441)
@@ -43,6 +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;
+
+        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"];
+    }
     [share sendActionOn:NSEventMaskLeftMouseDown];
     [super windowDidLoad];
 }

Modified: trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m (264440 => 264441)


--- trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m	2020-07-16 00:55:56 UTC (rev 264440)
+++ trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m	2020-07-16 01:39:30 UTC (rev 264441)
@@ -514,7 +514,11 @@
         title = url.lastPathComponent ?: url._web_userVisibleString;
     }
 
-    self.window.title = [NSString stringWithFormat:@"%@%@ [WK2 %d]%@", _isPrivateBrowsingWindow ? @"🙈 " : @"", title, _webView._webProcessIdentifier, _webView._editable ? @" [Editable]" : @""];
+    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]" : @""];
 }
 
 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to