Revision: 12493
          http://sourceforge.net/p/skim-app/code/12493
Author:   hofman
Date:     2021-10-31 22:40:39 +0000 (Sun, 31 Oct 2021)
Log Message:
-----------
Hide/unhide alternate button in side view rather than replce

Modified Paths:
--------------
    trunk/LeftSideView.xib
    trunk/RightSideView.xib
    trunk/SKSideViewController.m

Modified: trunk/LeftSideView.xib
===================================================================
--- trunk/LeftSideView.xib      2021-10-31 15:59:51 UTC (rev 12492)
+++ trunk/LeftSideView.xib      2021-10-31 22:40:39 UTC (rev 12493)
@@ -32,30 +32,37 @@
                 <customView translatesAutoresizingMaskIntoConstraints="NO" 
id="134" customClass="SKTopBarView">
                     <rect key="frame" x="0.0" y="364" width="200" height="36"/>
                     <subviews>
-                        <customView 
translatesAutoresizingMaskIntoConstraints="NO" id="137">
-                            <rect key="frame" x="0.0" y="0.0" width="71" 
height="36"/>
-                            <subviews>
-                                <segmentedControl 
verticalHuggingPriority="750" fixedFrame="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="140">
-                                    <rect key="frame" x="8" y="5" width="57" 
height="25"/>
-                                    <autoresizingMask key="autoresizingMask" 
flexibleMaxX="YES" flexibleMinY="YES"/>
-                                    <segmentedCell key="cell" 
borderStyle="border" alignment="left" style="texturedRounded" 
trackingMode="selectOne" id="141">
-                                        <font key="font" metaFont="system"/>
-                                        <segments>
-                                            <segment 
image="ThumbnailViewAdorn" imageScaling="none" width="25"/>
-                                            <segment image="OutlineViewAdorn" 
imageScaling="none" width="25" tag="1"/>
-                                        </segments>
-                                    </segmentedCell>
-                                    <connections>
-                                        <binding destination="90" 
name="selectedTag" keyPath="selection.leftSidePaneState" id="155"/>
-                                    </connections>
-                                </segmentedControl>
-                            </subviews>
-                            <constraints>
-                                <constraint firstAttribute="width" 
constant="71" id="tpD-8m-wjQ"/>
-                            </constraints>
-                        </customView>
+                        <segmentedControl hidden="YES" 
verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" 
id="93">
+                            <rect key="frame" x="8" y="6" width="59" 
height="24"/>
+                            <segmentedCell key="cell" borderStyle="border" 
alignment="left" style="texturedRounded" trackingMode="selectOne" id="106">
+                                <font key="font" metaFont="system"/>
+                                <segments>
+                                    <segment image="FindViewAdorn" 
imageScaling="none" width="25"/>
+                                    <segment image="GroupedFindViewAdorn" 
imageScaling="none" width="25" tag="1"/>
+                                </segments>
+                                <connections>
+                                    <binding destination="90" 
name="selectedTag" keyPath="selection.findPaneState" id="187"/>
+                                </connections>
+                            </segmentedCell>
+                            <connections>
+                                <binding destination="90" name="selectedTag" 
keyPath="selection.findPaneState" id="144"/>
+                            </connections>
+                        </segmentedControl>
+                        <segmentedControl verticalHuggingPriority="750" 
translatesAutoresizingMaskIntoConstraints="NO" id="140">
+                            <rect key="frame" x="8" y="6" width="59" 
height="24"/>
+                            <segmentedCell key="cell" borderStyle="border" 
alignment="left" style="texturedRounded" trackingMode="selectOne" id="141">
+                                <font key="font" metaFont="system"/>
+                                <segments>
+                                    <segment image="ThumbnailViewAdorn" 
imageScaling="none" width="25"/>
+                                    <segment image="OutlineViewAdorn" 
imageScaling="none" width="25" tag="1"/>
+                                </segments>
+                            </segmentedCell>
+                            <connections>
+                                <binding destination="90" name="selectedTag" 
keyPath="selection.leftSidePaneState" id="155"/>
+                            </connections>
+                        </segmentedControl>
                         <searchField verticalHuggingPriority="750" 
