Revision: 12194
          http://sourceforge.net/p/skim-app/code/12194
Author:   hofman
Date:     2021-03-10 16:31:21 +0000 (Wed, 10 Mar 2021)
Log Message:
-----------
Don't set minSize and maxSize of toolbar items, add constraints for textfield 
and NSView toolbar items

Modified Paths:
--------------
    trunk/MainToolbar.xib
    trunk/SKMainToolbarController.m
    trunk/SKToolbarItem.m

Modified: trunk/MainToolbar.xib
===================================================================
--- trunk/MainToolbar.xib       2021-03-10 15:34:25 UTC (rev 12193)
+++ trunk/MainToolbar.xib       2021-03-10 16:31:21 UTC (rev 12194)
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="16097.3" targetRuntime="MacOSX.Cocoa" 
propertyAccessControl="none" useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" 
useAutolayout="YES">
     <dependencies>
         <deployment identifier="macosx"/>
         <development version="8000" identifier="xcode"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="16097.3"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="17701"/>
         <capability name="documents saved in the Xcode 8 format" 
minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -539,9 +539,12 @@
                         <action selector="selectColor:" target="-2" id="183"/>
                     </connections>
                 </customView>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="36">
+                <textField verticalHuggingPriority="750" 
translatesAutoresizingMaskIntoConstraints="NO" id="36">
                     <rect key="frame" x="143" y="274" width="50" height="22"/>
-                    <autoresizingMask key="autoresizingMask"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="50" 
id="4RV-ZC-n5Z"/>
+                        <constraint firstAttribute="height" constant="22" 
id="B9Y-xa-8Te"/>
+                    </constraints>
                     <textFieldCell key="cell" scrollable="YES" 
lineBreakMode="clipping" selectable="YES" editable="YES" 
sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" 
drawsBackground="YES" id="43">
                         <numberFormatter key="formatter" 
formatterBehavior="default10_4" numberStyle="percent" 
usesGroupingSeparator="NO" lenient="YES" formatWidth="-1" 
minimumIntegerDigits="1" maximumIntegerDigits="2000000000" decimalSeparator="." 
groupingSeparator="," id="44">
                             <integer key="multiplier" value="100"/>
@@ -573,9 +576,12 @@
                         <action selector="changeToolMode:" target="-2" 
id="181"/>
                     </connections>
                 </segmentedControl>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="38">
-                    <rect key="frame" x="85" y="274" width="50" height="22"/>
-                    <autoresizingMask key="autoresizingMask"/>
+                <textField verticalHuggingPriority="750" 
translatesAutoresizingMaskIntoConstraints="NO" id="38">
+                    <rect key="frame" x="85" y="275" width="50" height="21"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="21" 
id="J3a-rg-VT9"/>
+                        <constraint firstAttribute="width" constant="50" 
id="dgE-6k-Kfl"/>
+                    </constraints>
                     <textFieldCell key="cell" scrollable="YES" 
lineBreakMode="clipping" selectable="YES" editable="YES" 
sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="center" 
drawsBackground="YES" id="41">
                         <font key="font" metaFont="system"/>
                         <color key="textColor" name="controlTextColor" 
catalog="System" colorSpace="catalog"/>
@@ -599,13 +605,11 @@
                         <action selector="goBackOrForward:" target="-2" 
id="162"/>
                     </connections>
                 </segmentedControl>
-                <customView fixedFrame="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="eAi-bX-BYI">
+                <customView translatesAutoresizingMaskIntoConstraints="NO" 
id="eAi-bX-BYI">
                     <rect key="frame" x="146" y="16" width="88" height="26"/>
-                    <autoresizingMask key="autoresizingMask"/>
                     <subviews>
-                        <textField verticalHuggingPriority="750" 
preferredMaxLayoutWidth="36" id="jHc-Bm-dWJ">
-                            <rect key="frame" x="37" y="0.0" width="30" 
height="25"/>
-                            <autoresizingMask key="autoresizingMask" 
flexibleMinX="YES" flexibleMaxY="YES"/>
+                        <textField verticalHuggingPriority="750" 
preferredMaxLayoutWidth="36" translatesAutoresizingMaskIntoConstraints="NO" 
id="jHc-Bm-dWJ">
+                            <rect key="frame" x="37" y="2" width="30" 
height="21"/>
                             <textFieldCell key="cell" scrollable="YES" 
lineBreakMode="clipping" selectable="YES" editable="YES" 
sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="center" 
drawsBackground="YES" id="9cD-jS-bcm">
                                 <numberFormatter key="formatter" 
formatterBehavior="default10_4" numberStyle="decimal" formatWidth="-1" 
minimumIntegerDigits="1" maximumIntegerDigits="2000000000" 
maximumFractionDigits="3" id="cUi-co-kf3">
                                     <real key="minimum" value="1"/>
@@ -618,17 +622,15 @@
                                 <binding destination="190" name="value" 
keyPath="selection.pdfView.pacerSpeed" id="Qeo-Kl-wAp"/>
                             </connections>
                         </textField>
-                        <stepper horizontalHuggingPriority="750" 
verticalHuggingPriority="750" id="jYx-ER-Exi">
-                            <rect key="frame" x="67" y="-3" width="21" 
height="31"/>
-                            <autoresizingMask key="autoresizingMask" 
flexibleMinX="YES" flexibleMaxY="YES"/>
+                        <stepper horizontalHuggingPriority="750" 
verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" 
id="jYx-ER-Exi">
+                            <rect key="frame" x="69" y="-2" width="19" 
height="28"/>
                             <stepperCell key="cell" continuous="YES" 
