Revision: 12872
          http://sourceforge.net/p/skim-app/code/12872
Author:   hofman
Date:     2022-05-03 16:40:18 +0000 (Tue, 03 May 2022)
Log Message:
-----------
Float topbar views above the scrollview, as a sibling. Set content insets for 
scrollview to the height of the topbar view. No need for reflection view. Apply 
background the sameas the window's background in presentation mode, so it 
covers the scroll view.

Modified Paths:
--------------
    trunk/LeftSideView.xib
    trunk/RightSideView.xib
    trunk/SKFindController.m
    trunk/SKMainWindowController.m
    trunk/SKMainWindowController_FullScreen.m
    trunk/SKSideViewController.m
    trunk/SKTopBarView.h
    trunk/SKTopBarView.m

Modified: trunk/LeftSideView.xib
===================================================================
--- trunk/LeftSideView.xib      2022-05-01 14:23:12 UTC (rev 12871)
+++ trunk/LeftSideView.xib      2022-05-03 16:40:18 UTC (rev 12872)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="19455" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" 
useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" 
useAutolayout="YES">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="19455"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="19529"/>
         <capability name="documents saved in the Xcode 8 format" 
minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -10,7 +10,7 @@
             <connections>
                 <outlet property="alternateButton" destination="93" id="178"/>
                 <outlet property="button" destination="140" id="166"/>
-                <outlet property="currentView" destination="142" id="168"/>
+                <outlet property="currentView" destination="133" 
id="CrG-6T-tbm"/>
                 <outlet property="findArrayController" destination="91" 
id="183"/>
                 <outlet property="findTableView" destination="111" id="184"/>
                 <outlet property="groupedFindArrayController" destination="97" 
id="181"/>
@@ -28,6 +28,9 @@
         <customView translatesAutoresizingMaskIntoConstraints="NO" id="85" 
userLabel="LeftSideView">
             <rect key="frame" x="0.0" y="0.0" width="200" height="400"/>
             <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" 
id="133">
+                    <rect key="frame" x="0.0" y="0.0" width="200" 
height="400"/>
+                </customView>
                 <customView translatesAutoresizingMaskIntoConstraints="NO" 
id="134" customClass="SKTopBarView">
                     <rect key="frame" x="0.0" y="364" width="200" height="36"/>
                     <subviews>
@@ -84,22 +87,13 @@
                         <constraint firstItem="93" firstAttribute="centerY" 
secondItem="134" secondAttribute="centerY" id="yZS-bf-pOA"/>
                     </constraints>
                 </customView>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" 
id="133">
-                    <rect key="frame" x="0.0" y="0.0" width="200" 
height="364"/>
-                    <subviews>
-                        <customView fixedFrame="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="142">
-                            <rect key="frame" x="-1" y="-1" width="202" 
height="366"/>
-                            <autoresizingMask key="autoresizingMask" 
widthSizable="YES" heightSizable="YES"/>
-                        </customView>
-                    </subviews>
-                </customView>
             </subviews>
             <constraints>
+                <constraint firstItem="133" firstAttribute="top" 
secondItem="85" secondAttribute="top" id="5g9-4X-vn7"/>
                 <constraint firstAttribute="bottom" secondItem="133" 
secondAttribute="bottom" id="T6W-X1-XBt"/>
                 <constraint firstAttribute="trailing" secondItem="133" 
secondAttribute="trailing" id="TOn-mO-lFR"/>
                 <constraint firstItem="133" firstAttribute="leading" 
secondItem="85" secondAttribute="leading" id="b3U-uC-wKa"/>
                 <constraint firstItem="134" firstAttribute="leading" 
secondItem="85" secondAttribute="leading" id="bJW-UQ-x3H"/>
-                <constraint firstItem="133" firstAttribute="top" 
secondItem="134" secondAttribute="bottom" id="bWR-sc-XNl"/>
                 <constraint firstAttribute="trailing" secondItem="134" 
secondAttribute="trailing" id="sVN-Yz-bpb"/>
                 <constraint firstItem="134" firstAttribute="top" 
secondItem="85" secondAttribute="top" id="whT-Z9-oOB"/>
             </constraints>
@@ -106,9 +100,9 @@
             <point key="canvasLocation" x="267" y="154"/>
         </customView>
         <scrollView focusRingType="none" autohidesScrollers="YES" 
horizontalLineScroll="34" horizontalPageScroll="10" verticalLineScroll="34" 
verticalPageScroll="10" hasHorizontalScroller="NO" 
usesPredominantAxisScrolling="NO" 
translatesAutoresizingMaskIntoConstraints="NO" id="98">
-            <rect key="frame" x="0.0" y="0.0" width="200" height="399"/>
+            <rect key="frame" x="0.0" y="0.0" width="200" height="435"/>
             <clipView key="contentView" drawsBackground="NO" 
translatesAutoresizingMaskIntoConstraints="NO" id="Mfb-HY-gcR">
-                <rect key="frame" x="1" y="1" width="198" height="397"/>
+                <rect key="frame" x="1" y="1" width="198" height="433"/>
                 <autoresizingMask key="autoresizingMask" widthSizable="YES" 
heightSizable="YES"/>
                 <subviews>
                     <tableView focusRingType="none" 
verticalHuggingPriority="750" allowsExpansionToolTips="YES" 
columnAutoresizingStyle="firstColumnOnly" selectionHighlightStyle="sourceList" 
columnReordering="NO" columnResizing="NO" multipleSelection="NO" 
emptySelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="32" 
viewBased="YES" id="101" customClass="SKTableView">
@@ -212,6 +206,7 @@
                 </subviews>
                 <nil key="backgroundColor"/>
             </clipView>
+            <edgeInsets key="contentInsets" left="1" right="1" top="37" 
bottom="1"/>
             <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" 
verticalHuggingPriority="750" doubleValue="0.010101010101010102" 
horizontal="YES" id="99">
                 <rect key="frame" x="-100" y="-100" width="183" height="15"/>
                 <autoresizingMask key="autoresizingMask"/>
@@ -223,14 +218,17 @@
             <point key="canvasLocation" x="267" y="154"/>
         </scrollView>
         <scrollView focusRingType="none" autohidesScrollers="YES" 
horizontalLineScroll="20" horizontalPageScroll="10" verticalLineScroll="20" 
verticalPageScroll="10" hasHorizontalScroller="NO" 
usesPredominantAxisScrolling="NO" 
translatesAutoresizingMaskIntoConstraints="NO" id="116">
-            <rect key="frame" x="0.0" y="0.0" width="200" height="400"/>
+            <rect key="frame" x="0.0" y="0.0" width="200" height="365"/>
             <clipView key="contentView" drawsBackground="NO" 