horizontalCompressionResistancePriority="250" textCompletion="NO" 
translatesAutoresizingMaskIntoConstraints="NO" id="138">
-                            <rect key="frame" x="72" y="7" width="120" 
height="22"/>
+                            <rect key="frame" x="73" y="7" width="119" 
height="22"/>
                             <constraints>
                                 <constraint firstAttribute="width" 
relation="greaterThanOrEqual" constant="20" id="EJG-YR-pIX"/>
                             </constraints>
@@ -68,12 +75,14 @@
                     </subviews>
                     <constraints>
                         <constraint firstItem="138" firstAttribute="centerY" 
secondItem="134" secondAttribute="centerY" id="6aJ-h2-CfD"/>
-                        <constraint firstItem="137" firstAttribute="top" 
secondItem="134" secondAttribute="top" id="8op-nU-FIN"/>
-                        <constraint firstItem="138" firstAttribute="leading" 
secondItem="137" secondAttribute="trailing" constant="1" id="9Ho-lo-erg"/>
                         <constraint firstAttribute="trailing" secondItem="138" 
secondAttribute="trailing" priority="251" constant="8" id="IkV-bB-83C"/>
-                        <constraint firstItem="137" firstAttribute="leading" 
secondItem="134" secondAttribute="leading" id="ZTC-qz-e8c"/>
-                        <constraint firstAttribute="bottom" secondItem="137" 
secondAttribute="bottom" id="ney-df-w0G"/>
+                        <constraint firstItem="140" firstAttribute="leading" 
secondItem="134" secondAttribute="leading" constant="10" id="UXL-kL-U6I"/>
+                        <constraint firstItem="138" firstAttribute="leading" 
secondItem="93" secondAttribute="trailing" constant="8" symbolic="YES" 
id="Vwf-8s-KXn"/>
+                        <constraint firstItem="138" firstAttribute="leading" 
secondItem="140" secondAttribute="trailing" constant="8" symbolic="YES" 
id="fm2-6f-79d"/>
+                        <constraint firstItem="140" firstAttribute="centerY" 
secondItem="134" secondAttribute="centerY" id="h7J-Na-3Nd"/>
+                        <constraint firstItem="93" firstAttribute="leading" 
secondItem="134" secondAttribute="leading" constant="10" id="iGp-4q-uif"/>
                         <constraint firstAttribute="height" constant="36" 
id="w8i-xX-Pnp"/>
+                        <constraint firstItem="93" firstAttribute="centerY" 
secondItem="134" secondAttribute="centerY" id="yZS-bf-pOA"/>
                     </constraints>
                 </customView>
                 <customView translatesAutoresizingMaskIntoConstraints="NO" 
id="133">
@@ -329,7 +338,7 @@
                                 <tableColumnResizingMask key="resizingMask" 
resizeWithTable="YES" userResizable="YES"/>
                                 <prototypeCellViews>
                                     <tableCellView 
translatesAutoresizingMaskIntoConstraints="NO" id="rTN-Wm-aea">
-                                        <rect key="frame" x="1" y="1" 
width="47" height="17"/>
+                                        <rect key="frame" x="11" y="1" 
width="47" height="17"/>
                                         <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <textField 
verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" 
fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5CV-AT-Wi3">
@@ -364,7 +373,7 @@
                                 <tableColumnResizingMask key="resizingMask" 
resizeWithTable="YES" userResizable="YES"/>
                                 <prototypeCellViews>
                                     <tableCellView 
translatesAutoresizingMaskIntoConstraints="NO" id="yHY-cQ-hrW">
-                                        <rect key="frame" x="51" y="1" 
width="116" height="17"/>
+                                        <rect key="frame" x="61" y="1" 
width="116" height="17"/>
                                         <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <textField 
verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" 
fixedFrame="YES" allowsExpansionToolTips="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="EK0-Iy-KhJ">
@@ -436,7 +445,7 @@
                                 <tableColumnResizingMask key="resizingMask" 
resizeWithTable="YES" userResizable="YES"/>
                                 <prototypeCellViews>
                                     <tableCellView 
translatesAutoresizingMaskIntoConstraints="NO" id="9a8-cx-9oD" 
customClass="SKControlTableCellView">
-                                        <rect key="frame" x="1" y="1" 
width="117" height="17"/>
+                                        <rect key="frame" x="11" y="1" 
width="117" height="17"/>
                                         <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <levelIndicator 