alignment="left" minValue="1" maxValue="100" doubleValue="1" id="mIF-lD-uRK"/>
                             <connections>
                                 <binding destination="190" name="value" 
keyPath="selection.pdfView.pacerSpeed" id="G0d-wg-67j"/>
                             </connections>
                         </stepper>
-                        <segmentedControl verticalHuggingPriority="750" 
id="Veq-Br-EFG">
-                            <rect key="frame" x="0.0" y="0.0" width="29" 
height="25"/>
-                            <autoresizingMask key="autoresizingMask" 
flexibleMaxX="YES" flexibleMaxY="YES"/>
+                        <segmentedControl verticalHuggingPriority="750" 
translatesAutoresizingMaskIntoConstraints="NO" id="Veq-Br-EFG">
+                            <rect key="frame" x="0.0" y="0.0" width="33" 
height="23"/>
                             <segmentedCell key="cell" borderStyle="border" 
alignment="left" segmentDistribution="fill" style="texturedSquare" 
trackingMode="momentary" id="BxE-Xo-uNS">
                                 <font key="font" metaFont="system"/>
                                 <segments>
@@ -640,6 +642,17 @@
                             </connections>
                         </segmentedControl>
                     </subviews>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="88" 
id="0ln-f5-t3T"/>
+                        <constraint firstAttribute="height" constant="26" 
id="22D-Qf-9J0"/>
+                        <constraint firstAttribute="bottom" 
secondItem="Veq-Br-EFG" secondAttribute="bottom" constant="2" id="Aba-cd-Bpz"/>
+                        <constraint firstAttribute="trailing" 
secondItem="jYx-ER-Exi" secondAttribute="trailing" constant="3" 
id="IXI-A4-r33"/>
+                        <constraint firstItem="jHc-Bm-dWJ" 
firstAttribute="centerY" secondItem="Veq-Br-EFG" secondAttribute="centerY" 
id="KLi-r5-tDF"/>
+                        <constraint firstItem="Veq-Br-EFG" 
firstAttribute="leading" secondItem="eAi-bX-BYI" secondAttribute="leading" 
constant="1" id="YhV-sE-h07"/>
+                        <constraint firstItem="jHc-Bm-dWJ" 
firstAttribute="leading" secondItem="Veq-Br-EFG" secondAttribute="trailing" 
constant="5" id="tHn-hi-b0S"/>
+                        <constraint firstItem="Veq-Br-EFG" 
firstAttribute="centerY" secondItem="jYx-ER-Exi" secondAttribute="centerY" 
id="u5Z-na-kEg"/>
+                        <constraint firstItem="jYx-ER-Exi" 
firstAttribute="leading" secondItem="jHc-Bm-dWJ" secondAttribute="trailing" 
constant="5" id="yek-mo-9UQ"/>
+                    </constraints>
                 </customView>
                 <segmentedControl verticalHuggingPriority="750" 
fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="M3M-Fg-kEy">
                     <rect key="frame" x="170.5" y="47" width="33" height="23"/>
@@ -679,6 +692,14 @@
                     </connections>
                 </segmentedControl>
             </subviews>
+            <constraints>
+                <constraint firstItem="eAi-bX-BYI" firstAttribute="leading" 
secondItem="2" secondAttribute="leading" constant="146" id="40V-ef-ZtH"/>
+                <constraint firstItem="36" firstAttribute="top" secondItem="2" 
secondAttribute="top" constant="48" id="Guj-rP-x0o"/>
+                <constraint firstAttribute="bottom" secondItem="eAi-bX-BYI" 
secondAttribute="bottom" constant="16" id="JrC-Bv-iYG"/>
+                <constraint firstItem="38" firstAttribute="top" secondItem="2" 
secondAttribute="top" constant="48" id="LAg-OM-MeI"/>
+                <constraint firstItem="36" firstAttribute="leading" 
secondItem="2" secondAttribute="leading" constant="143" id="hKt-B2-zuA"/>
+                <constraint firstItem="38" firstAttribute="leading" 
secondItem="2" secondAttribute="leading" constant="85" id="jzZ-3O-KI1"/>
+            </constraints>
             <point key="canvasLocation" x="156.5" y="154"/>
         </customView>
         <objectController id="190" userLabel="Owner Controller">

Modified: trunk/SKMainToolbarController.m
===================================================================
--- trunk/SKMainToolbarController.m     2021-03-10 15:34:25 UTC (rev 12193)
+++ trunk/SKMainToolbarController.m     2021-03-10 16:31:21 UTC (rev 12194)
@@ -706,7 +706,8 @@
             [colorSwatch sizeToFit];
             [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(handleColorSwatchColorsChangedNotification:)
                                                          
name:SKColorSwatchColorsChangedNotification object:colorSwatch];
-            [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(handleColorSwatchFrameChangedNotification:)
+            if (!RUNNING_AFTER(10_15))
+                [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(handleColorSwatchFrameChangedNotification:)
                                                          
name:NSViewFrameDidChangeNotification object:colorSwatch];
 
             menuItem = [NSMenuItem 
menuItemWithSubmenuAndTitle:NSLocalizedString(@"Favorite Colors", @"Toolbar 
item label")];

Modified: trunk/SKToolbarItem.m
===================================================================
--- trunk/SKToolbarItem.m       2021-03-10 15:34:25 UTC (rev 12193)
+++ trunk/SKToolbarItem.m       2021-03-10 16:31:21 UTC (rev 12194)
@@ -59,8 +59,6 @@
         [(NSSegmentedControl *)view sizeToFit];
     }
     [self setView:view];
-    [self setMinSize:[view bounds].size];
-    [self setMaxSize:[view bounds].size];
 }
 
 - (void)setImageNamed:(NSString *)name {

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



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to