translatesAutoresizingMaskIntoConstraints="NO" id="Hnd-hK-VAX">
-                <rect key="frame" x="1" y="1" width="198" height="398"/>
+                <rect key="frame" x="1" y="1" width="198" height="363"/>
                 <autoresizingMask key="autoresizingMask" widthSizable="YES" 
heightSizable="YES"/>
                 <subviews>
-                    <outlineView focusRingType="none" 
verticalHuggingPriority="750" allowsExpansionToolTips="YES" 
columnAutoresizingStyle="firstColumnOnly" selectionHighlightStyle="sourceList" 
columnReordering="NO" columnResizing="NO" multipleSelection="NO" 
emptySelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="20" 
viewBased="YES" indentationPerLevel="14" outlineTableColumn="121" 
translatesAutoresizingMaskIntoConstraints="NO" id="119" 
customClass="SKOutlineView">
-                        <rect key="frame" x="0.0" y="0.0" width="198" 
height="398"/>
+                    <outlineView focusRingType="none" 
verticalHuggingPriority="750" allowsExpansionToolTips="YES" 
columnAutoresizingStyle="firstColumnOnly" selectionHighlightStyle="sourceList" 
columnReordering="NO" columnResizing="NO" multipleSelection="NO" 
emptySelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="20" 
viewBased="YES" indentationPerLevel="14" outlineTableColumn="121" id="119" 
customClass="SKOutlineView">
+                        <rect key="frame" x="0.0" y="0.0" width="198" 
height="327"/>
                         <autoresizingMask key="autoresizingMask" 
widthSizable="YES" heightSizable="YES"/>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="327" 
placeholder="YES" id="824-r1-IXu"/>
+                        </constraints>
                         <size key="intercellSpacing" width="3" height="0.0"/>
                         <color key="backgroundColor" 
name="_sourceListBackgroundColor" catalog="System" colorSpace="catalog"/>
                         <color key="gridColor" name="gridColor" 
catalog="System" colorSpace="catalog"/>
@@ -322,6 +320,7 @@
                 </subviews>
                 <nil key="backgroundColor"/>
             </clipView>
+            <edgeInsets key="contentInsets" left="1" right="1" top="37" 
bottom="1"/>
             <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" 
verticalHuggingPriority="750" horizontal="YES" id="117">
                 <rect key="frame" x="-100" y="-100" width="220" height="15"/>
                 <autoresizingMask key="autoresizingMask"/>
@@ -333,16 +332,16 @@
             <point key="canvasLocation" x="267" y="154"/>
         </scrollView>
         <scrollView focusRingType="none" autohidesScrollers="YES" 
horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" 
verticalPageScroll="10" hasHorizontalScroller="NO" 
usesPredominantAxisScrolling="NO" 
translatesAutoresizingMaskIntoConstraints="NO" id="107">
-            <rect key="frame" x="0.0" y="0.0" width="200" height="403"/>
+            <rect key="frame" x="0.0" y="0.0" width="200" height="441"/>
             <clipView key="contentView" 
translatesAutoresizingMaskIntoConstraints="NO" id="VaG-cU-bQa">
-                <rect key="frame" x="1" y="1" width="198" height="401"/>
+                <rect key="frame" x="1" y="1" width="198" height="439"/>
                 <autoresizingMask key="autoresizingMask" widthSizable="YES" 
heightSizable="YES"/>
                 <subviews>
                     <tableView focusRingType="none" 
verticalHuggingPriority="750" allowsExpansionToolTips="YES" 
columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" 
columnReordering="NO" columnResizing="NO" autosaveColumns="NO" typeSelect="NO" 
headerView="108" viewBased="YES" id="111" customClass="SKTableView">
-                        <rect key="frame" x="0.0" y="0.0" width="198" 
height="376"/>
+                        <rect key="frame" x="0.0" y="0.0" width="198" 
height="378"/>
                         <autoresizingMask key="autoresizingMask" 
widthSizable="YES" heightSizable="YES"/>
                         <constraints>
-                            <constraint firstAttribute="height" constant="373" 
placeholder="YES" id="sVF-ag-t03"/>
+                            <constraint firstAttribute="height" constant="375" 
placeholder="YES" id="sVF-ag-t03"/>
                         </constraints>
                         <size key="intercellSpacing" width="3" height="2"/>
                         <color key="backgroundColor" 
name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -361,7 +360,7 @@
                                 <tableColumnResizingMask key="resizingMask" 
resizeWithTable="YES" userResizable="YES"/>
                                 <prototypeCellViews>
                                     <tableCellView id="rTN-Wm-aea">
-                                        <rect key="frame" x="11" y="1" 
width="47" height="17"/>
+                                        <rect key="frame" x="1" y="1" 
width="47" height="17"/>
                                         <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <textField 
verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" 
translatesAutoresizingMaskIntoConstraints="NO" id="5CV-AT-Wi3">
@@ -400,7 +399,7 @@
                                 <tableColumnResizingMask key="resizingMask" 
resizeWithTable="YES" userResizable="YES"/>
                                 <prototypeCellViews>
                                     <tableCellView id="yHY-cQ-hrW">
-                                        <rect key="frame" x="61" y="1" 
width="116" height="17"/>
+                                        <rect key="frame" x="51" y="1" 
width="116" height="17"/>
                                         <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <textField 
verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" 
allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" 
id="EK0-Iy-KhJ">
@@ -435,6 +434,7 @@
                     </tableView>
                 </subviews>
             </clipView>
+            <edgeInsets key="contentInsets" left="1" right="1" top="37" 
bottom="1"/>
             <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" 
verticalHuggingPriority="750" horizontal="YES" id="109">
                 <rect key="frame" x="-100" y="-100" width="255" height="15"/>
                 <autoresizingMask key="autoresizingMask"/>
@@ -450,16 +450,16 @@
             <point key="canvasLocation" x="139" y="154"/>
         </scrollView>
         <scrollView focusRingType="none" autohidesScrollers="YES" 
horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" 
verticalPageScroll="10" hasHorizontalScroller="NO" 
usesPredominantAxisScrolling="NO" 
translatesAutoresizingMaskIntoConstraints="NO" id="124">
-            <rect key="frame" x="0.0" y="0.0" width="200" height="403"/>
+            <rect key="frame" x="0.0" y="0.0" width="200" height="441"/>
             <clipView key="contentView" 
translatesAutoresizingMaskIntoConstraints="NO" id="CUc-Bz-YWJ">
-                <rect key="frame" x="1" y="1" width="198" height="401"/>
+                <rect key="frame" x="1" y="1" width="198" height="439"/>
                 <autoresizingMask key="autoresizingMask" widthSizable="YES" 