verticalHuggingPriority="750" fixedFrame="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="zvD-nR-1Ml" 
customClass="SKLevelIndicator">
@@ -469,7 +478,7 @@
                                 <tableColumnResizingMask key="resizingMask" 
resizeWithTable="YES" userResizable="YES"/>
                                 <prototypeCellViews>
                                     <tableCellView 
translatesAutoresizingMaskIntoConstraints="NO" id="hdZ-O4-HlW">
-                                        <rect key="frame" x="121" y="1" 
width="46" height="17"/>
+                                        <rect key="frame" x="131" y="1" 
width="46" height="17"/>
                                         <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <textField 
verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" 
fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6S7-C8-37w">
@@ -514,24 +523,6 @@
             </tableHeaderView>
             <point key="canvasLocation" x="267" y="154"/>
         </scrollView>
-        <segmentedControl verticalHuggingPriority="750" id="93">
-            <rect key="frame" x="0.0" y="0.0" width="57" height="25"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" 
flexibleMinY="YES"/>
-            <segmentedCell key="cell" borderStyle="border" alignment="left" 
style="texturedRounded" trackingMode="selectOne" id="106">
-                <font key="font" metaFont="system"/>
-                <segments>
-                    <segment image="FindViewAdorn" imageScaling="none" 
width="25"/>
-                    <segment image="GroupedFindViewAdorn" imageScaling="none" 
width="25" tag="1"/>
-                </segments>
-                <connections>
-                    <binding destination="90" name="selectedTag" 
keyPath="selection.findPaneState" id="187"/>
-                </connections>
-            </segmentedCell>
-            <connections>
-                <binding destination="90" name="selectedTag" 
keyPath="selection.findPaneState" id="144"/>
-            </connections>
-            <point key="canvasLocation" x="267" y="436"/>
-        </segmentedControl>
         <menu id="89"/>
         <menu id="198"/>
         <menu id="197"/>

Modified: trunk/RightSideView.xib
===================================================================
--- trunk/RightSideView.xib     2021-10-31 15:59:51 UTC (rev 12492)
+++ trunk/RightSideView.xib     2021-10-31 22:40:39 UTC (rev 12493)
@@ -42,7 +42,7 @@
                             </connections>
                         </segmentedControl>
                         <searchField verticalHuggingPriority="750" 
horizontalCompressionResistancePriority="250" textCompletion="NO" 
translatesAutoresizingMaskIntoConstraints="NO" id="22">
-                            <rect key="frame" x="74" y="7" width="118" 
height="22"/>
+                            <rect key="frame" x="73" y="7" width="119" 
height="22"/>
                             <constraints>
                                 <constraint firstAttribute="width" 
relation="greaterThanOrEqual" constant="20" id="m7g-Zf-h34"/>
                             </constraints>
@@ -56,10 +56,10 @@
                     <constraints>
                         <constraint firstAttribute="height" constant="36" 
id="7oM-Yp-cMo"/>
                         <constraint firstAttribute="trailing" secondItem="22" 
secondAttribute="trailing" priority="251" constant="8" id="G1M-Dp-Tzm"/>
-                        <constraint firstItem="22" firstAttribute="leading" 
secondItem="23" secondAttribute="trailing" constant="9" id="KYn-6w-OT6"/>
+                        <constraint firstItem="23" firstAttribute="centerY" 
secondItem="19" secondAttribute="centerY" id="JmX-pZ-kiW"/>
+                        <constraint firstItem="22" firstAttribute="leading" 
secondItem="23" secondAttribute="trailing" constant="8" symbolic="YES" 
id="KYn-6w-OT6"/>
                         <constraint firstItem="23" firstAttribute="leading" 
secondItem="19" secondAttribute="leading" constant="10" id="cTM-Ig-G77"/>
                         <constraint firstItem="22" firstAttribute="centerY" 
secondItem="19" secondAttribute="centerY" id="huz-5M-yGg"/>
-                        <constraint firstItem="23" firstAttribute="top" 
secondItem="19" secondAttribute="top" constant="7" id="rhm-gI-cdV"/>
                     </constraints>
                 </customView>
                 <customView translatesAutoresizingMaskIntoConstraints="NO" 
id="18">
@@ -113,7 +113,7 @@
                                 <tableColumnResizingMask key="resizingMask" 
