Revision: 12503 http://sourceforge.net/p/skim-app/code/12503 Author: hofman Date: 2021-11-02 09:40:59 +0000 (Tue, 02 Nov 2021) Log Message: ----------- Replace main window tables using auto layout
Modified Paths: -------------- trunk/LeftSideView.xib trunk/RightSideView.xib trunk/SKSideViewController.m Modified: trunk/LeftSideView.xib =================================================================== --- trunk/LeftSideView.xib 2021-11-01 16:00:15 UTC (rev 12502) +++ trunk/LeftSideView.xib 2021-11-02 09:40:59 UTC (rev 12503) @@ -106,9 +106,8 @@ </constraints> <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" id="98"> + <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"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" drawsBackground="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Mfb-HY-gcR"> <rect key="frame" x="1" y="1" width="198" height="397"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> @@ -223,12 +222,11 @@ </scroller> <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" id="116"> + <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"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" drawsBackground="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Hnd-hK-VAX"> <rect key="frame" x="1" y="1" width="198" height="398"/> - <autoresizingMask key="autoresizingMask"/> + <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"/> @@ -250,7 +248,7 @@ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <prototypeCellViews> <tableCellView translatesAutoresizingMaskIntoConstraints="NO" id="E5O-BA-vGf"> - <rect key="frame" x="0.0" y="0.0" width="132" height="20"/> + <rect key="frame" x="11" y="0.0" width="132" height="20"/> <subviews> <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9Hp-6e-4aM"> <rect key="frame" x="0.0" y="2" width="132" height="16"/> @@ -292,7 +290,7 @@ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <prototypeCellViews> <tableCellView translatesAutoresizingMaskIntoConstraints="NO" id="kqC-1o-aAK"> - <rect key="frame" x="0.0" y="0.0" width="40" height="20"/> + <rect key="frame" x="146" y="0.0" width="40" height="20"/> <subviews> <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="Rac-nE-BbY"> <rect key="frame" x="0.0" y="2" width="40" height="16"/> @@ -332,9 +330,8 @@ </scroller> <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" id="107"> + <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"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" translatesAutoresizingMaskIntoConstraints="NO" id="VaG-cU-bQa"> <rect key="frame" x="1" y="1" width="198" height="401"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> @@ -362,7 +359,7 @@ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <prototypeCellViews> <tableCellView translatesAutoresizingMaskIntoConstraints="NO" id="rTN-Wm-aea"> - <rect key="frame" x="0.0" y="0.0" width="47" height="17"/> + <rect key="frame" x="11" y="1" width="47" height="17"/> <subviews> <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="5CV-AT-Wi3"> <rect key="frame" x="0.0" y="1" width="47" height="16"/> @@ -400,7 +397,7 @@ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <prototypeCellViews> <tableCellView translatesAutoresizingMaskIntoConstraints="NO" id="yHY-cQ-hrW"> - <rect key="frame" x="0.0" y="0.0" width="116" height="17"/> + <rect key="frame" x="61" y="1" width="116" height="17"/> <subviews> <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="EK0-Iy-KhJ"> <rect key="frame" x="0.0" y="1" width="116" height="16"/> @@ -448,12 +445,11 @@ </tableHeaderView> <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" id="124"> + <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"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" translatesAutoresizingMaskIntoConstraints="NO" id="CUc-Bz-YWJ"> <rect key="frame" x="1" y="1" width="198" height="401"/> - <autoresizingMask key="autoresizingMask"/> + <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"/> @@ -475,7 +471,7 @@ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <prototypeCellViews> <tableCellView translatesAutoresizingMaskIntoConstraints="NO" id="9a8-cx-9oD" customClass="SKControlTableCellView"> - <rect key="frame" x="0.0" y="0.0" width="117" height="18"/> + <rect key="frame" x="11" y="1" width="117" height="18"/> <subviews> <levelIndicator horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="zvD-nR-1Ml" customClass="SKLevelIndicator"> <rect key="frame" x="0.0" y="0.0" width="117" height="18"/> @@ -512,7 +508,7 @@ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <prototypeCellViews> <tableCellView translatesAutoresizingMaskIntoConstraints="NO" id="hdZ-O4-HlW"> - <rect key="frame" x="0.0" y="0.0" width="46" height="17"/> + <rect key="frame" x="131" y="1" width="46" height="17"/> <subviews> <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="6S7-C8-37w"> <rect key="frame" x="0.0" y="1" width="46" height="16"/> Modified: trunk/RightSideView.xib =================================================================== --- trunk/RightSideView.xib 2021-11-01 16:00:15 UTC (rev 12502) +++ trunk/RightSideView.xib 2021-11-02 09:40:59 UTC (rev 12503) @@ -83,9 +83,8 @@ </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" id="27" customClass="SKScrollView"> + <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"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" translatesAutoresizingMaskIntoConstraints="NO" id="3pL-FC-sTQ"> <rect key="frame" x="1" y="1" width="198" height="401"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> @@ -113,7 +112,7 @@ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <prototypeCellViews> <tableCellView translatesAutoresizingMaskIntoConstraints="NO" id="ZGN-Pg-55C"> - <rect key="frame" x="0.0" y="0.0" width="93" height="15"/> + <rect key="frame" x="11" y="1" width="93" height="15"/> <subviews> <textField horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="250" preferredMaxLayoutWidth="122" translatesAutoresizingMaskIntoConstraints="NO" id="T6H-tX-biW"> <rect key="frame" x="0.0" y="0.0" width="93" height="15"/> @@ -152,7 +151,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="0.0" y="0.0" width="21" height="17"/> + <rect key="frame" x="107" y="1" width="21" height="17"/> <subviews> <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="Wy1-6F-s9I" customClass="SKAnnotationTypeImageView"> <rect key="frame" x="0.0" y="0.0" width="21" height="17"/> @@ -190,7 +189,7 @@ </customCell> <prototypeCellViews> <tableCellView translatesAutoresizingMaskIntoConstraints="NO" id="qmc-ew-Bi0"> - <rect key="frame" x="0.0" y="0.0" width="0.0" height="17"/> + <rect key="frame" x="1" y="1" width="0.0" height="17"/> <subviews> <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="bUx-hD-kOV" customClass="SKColorView"> <rect key="frame" x="0.0" y="0.0" width="0.0" height="17"/> @@ -224,7 +223,7 @@ </textFieldCell> <prototypeCellViews> <tableCellView translatesAutoresizingMaskIntoConstraints="NO" id="rnK-rN-FoS"> - <rect key="frame" x="0.0" y="0.0" width="46" height="17"/> + <rect key="frame" x="131" y="1" width="46" height="17"/> <subviews> <textField horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="iuK-OP-ap6"> <rect key="frame" x="0.0" y="1" width="46" height="15"/> @@ -262,7 +261,7 @@ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <prototypeCellViews> <tableCellView translatesAutoresizingMaskIntoConstraints="NO" id="I4N-kX-XRY"> - <rect key="frame" x="0.0" y="0.0" width="0.0" height="17"/> + <rect key="frame" x="1" y="1" width="0.0" height="17"/> <subviews> <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="C5T-Ik-oBo"> <rect key="frame" x="0.0" y="1" width="4" height="15"/> @@ -301,7 +300,7 @@ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <prototypeCellViews> <tableCellView translatesAutoresizingMaskIntoConstraints="NO" id="pRJ-Qg-L6f"> - <rect key="frame" x="0.0" y="0.0" width="0.0" height="17"/> + <rect key="frame" x="1" y="1" width="0.0" height="17"/> <subviews> <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="dIJ-ix-es0"> <rect key="frame" x="0.0" y="1" width="4" height="16"/> @@ -348,9 +347,8 @@ </tableHeaderView> <point key="canvasLocation" x="139" y="154"/> </scrollView> - <scrollView focusRingType="none" autohidesScrollers="YES" horizontalLineScroll="34" horizontalPageScroll="10" verticalLineScroll="34" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="10"> + <scrollView focusRingType="none" autohidesScrollers="YES" horizontalLineScroll="34" horizontalPageScroll="10" verticalLineScroll="34" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="10"> <rect key="frame" x="0.0" y="0.0" width="200" height="400"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" drawsBackground="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GlW-dx-lwj"> <rect key="frame" x="1" y="1" width="198" height="398"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> Modified: trunk/SKSideViewController.m =================================================================== --- trunk/SKSideViewController.m 2021-11-01 16:00:15 UTC (rev 12502) +++ trunk/SKSideViewController.m 2021-11-02 09:40:59 UTC (rev 12503) @@ -109,9 +109,15 @@ [[SKImageToolTipWindow sharedToolTipWindow] orderOut:self]; [newView setFrame:[oldView frame]]; + NSArray *constraints = [NSArray arrayWithObjects: + [NSLayoutConstraint constraintWithItem:newView attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:contentView attribute:NSLayoutAttributeLeading multiplier:1.0 constant:-1.0], + [NSLayoutConstraint constraintWithItem:contentView attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:newView attribute:NSLayoutAttributeTrailing multiplier:1.0 constant:-1.0], + [NSLayoutConstraint constraintWithItem:newView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:-1.0], + [NSLayoutConstraint constraintWithItem:contentView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:newView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-1.0], nil]; if (animate == NO) { [contentView replaceSubview:oldView with:newView]; + [NSLayoutConstraint activateConstraints:constraints]; if (changeButton) { [newButton setHidden:NO]; [oldButton setHidden:YES]; @@ -145,6 +151,7 @@ [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){ [context setDuration:DURATION]; [[contentView animator] replaceSubview:oldView with:newView]; + [NSLayoutConstraint activateConstraints:constraints]; [[self topBar] reflectView:newView animate:YES]; if (changeButton) { [[newButton animator] setHidden: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