heightSizable="YES"/>
                 <subviews>
                     <tableView focusRingType="none" 
verticalHuggingPriority="750" allowsExpansionToolTips="YES" 
columnAutoresizingStyle="firstColumnOnly" alternatingRowBackgroundColors="YES" 
columnReordering="NO" columnResizing="NO" autosaveColumns="NO" typeSelect="NO" 
headerView="125" viewBased="YES" id="128" customClass="SKTableView">
-                        <rect key="frame" x="0.0" y="0.0" width="198" 
height="376"/>
+                        <rect key="frame" x="0.0" y="0.0" width="198" 
height="378"/>
                         <autoresizingMask key="autoresizingMask" 
widthSizable="YES" heightSizable="YES"/>
                         <constraints>
-                            <constraint firstAttribute="height" constant="373" 
placeholder="YES" id="ofM-KJ-8Cn"/>
+                            <constraint firstAttribute="height" constant="375" 
placeholder="YES" id="ofM-KJ-8Cn"/>
                         </constraints>
                         <size key="intercellSpacing" width="3" height="2"/>
                         <color key="backgroundColor" 
name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -475,7 +475,7 @@
                                 <tableColumnResizingMask key="resizingMask" 
resizeWithTable="YES" userResizable="YES"/>
                                 <prototypeCellViews>
                                     <tableCellView id="9a8-cx-9oD" 
customClass="SKControlTableCellView">
-                                        <rect key="frame" x="11" y="1" 
width="117" height="18"/>
+                                        <rect key="frame" x="1" y="1" 
width="117" height="18"/>
                                         <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <levelIndicator 
horizontalCompressionResistancePriority="250" 
verticalCompressionResistancePriority="250" 
translatesAutoresizingMaskIntoConstraints="NO" id="zvD-nR-1Ml" 
customClass="SKLevelIndicator">
@@ -514,7 +514,7 @@
                                 <tableColumnResizingMask key="resizingMask" 
resizeWithTable="YES" userResizable="YES"/>
                                 <prototypeCellViews>
                                     <tableCellView id="hdZ-O4-HlW">
-                                        <rect key="frame" x="131" y="1" 
width="46" height="17"/>
+                                        <rect key="frame" x="121" y="1" 
width="46" height="17"/>
                                         <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <textField 
verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" 
translatesAutoresizingMaskIntoConstraints="NO" id="6S7-C8-37w">
@@ -549,6 +549,7 @@
                     </tableView>
                 </subviews>
             </clipView>
+            <edgeInsets key="contentInsets" left="1" right="1" top="37" 
bottom="1"/>
             <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" 
verticalHuggingPriority="750" horizontal="YES" id="126">
                 <rect key="frame" x="-100" y="-100" width="183" height="15"/>
                 <autoresizingMask key="autoresizingMask"/>

Modified: trunk/RightSideView.xib
===================================================================
--- trunk/RightSideView.xib     2022-05-01 14:23:12 UTC (rev 12871)
+++ trunk/RightSideView.xib     2022-05-03 16:40:18 UTC (rev 12872)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="19455" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" 
useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" 
useAutolayout="YES">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="19455"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="19529"/>
         <capability name="documents saved in the Xcode 8 format" 
minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -9,7 +9,7 @@
         <customObject id="-2" userLabel="File's Owner" 
customClass="SKRightSideViewController">
             <connections>
                 <outlet property="button" destination="23" id="49"/>
-                <outlet property="currentView" destination="26" id="51"/>
+                <outlet property="currentView" destination="18" 
id="Qci-3A-1Iz"/>
                 <outlet property="noteArrayController" destination="7" 
id="57"/>
                 <outlet property="noteOutlineView" destination="31" id="56"/>
                 <outlet property="searchField" destination="22" id="54"/>
@@ -24,6 +24,9 @@
         <customView translatesAutoresizingMaskIntoConstraints="NO" id="4" 
userLabel="RightSideView">
             <rect key="frame" x="0.0" y="0.0" width="200" height="400"/>
             <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" 
id="18">
+                    <rect key="frame" x="0.0" y="0.0" width="200" 
height="400"/>
+                </customView>
                 <customView translatesAutoresizingMaskIntoConstraints="NO" 
id="19" customClass="SKTopBarView">
                     <rect key="frame" x="0.0" y="364" width="200" height="36"/>
                     <subviews>
@@ -61,31 +64,22 @@
                         <constraint firstItem="22" firstAttribute="centerY" 
secondItem="19" secondAttribute="centerY" id="huz-5M-yGg"/>
                     </constraints>
                 </customView>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" 
id="18">
-                    <rect key="frame" x="0.0" y="0.0" width="200" 
height="364"/>
-                    <subviews>
-                        <customView fixedFrame="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="26">
-                            <rect key="frame" x="-1" y="-1" width="202" 
height="366"/>
-                            <autoresizingMask key="autoresizingMask" 
widthSizable="YES" heightSizable="YES"/>
-                        </customView>
-                    </subviews>
-                </customView>
             </subviews>
             <constraints>
+                <constraint firstItem="18" firstAttribute="top" secondItem="4" 
secondAttribute="top" id="0rR-BM-FFP"/>
                 <constraint firstItem="19" firstAttribute="leading" 
secondItem="4" secondAttribute="leading" id="7J9-lO-hZw"/>
                 <constraint firstAttribute="trailing" secondItem="19" 
secondAttribute="trailing" id="BEj-lq-GIU"/>
                 <constraint firstAttribute="bottom" secondItem="18" 
secondAttribute="bottom" id="axx-Ce-1p3"/>
                 <constraint firstAttribute="trailing" secondItem="18" 
secondAttribute="trailing" id="biz-Fh-lBJ"/>
                 <constraint firstItem="19" firstAttribute="top" secondItem="4" 
secondAttribute="top" id="nZP-UW-Kdn"/>
-                <constraint firstItem="18" firstAttribute="top" 
secondItem="19" secondAttribute="bottom" id="uTJ-hV-Es6"/>
                 <constraint firstItem="18" firstAttribute="leading" 
secondItem="4" secondAttribute="leading" id="x49-Py-hHS"/>
             </constraints>
             <point key="canvasLocation" x="267" y="154"/>
         </customView>
         <scrollView focusRingType="none" autohidesScrollers="YES" 
horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" 
verticalPageScroll="10" hasHorizontalScroller="NO" 
usesPredominantAxisScrolling="NO" 
translatesAutoresizingMaskIntoConstraints="NO" id="27" 
customClass="SKScrollView">
-            <rect key="frame" x="0.0" y="0.0" width="200" height="403"/>
+            <rect key="frame" x="0.0" y="0.0" width="200" height="439"/>
             <clipView key="contentView" 