resizeWithTable="YES" userResizable="YES"/>
                                 <prototypeCellViews>
                                     <tableCellView 
translatesAutoresizingMaskIntoConstraints="NO" id="ZGN-Pg-55C">
-                                        <rect key="frame" x="1" y="1" 
width="93" height="17"/>
+                                        <rect key="frame" x="11" y="1" 
width="93" height="17"/>
                                         <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <textField 
verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" 
fixedFrame="YES" preferredMaxLayoutWidth="122" 
translatesAutoresizingMaskIntoConstraints="NO" id="T6H-tX-biW">
@@ -135,7 +135,7 @@
                                         </connections>
                                     </tableCellView>
                                     <customView identifier="row" 
translatesAutoresizingMaskIntoConstraints="NO" id="84k-Om-OZ4" 
customClass="SKNoteTableRowView">
-                                        <rect key="frame" x="1" y="20" 
width="93" height="17"/>
+                                        <rect key="frame" x="11" y="20" 
width="93" height="17"/>
                                         <autoresizingMask 
key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                                     </customView>
                                 </prototypeCellViews>
@@ -148,7 +148,7 @@
                                 <imageCell key="dataCell" 
refusesFirstResponder="YES" alignment="left" animates="YES" id="38" 
customClass="SKAnnotationTypeImageCell"/>
                                 <prototypeCellViews>
                                     <tableCellView 
translatesAutoresizingMaskIntoConstraints="NO" id="dka-Zp-1o0">
-                                        <rect key="frame" x="97" y="1" 
width="21" height="17"/>
+                                        <rect key="frame" x="107" y="1" 
width="21" height="17"/>
                                         <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <imageView 
horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="Wy1-6F-s9I" 
customClass="SKAnnotationTypeImageView">
@@ -186,7 +186,7 @@
                                         <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <imageView 
horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="bUx-hD-kOV" 
customClass="SKColorView">
-                                                <rect key="frame" x="27" 
y="0.0" width="0.0" height="17"/>
+                                                <rect key="frame" x="29" 
y="0.0" width="0.0" height="17"/>
                                                 <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                 <imageCell key="cell" 
refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" 
id="zeE-gx-yVa" customClass="SKColorCell"/>
                                                 <connections>
@@ -212,7 +212,7 @@
                                 </textFieldCell>
                                 <prototypeCellViews>
                                     <tableCellView 
translatesAutoresizingMaskIntoConstraints="NO" id="rnK-rN-FoS">
-                                        <rect key="frame" x="121" y="1" 
width="46" height="17"/>
+                                        <rect key="frame" x="131" y="1" 
width="46" height="17"/>
                                         <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <textField 
verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" 
fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="iuK-OP-ap6">

Modified: trunk/SKSideViewController.m
===================================================================
--- trunk/SKSideViewController.m        2021-10-31 15:59:51 UTC (rev 12492)
+++ trunk/SKSideViewController.m        2021-10-31 22:40:39 UTC (rev 12493)
@@ -108,14 +108,14 @@
 
     [[SKImageToolTipWindow sharedToolTipWindow] orderOut:self];
     
-    if (changeButton)
-        [newButton setFrame:[oldButton frame]];
     [newView setFrame:[oldView frame]];
     
     if (animate == NO) {
         [contentView replaceSubview:oldView with:newView];
-        if (changeButton)
-            [[oldButton superview] replaceSubview:oldButton with:newButton];
+        if (changeButton) {
+            [newButton setHidden:NO];
+            [oldButton setHidden:YES];
+        }
         [[firstResponder window] makeFirstResponder:firstResponder];
         [[contentView window] recalculateKeyViewLoop];
         [[self topBar] reflectView:newView animate:NO];
@@ -146,8 +146,10 @@
                 [context setDuration:DURATION]; 
                 [[contentView animator] replaceSubview:oldView with:newView];
                 [[self topBar] reflectView:newView animate:YES];
-                if (changeButton)
-                    [[buttonView animator] replaceSubview:oldButton 
with:newButton];
+                if (changeButton) {
+                    [[newButton animator] setHidden:NO];
+                    [[oldButton animator] setHidden:YES];
+                }
             }
             completionHandler:^{
                 if (hasLayer == NO) {

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