translatesAutoresizingMaskIntoConstraints="NO" id="3pL-FC-sTQ">
-                <rect key="frame" x="1" y="1" width="198" height="401"/>
+                <rect key="frame" x="1" y="1" width="198" height="437"/>
                 <autoresizingMask key="autoresizingMask" widthSizable="YES" 
heightSizable="YES"/>
                 <subviews>
                     <outlineView focusRingType="none" 
verticalHuggingPriority="750" allowsExpansionToolTips="YES" 
columnAutoresizingStyle="firstColumnOnly" alternatingRowBackgroundColors="YES" 
typeSelect="NO" autosaveName="SKNoteOutlineView" headerView="28" 
viewBased="YES" floatsGroupRows="NO" indentationPerLevel="16" 
outlineTableColumn="35" id="31" customClass="SKNoteOutlineView">
@@ -111,7 +105,7 @@
                                 <tableColumnResizingMask key="resizingMask" 
resizeWithTable="YES" userResizable="YES"/>
                                 <prototypeCellViews>
                                     <tableCellView id="ZGN-Pg-55C">
-                                        <rect key="frame" x="11" y="1" 
width="93" height="15"/>
+                                        <rect key="frame" x="1" y="1" 
width="93" height="15"/>
                                         <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <textField 
horizontalCompressionResistancePriority="250" 
verticalCompressionResistancePriority="250" preferredMaxLayoutWidth="122" 
translatesAutoresizingMaskIntoConstraints="NO" id="T6H-tX-biW">
@@ -138,7 +132,7 @@
                                         </connections>
                                     </tableCellView>
                                     <customView identifier="row" 
translatesAutoresizingMaskIntoConstraints="NO" id="84k-Om-OZ4" 
customClass="SKNoteTableRowView">
-                                        <rect key="frame" x="11" y="18" 
width="93" height="17"/>
+                                        <rect key="frame" x="1" y="18" 
width="93" height="17"/>
                                         <autoresizingMask 
key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                                     </customView>
                                 </prototypeCellViews>
@@ -151,7 +145,7 @@
                                 <imageCell key="dataCell" 
refusesFirstResponder="YES" alignment="left" animates="YES" id="38" 
customClass="SKAnnotationTypeImageCell"/>
                                 <prototypeCellViews>
                                     <tableCellView id="dka-Zp-1o0">
-                                        <rect key="frame" x="107" y="1" 
width="21" height="17"/>
+                                        <rect key="frame" x="97" y="1" 
width="21" height="17"/>
                                         <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <imageView 
horizontalHuggingPriority="251" verticalHuggingPriority="251" 
horizontalCompressionResistancePriority="250" 
verticalCompressionResistancePriority="250" 
translatesAutoresizingMaskIntoConstraints="NO" id="Wy1-6F-s9I" 
customClass="SKAnnotationTypeImageView">
@@ -225,7 +219,7 @@
                                 </textFieldCell>
                                 <prototypeCellViews>
                                     <tableCellView id="rnK-rN-FoS">
-                                        <rect key="frame" x="131" y="1" 
width="46" height="17"/>
+                                        <rect key="frame" x="121" y="1" 
width="46" height="17"/>
                                         <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <textField 
horizontalCompressionResistancePriority="250" 
verticalCompressionResistancePriority="250" 
translatesAutoresizingMaskIntoConstraints="NO" id="iuK-OP-ap6">
@@ -338,6 +332,7 @@
                     </outlineView>
                 </subviews>
             </clipView>
+            <edgeInsets key="contentInsets" left="1" right="1" top="37" 
bottom="1"/>
             <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" 
verticalHuggingPriority="750" horizontal="YES" id="29">
                 <rect key="frame" x="-100" y="-100" width="143" height="15"/>
                 <autoresizingMask key="autoresizingMask"/>
@@ -359,7 +354,7 @@
                 <autoresizingMask key="autoresizingMask" widthSizable="YES" 
heightSizable="YES"/>
                 <subviews>
                     <tableView focusRingType="none" 
verticalHuggingPriority="750" allowsExpansionToolTips="YES" 
columnAutoresizingStyle="firstColumnOnly" columnReordering="NO" 
columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" 
rowHeight="32" viewBased="YES" translatesAutoresizingMaskIntoConstraints="NO" 
id="13" customClass="SKTableView">
-                        <rect key="frame" x="0.0" y="0.0" width="198" 
height="398"/>
+                        <rect key="frame" x="0.0" y="0.0" width="198" 
height="362"/>
                         <autoresizingMask key="autoresizingMask" 
widthSizable="YES" heightSizable="YES"/>
                         <size key="intercellSpacing" width="3" height="2"/>
                         <color key="backgroundColor" white="0.0" alpha="0.0" 
colorSpace="custom" customColorSpace="calibratedWhite"/>
@@ -374,7 +369,7 @@
                                 <tableColumnResizingMask key="resizingMask" 
resizeWithTable="YES" userResizable="YES"/>
                                 <prototypeCellViews>
                                     <tableCellView id="xMx-nb-bLR">
-                                        <rect key="frame" x="11" y="1" 
width="127" height="32"/>
+                                        <rect key="frame" x="1" y="1" 
width="127" height="32"/>
                                         <autoresizingMask 
key="autoresizingMask"/>
                                         <subviews>
                                             <imageView 
horizontalHuggingPriority="251" verticalHuggingPriority="251" 
horizontalCompressionResistancePriority="250" 
verticalCompressionResistancePriority="250" 
translatesAutoresizingMaskIntoConstraints="NO" id="S6h-PX-WpE" 
customClass="SKThumbnailImageView">
@@ -410,7 +405,7 @@
                                 <tableColumnResizingMask key="resizingMask" 
resizeWithTable="YES" userResizable="YES"/>
                                 <prototypeCellViews>
                                     <tableCellView id="EU8-lX-Lad">
-                                        <rect key="frame" x="141" y="1" 
width="36" height="15"/>
+                                        <rect key="frame" x="131" y="1" 
width="36" height="15"/>
                                         <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <textField 
horizontalCompressionResistancePriority="250" 
translatesAutoresizingMaskIntoConstraints="NO" id="r6v-xw-N5B">
@@ -459,6 +454,7 @@
                 </subviews>
                 <nil key="backgroundColor"/>
             </clipView>
+            <edgeInsets key="contentInsets" left="1" right="1" top="37" 
bottom="1"/>
             <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" 
verticalHuggingPriority="750" horizontal="YES" id="11">
                 <rect key="frame" x="-100" y="-100" width="183" height="15"/>
                 <autoresizingMask key="autoresizingMask"/>

Modified: trunk/SKFindController.m
===================================================================
--- trunk/SKFindController.m    2022-05-01 14:23:12 UTC (rev 12871)
+++ trunk/SKFindController.m    2022-05-03 16:40:18 UTC (rev 12872)
@@ -117,9 +117,7 @@
     if (view == nil) {
         NSArray *subviews = [[findBar superview] subviews];
         for (view in subviews) {
-            if (view != findBar &&
-                (fabs(NSMinY([view frame]) - NSMaxY([findBar frame])) <= 0.0 ||
-                 fabs(NSMaxY([view frame]) - NSMinY([findBar frame])) <= 0.0))
+            if (view != findBar && fabs(NSMaxY([view frame]) - NSMaxY([findBar 
frame])) <= 0.0)
                 break;
         }
     }
@@ -126,28 +124,26 @@
     
     NSView *contentView = [view superview];
     BOOL visible = (nil == [findBar superview]);
-    NSView *topView = visible ? view : findBar;
-    NSLayoutConstraint *topConstraint = [contentView 
constraintWithFirstItem:topView firstAttribute:NSLayoutAttributeTop];
+    NSLayoutConstraint *topConstraint = nil;
     CGFloat barHeight = NSHeight([findBar frame]);
     NSArray *constraints;
+    NSScrollView *scrollView = [view descendantOfClass:[NSScrollView class]];
     
     if (visible) {
-        [contentView addSubview:findBar positioned:NSWindowBelow 
relativeTo:nil];
+        [contentView addSubview:findBar];
         constraints = [NSArray arrayWithObjects:
             [NSLayoutConstraint constraintWithItem:findBar 
attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual 
toItem:contentView attribute:NSLayoutAttributeLeading multiplier:1.0 
constant:0.0],
             [NSLayoutConstraint constraintWithItem:contentView 
attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual 
toItem:findBar attribute:NSLayoutAttributeTrailing multiplier:1.0 constant:0.0],
-            [NSLayoutConstraint constraintWithItem:findBar 
attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual 
toItem:contentView attribute:NSLayoutAttributeTop multiplier:1.0 
constant:animate ? -barHeight : 0.0],
-            [NSLayoutConstraint constraintWithItem:view 
attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:findBar 
attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0.0], nil];
-        [topConstraint setActive:NO];
+            [NSLayoutConstraint constraintWithItem:findBar 
attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual 
toItem:contentView attribute:NSLayoutAttributeTop multiplier:1.0 
constant:animate ? -barHeight : 0.0], nil];
         [NSLayoutConstraint activateConstraints:constraints];
         [contentView layoutSubtreeIfNeeded];
-        topConstraint = [constraints objectAtIndex:2];
+        topConstraint = [constraints lastObject];
         
         [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification 
object:[findBar window]];
         [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(windowDidResignKey:) name:NSWindowDidResignKeyNotification 
object:[findBar window]];
         [self windowDidBecomeKey:nil];
     } else {
-        constraints = [NSArray arrayWithObjects:[NSLayoutConstraint 
constraintWithItem:view attribute:NSLayoutAttributeTop 
relatedBy:NSLayoutRelationEqual toItem:contentView 
attribute:NSLayoutAttributeTop multiplier:1.0 constant:0.0], nil];
+        topConstraint = [contentView constraintWithFirstItem:findBar 
firstAttribute:NSLayoutAttributeTop];
         
         [[NSNotificationCenter defaultCenter] removeObserver:self 
name:NSWindowDidBecomeKeyNotification object:[findBar window]];
         [[NSNotificationCenter defaultCenter] removeObserver:self 
name:NSWindowDidResignKeyNotification object:[findBar window]];
@@ -156,9 +152,10 @@
     }
     
     [messageField setHidden:YES];
-    if (visible == NO)
-        [(SKTopBarView *)[self view] reflectView:nil animate:NO 
wantsFilters:NO];
     
+    [scrollView setAutomaticallyAdjustsContentInsets:visible == NO];
+    [scrollView setContentInsets:NSEdgeInsetsMake(visible ? barHeight : 0.0, 
0.0, 0.0, 0.0)];
+    
     if (animate) {
         animating = YES;
         [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
@@ -166,27 +163,14 @@
                 [[topConstraint animator] setConstant:visible ? 0.0 : 
-barHeight];
             }
             completionHandler:^{
-                if (visible == NO) {
+                if (visible == NO)
                     [findBar removeFromSuperview];
-                    [NSLayoutConstraint activateConstraints:constraints];
-                }
-                NSWindow *window = [[self view] window];
-                if (visible) {
-                    [(SKTopBarView *)findBar reflectView:view animate:NO 
wantsFilters:YES];
-                } else {
-                    [findBar removeFromSuperview];
-                    [NSLayoutConstraint activateConstraints:constraints];
-                }
-                [window recalculateKeyViewLoop];
+                [[contentView window] recalculateKeyViewLoop];
                 animating = NO;
             }];
     } else {
-        if (visible) {
-            [(SKTopBarView *)findBar reflectView:view animate:NO 
wantsFilters:YES];
-        } else {
+        if (visible == NO)
             [findBar removeFromSuperview];
-            [NSLayoutConstraint activateConstraints:constraints];
-        }
         [contentView layoutSubtreeIfNeeded];
         [[contentView window] recalculateKeyViewLoop];
     }
@@ -193,10 +177,8 @@
 }
 
 - (void)setDelegate:(id <SKFindControllerDelegate>)newDelegate {
-    if (delegate && newDelegate == nil) {
+    if (delegate && newDelegate == nil)
         [ownerController setContent:nil];
-        [(SKTopBarView *)[self view] reflectView:nil animate:NO 
wantsFilters:NO];
-    }
     delegate = newDelegate;
 }
 

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2022-05-01 14:23:12 UTC (rev 12871)
+++ trunk/SKMainWindowController.m      2022-05-03 16:40:18 UTC (rev 12872)
@@ -1822,7 +1822,7 @@
         [findController setDelegate:self];
     }
     if ([[findController view] window] == nil) {
-        [findController toggleAboveView:pdfSplitView animate:YES];
+        [findController toggleAboveView:pdfView animate:YES];
     }
     [[findController findField] selectText:nil];
 }

Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m   2022-05-01 14:23:12 UTC (rev 
12871)
+++ trunk/SKMainWindowController_FullScreen.m   2022-05-03 16:40:18 UTC (rev 
12872)
@@ -112,7 +112,8 @@
     if (sideWindow == nil)
         sideWindow = [[SKSideWindow alloc] 
initWithView:leftSideController.view];
     
-    [leftSideController.topBar setDrawsBackground:NO];
+    [leftSideController.topBar setHasSeparator:NO];
+    [leftSideController.topBar applyPresentationBackground];
     
     mwcFlags.savedLeftSidePaneState = [self leftSidePaneState];
     [self setLeftSidePaneState:SKSidePaneStateThumbnail];
@@ -126,7 +127,8 @@
         
         if ([[sideWindow firstResponder] 
isDescendantOf:leftSideController.view])
             [sideWindow makeFirstResponder:nil];
-        [leftSideController.topBar setDrawsBackground:YES];
+        [leftSideController.topBar setHasSeparator:YES];
+        [leftSideController.topBar applyDefaultBackground];
         [leftSideController.view setFrame:[leftSideContentView bounds]];
         
         [leftSideContentView addSubview:leftSideController.view];
@@ -208,6 +210,8 @@
     [scrollView setHasHorizontalScroller:NO];
     [scrollView setHasVerticalScroller:NO];
     [scrollView setDrawsBackground:NO];
+    [scrollView setAutomaticallyAdjustsContentInsets:YES];
+    [scrollView setContentInsets:NSEdgeInsetsZero];
     
     [pdfView setCurrentSelection:nil];
     if ([pdfView hasReadingBar])
@@ -270,6 +274,10 @@
     [scrollView setHasVerticalScroller:[[savedNormalSetup 
objectForKey:HASVERTICALSCROLLER_KEY] boolValue]];
     [scrollView setAutohidesScrollers:[[savedNormalSetup 
objectForKey:AUTOHIDESSCROLLERS_KEY] boolValue]];
     [scrollView setDrawsBackground:[[savedNormalSetup 
objectForKey:DRAWSBACKGROUND_KEY] boolValue]];
+    if ([[findController view] window]) {
+        [scrollView setAutomaticallyAdjustsContentInsets:NO];
+        [scrollView 
setContentInsets:NSEdgeInsetsMake(NSHeight([[findController view] frame]), 0.0, 
0.0, 0.0)];
+    }
 }
 
 - (void)fadeInFullScreenWindowOnScreen:(NSScreen *)screen {
@@ -449,7 +457,7 @@
     interactionMode = SKNormalMode;
     
     // this should be done before exitPresentationMode to get a smooth 
transition
-    [pdfContentView addSubview:pdfView];
+    [pdfContentView addSubview:pdfView positioned:NSWindowBelow 
relativeTo:nil];
     [pdfView activateConstraintsToSuperview];
     [pdfView setBackgroundColor:backgroundColor];
     [secondaryPdfView setBackgroundColor:backgroundColor];

Modified: trunk/SKSideViewController.m
===================================================================
--- trunk/SKSideViewController.m        2022-05-01 14:23:12 UTC (rev 12871)
+++ trunk/SKSideViewController.m        2022-05-03 16:40:18 UTC (rev 12872)
@@ -66,13 +66,6 @@
     [topBar setHasSeparator:YES];
 }
 
-- (void)setMainController:(SKMainWindowController *)newMainController {
-    if (mainController && newMainController == nil) {
-        [[self topBar] reflectView:nil animate:NO wantsFilters:NO];
-    }
-    mainController = newMainController;
-}
-
 #pragma mark View animation
 
 - (BOOL)requiresAlternateButtonForView:(NSView *)aView {
@@ -96,7 +89,6 @@
     
     BOOL wasAlternate = [self requiresAlternateButtonForView:oldView];
     BOOL isAlternate = [self requiresAlternateButtonForView:newView];
-    BOOL wantsFilters = [self wantsFiltersForView:newView];
     BOOL changeButton = wasAlternate != isAlternate;
     NSSegmentedControl *oldButton = wasAlternate ? alternateButton : button;
     NSSegmentedControl *newButton = isAlternate ? alternateButton : button;
@@ -129,7 +121,6 @@
         }
         [[firstResponder window] makeFirstResponder:firstResponder];
         [[contentView window] recalculateKeyViewLoop];
-        [[self topBar] reflectView:newView animate:NO 
wantsFilters:wantsFilters];
     } else {
         isAnimating = YES;
         
@@ -157,7 +148,6 @@
                 [context setDuration:DURATION]; 
                 [[contentView animator] replaceSubview:oldView with:newView];
                 [NSLayoutConstraint activateConstraints:constraints];
-                [[self topBar] reflectView:newView animate:YES 
wantsFilters:wantsFilters];
                 if (changeButton) {
                     [[newButton animator] setHidden:NO];
                     [[oldButton animator] setHidden:YES];

Modified: trunk/SKTopBarView.h
===================================================================
--- trunk/SKTopBarView.h        2022-05-01 14:23:12 UTC (rev 12871)
+++ trunk/SKTopBarView.h        2022-05-03 16:40:18 UTC (rev 12872)
@@ -38,28 +38,22 @@
 
 #import <Cocoa/Cocoa.h>
 
-@class SKReflectionView;
+@class SKEdgeView;
 
 @interface SKTopBarView : NSView {
-       NSView *contentView;
+    SKEdgeView *contentView;
     NSVisualEffectView *backgroundView;
-    SKReflectionView *reflectionView;
     NSArray *backgroundColors;
     NSArray *alternateBackgroundColors;
-    NSColor *separatorColor;
     BOOL hasSeparator;
-       NSRectEdge overflowEdge;
-    BOOL drawsBackground;
     BOOL wantsSubviews;
 }
 
-@property (nonatomic, readonly) NSView *contentView;
+@property (nonatomic, readonly) SKEdgeView *contentView;
 @property (nonatomic, copy) NSArray *backgroundColors, 
*alternateBackgroundColors;
-@property (nonatomic, retain) NSColor *separatorColor;
-@property (nonatomic, readonly) NSRect contentRect;
-@property (nonatomic) NSRectEdge overflowEdge;
-@property (nonatomic) BOOL hasSeparator, drawsBackground;
+@property (nonatomic) BOOL hasSeparator;
 
-- (void)reflectView:(NSView *)view animate:(BOOL)animate 
wantsFilters:(BOOL)wantsFilters;
+- (void)applyDefaultBackground;
+- (void)applyPresentationBackground;
 
 @end

Modified: trunk/SKTopBarView.m
===================================================================
--- trunk/SKTopBarView.m        2022-05-01 14:23:12 UTC (rev 12871)
+++ trunk/SKTopBarView.m        2022-05-03 16:40:18 UTC (rev 12872)
@@ -37,7 +37,6 @@
  */
 
 #import "SKTopBarView.h"
-#import "SKReflectionView.h"
 #import "NSGeometry_SKExtensions.h"
 #import "NSColor_SKExtensions.h"
 #import "NSView_SKExtensions.h"
@@ -46,10 +45,17 @@
 
 #define SEPARATOR_WIDTH 1.0
 
+@interface SKEdgeView : NSView {
+    BOOL hasSeparator;
+}
+@property (nonatomic) BOOL hasSeparator;
+@end
+
+#pragma mark -
+
 @implementation SKTopBarView
 
-@synthesize contentView, backgroundColors, alternateBackgroundColors, 
separatorColor, overflowEdge, hasSeparator, drawsBackground;
-@dynamic contentRect;
+@synthesize contentView, backgroundColors, alternateBackgroundColors, 
hasSeparator;
 
 - (id)initWithFrame:(NSRect)frame {
     wantsSubviews = YES;
@@ -56,31 +62,14 @@
     self = [super initWithFrame:frame];
     if (self) {
         hasSeparator = NO; // we start with no separator, so we can use this 
in IB without getting weird offsets
-               overflowEdge = NSMaxXEdge;
-        drawsBackground = YES;
         if (RUNNING_AFTER(10_13)) {
-            backgroundColors = nil;
-            alternateBackgroundColors = nil;
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
-            separatorColor = [[NSColor separatorColor] retain];
-#pragma clang diagnostic pop
-            backgroundView = [[NSVisualEffectView alloc] initWithFrame:[self 
contentRect]];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
-            [backgroundView setMaterial:RUNNING_AFTER(10_15) ? 
NSVisualEffectMaterialTitlebar : NSVisualEffectMaterialHeaderView];
-#pragma clang diagnostic pop
-            [backgroundView 
setBlendingMode:NSVisualEffectBlendingModeWithinWindow];
+            backgroundView = [[NSVisualEffectView alloc] initWithFrame:[self 
bounds]];
             [super addSubview:backgroundView];
-        } else {
-            static CGFloat defaultGrays[5] = {0.85, 0.9,  0.9, 0.95,  0.8};
-            backgroundColors = [[NSArray alloc] initWithObjects:[NSColor 
colorWithGenericGamma22White:defaultGrays[0] alpha:1.0], [NSColor 
colorWithGenericGamma22White:defaultGrays[1] alpha:1.0], nil];
-            alternateBackgroundColors = [[NSArray alloc] 
initWithObjects:[NSColor colorWithGenericGamma22White:defaultGrays[2] 
alpha:1.0], [NSColor colorWithGenericGamma22White:defaultGrays[3] alpha:1.0], 
nil];
-            separatorColor = [[NSColor 
colorWithGenericGamma22White:defaultGrays[4] alpha:1.0] retain];
         }
-        contentView = [[NSView alloc] initWithFrame:[self contentRect]];
+        contentView = [[SKEdgeView alloc] initWithFrame:[self bounds]];
         [super addSubview:contentView];
         wantsSubviews = NO;
+        [self applyDefaultBackground];
     }
     return self;
 }
@@ -92,13 +81,9 @@
                // this decodes only the reference, the actual view should 
already be decoded as a subview
         contentView = [[decoder decodeObjectForKey:@"contentView"] retain];
         backgroundView = [[decoder decodeObjectForKey:@"backgroundView"] 
retain];
-        reflectionView = [[decoder decodeObjectForKey:@"reflectionView"] 
retain];
         backgroundColors = [[decoder decodeObjectForKey:@"backgroundColors"] 
retain];
         alternateBackgroundColors = [[decoder 
decodeObjectForKey:@"alternateBackgroundColors"] retain];
-        separatorColor = [[decoder decodeObjectForKey:@"separatorColor"] 
retain];
-               overflowEdge = [decoder decodeIntegerForKey:@"overflowEdge"];
         hasSeparator = [decoder decodeBoolForKey:@"hasSeparator"];
-        drawsBackground = [decoder decodeBoolForKey:@"drawsBackground"];
         wantsSubviews = NO;
        }
        return self;
@@ -109,12 +94,9 @@
     // this encodes only a reference, the actual contentView should already be 
encoded because it's a subview
     [coder encodeConditionalObject:contentView forKey:@"contentView"];
     [coder encodeConditionalObject:backgroundView forKey:@"backgroundView"];
-    [coder encodeConditionalObject:reflectionView forKey:@"reflectionView"];
     [coder encodeObject:backgroundColors forKey:@"backgroundColors"];
     [coder encodeObject:alternateBackgroundColors 
forKey:@"alternateBackgroundColors"];
-    [coder encodeInteger:overflowEdge forKey:@"overflowEdge"];
     [coder encodeBool:hasSeparator forKey:@"hasSeparator"];
-    [coder encodeBool:drawsBackground forKey:@"drawsBackground"];
 }
 
 - (void)dealloc {
@@ -121,18 +103,15 @@
     [[NSNotificationCenter defaultCenter] removeObserver:self];
     SKDESTROY(contentView);
     SKDESTROY(backgroundView);
-    SKDESTROY(reflectionView);
     SKDESTROY(backgroundColors);
     SKDESTROY(alternateBackgroundColors);
-    SKDESTROY(separatorColor);
        [super dealloc];
 }
 
 - (void)resizeSubviewsWithOldSize:(NSSize)size {
     [super resizeSubviewsWithOldSize:size];
-    NSRect rect = [self contentRect];
+    NSRect rect = [self bounds];
     [backgroundView setFrame:rect];
-    [reflectionView setFrame:rect];
     [contentView setFrame:rect];
 }
 
@@ -158,26 +137,20 @@
 
 }
 
-- (void)drawRect:(NSRect)aRect
-{        
-       if ([self drawsBackground] == NO)
+- (void)drawRect:(NSRect)aRect {
+    NSArray *colors = backgroundColors;
+    if (alternateBackgroundColors && [[self window] isMainWindow] == NO && 
[[self window] isKeyWindow] == NO)
+        colors = alternateBackgroundColors;
+    
+    if ([colors count] == 0)
         return;
     
     NSRect rect = [self bounds];
-       
+    if (hasSeparator)
+        rect = SKShrinkRect(rect, 1.0, NSMinYEdge);
+    
     [NSGraphicsContext saveGraphicsState];
     
-    if (hasSeparator) {
-        NSRect edgeRect;
-               NSDivideRect(rect, &edgeRect, &rect, SEPARATOR_WIDTH, 
NSMinYEdge);
-        [[self separatorColor] setFill];
-        [NSBezierPath fillRect:edgeRect];
-       }
-    
-    NSArray *colors = backgroundColors;
-    if (alternateBackgroundColors && [[self window] isMainWindow] == NO && 
[[self window] isKeyWindow] == NO)
-        colors = alternateBackgroundColors;
-    
     if ([colors count] > 1) {
         NSGradient *aGradient = [[NSGradient alloc] initWithColors:colors];
         [aGradient drawInRect:rect angle:90.0];
@@ -211,7 +184,7 @@
 }
 
 - (void)viewWillMoveToWindow:(NSWindow *)newWindow {
-    if (drawsBackground && alternateBackgroundColors) {
+    if (alternateBackgroundColors) {
         NSWindow *oldWindow = [self window];
         if (oldWindow)
             [self stopObservingWindow:oldWindow];
@@ -221,38 +194,17 @@
     [super viewWillMoveToWindow:newWindow];
 }
 
-// required in order for redisplay to work properly with the controls
-- (BOOL)isOpaque{ return [self drawsBackground] && [self backgroundColors]; }
-
 - (void)setHasSeparator:(BOOL)flag {
        if (flag != hasSeparator) {
                hasSeparator = flag;
-        NSRect rect = [self contentRect];
-        [backgroundView setFrame:rect];
-        [reflectionView setFrame:rect];
-        [contentView setFrame:rect];
+        [contentView setHasSeparator:hasSeparator];
                [self setNeedsDisplay:YES];
        }
 }
 
-- (void)setDrawsBackground:(BOOL)flag {
-    if (flag != drawsBackground) {
-        if ([self window] && alternateBackgroundColors) {
-            if (drawsBackground)
-                [self stopObservingWindow:[self window]];
-            else
-                [self startObservingWindow:[self window]];
-        }
-        drawsBackground = flag;
-        [backgroundView setHidden:drawsBackground == NO];
-        [reflectionView setHidden:drawsBackground == NO];
-        [self setNeedsDisplay:YES];
-    }
-}
-
 - (void)setAlternateBackgroundColors:(NSArray *)colors {
     if (colors != alternateBackgroundColors) {
-        if ([self window] && drawsBackground) {
+        if ([self window]) {
             if (alternateBackgroundColors && colors == nil)
                 [self stopObservingWindow:[self window]];
             else if (alternateBackgroundColors == nil && colors)
@@ -263,46 +215,71 @@
     }
 }
 
-- (NSRect)contentRect {
-    NSRect rect = [self bounds];
-    if (hasSeparator)
-        rect = SKShrinkRect(rect, SEPARATOR_WIDTH, NSMinYEdge);
-    return rect;
+- (void)applyDefaultBackground {
+    if (RUNNING_AFTER(10_13)) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpartial-availability"
+        [backgroundView setMaterial:RUNNING_AFTER(10_15) ? 
NSVisualEffectMaterialTitlebar : NSVisualEffectMaterialHeaderView];
+#pragma clang diagnostic pop
+        [backgroundView 
setBlendingMode:NSVisualEffectBlendingModeWithinWindow];
+    } else {
+        static CGFloat defaultGrays[5] = {0.85, 0.9,  0.9, 0.95};
+        [self setBackgroundColors:[NSArray arrayWithObjects:[NSColor 
colorWithGenericGamma22White:defaultGrays[0] alpha:1.0], [NSColor 
colorWithGenericGamma22White:defaultGrays[1] alpha:1.0], nil]];
+        [self setAlternateBackgroundColors:[NSArray arrayWithObjects:[NSColor 
colorWithGenericGamma22White:defaultGrays[2] alpha:1.0], [NSColor 
colorWithGenericGamma22White:defaultGrays[3] alpha:1.0], nil]];
+    }
 }
 
-- (void)reflectView:(NSView *)view animate:(BOOL)animate 
wantsFilters:(BOOL)wantsFilters {
-    if (RUNNING_BEFORE(10_14) || [[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisableSearchBarBlurringKey])
-        return;
-    NSScrollView *scrollView = [view descendantOfClass:[NSScrollView class]];
-    if (scrollView == [reflectionView reflectedScrollView]) {
-        [reflectionView setWantsFilters:wantsFilters];
-        return;
+- (void)applyPresentationBackground {
+    if (RUNNING_AFTER(10_13)) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpartial-availability"
+        [backgroundView setMaterial:NSVisualEffectMaterialSidebar];
+#pragma clang diagnostic pop
+        [backgroundView 
setBlendingMode:NSVisualEffectBlendingModeBehindWindow];
+    } else {
+        [self setBackgroundColors:[NSArray arrayWithObjects:[NSColor 
windowBackgroundColor], nil]];
+        [self setAlternateBackgroundColors:nil];
     }
-    if (animate == NO || [self drawsBackground] == NO) {
-        if (reflectionView == nil) {
-            reflectionView = [[SKReflectionView alloc] initWithFrame:[self 
contentRect]];
-            [reflectionView setHidden:drawsBackground == NO];
-            [reflectionView setReflectedScrollView:scrollView];
-            wantsSubviews = YES;
-            [super addSubview:reflectionView positioned:NSWindowBelow 
relativeTo:nil];
-            wantsSubviews = NO;
-        } else {
-            [reflectionView setReflectedScrollView:scrollView];
-        }
-        [reflectionView setWantsFilters:wantsFilters];
-    } else {
-        SKReflectionView *newView = [[SKReflectionView alloc] 
initWithFrame:[self contentRect]];
-        [newView setHidden:drawsBackground == NO];
-        [newView setReflectedScrollView:scrollView];
-        [newView setWantsFilters:wantsFilters];
-        wantsSubviews = YES;
-        if (reflectionView)
-            [[self animator] replaceSubview:reflectionView with:newView];
+}
+
+@end
+
+#pragma mark -
+
+@implementation SKEdgeView
+
+@synthesize hasSeparator;
+
+- (id)initWithCoder:(NSCoder *)decoder {
+    self = [super initWithCoder:decoder];
+    if (self) {
+        hasSeparator = [decoder decodeBoolForKey:@"hasSeparator"];
+    }
+    return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+    [super encodeWithCoder:coder];
+    [coder encodeBool:hasSeparator forKey:@"hasSeparator"];
+}
+
+- (void)setHasSeparator:(BOOL)flag {
+    if (flag != hasSeparator) {
+        hasSeparator = flag;
+        [self setNeedsDisplay:YES];
+    }
+}
+
+- (void)drawRect:(NSRect)dirtyRect {
+    if ([self hasSeparator]) {
+        if (RUNNING_AFTER(10_13))
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpartial-availability"
+            [[NSColor separatorColor] setFill];
+#pragma clang diagnostic pop
         else
-            [[self animator] addSubview:newView positioned:NSWindowBelow 
relativeTo:nil];
-        wantsSubviews = NO;
-        [reflectionView release];
-        reflectionView = newView;
+            [[NSColor colorWithGenericGamma22White:0.8 alpha:1.0] setFill];
+        [NSBezierPath fillRect:SKSliceRect([self bounds], SEPARATOR_WIDTH, 
NSMinYEdge)];
     }
 }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to