Skip to content
This repository was archived by the owner on Jun 17, 2023. It is now read-only.

Commit e81c074

Browse files
author
Amir Khorsandi
committed
Adjust sizes
1 parent 99feb92 commit e81c074

File tree

4 files changed

+32
-26
lines changed

4 files changed

+32
-26
lines changed

Samples/AppKitGlue/MacApp.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class MacApp: NSObject, AppKitBridge {
2727
guard let window = NSApplication.shared.mainWindow else {
2828
return
2929
}
30-
window.minSize = NSSize(width: 1_024, height: 768)
30+
window.minSize = NSSize(width: 1_200, height: 768)
3131
window.setFrame(.init(origin: window.frame.origin, size: window.minSize), display: true, animate: true)
3232
}
3333

Samples/PagingLayoutSamples/Modules/LayoutDesigner/LayoutDesignerViewController.xib

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@
2525
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2626
<subviews>
2727
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nl2-ey-EcQ">
28-
<rect key="frame" x="0.0" y="0.0" width="494" height="758"/>
28+
<rect key="frame" x="0.0" y="0.0" width="500" height="758"/>
2929
<subviews>
3030
<stackView opaque="NO" contentMode="scaleToFill" spacing="15" translatesAutoresizingMaskIntoConstraints="NO" id="NyD-R7-l0J">
31-
<rect key="frame" x="22" y="71" width="450" height="80"/>
31+
<rect key="frame" x="22" y="71" width="456" height="80"/>
3232
<subviews>
3333
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3Yl-40-qB9">
34-
<rect key="frame" x="0.0" y="0.0" width="252" height="80"/>
34+
<rect key="frame" x="0.0" y="0.0" width="258" height="80"/>
3535
<subviews>
3636
<stackView opaque="NO" contentMode="scaleToFill" horizontalCompressionResistancePriority="1000" alignment="center" spacing="17" translatesAutoresizingMaskIntoConstraints="NO" id="9YI-ZD-clw">
37-
<rect key="frame" x="17" y="0.0" width="218" height="80"/>
37+
<rect key="frame" x="17" y="0.0" width="224" height="80"/>
3838
<subviews>
3939
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="stackWhite" translatesAutoresizingMaskIntoConstraints="NO" id="wYk-K0-f2r">
4040
<rect key="frame" x="0.0" y="18.5" width="50" height="43"/>
@@ -44,7 +44,7 @@
4444
</constraints>
4545
</imageView>
4646
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" translatesAutoresizingMaskIntoConstraints="NO" id="raf-Ms-swa">
47-
<rect key="frame" x="67" y="17.5" width="151" height="45.5"/>
47+
<rect key="frame" x="67" y="17.5" width="157" height="45.5"/>
4848
<subviews>
4949
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Stack" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tt7-R3-8jZ">
5050
<rect key="frame" x="0.0" y="0.0" width="60" height="27.5"/>
@@ -63,7 +63,7 @@
6363
</subviews>
6464
</stackView>
6565
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="aI8-Zv-3Ty">
66-
<rect key="frame" x="0.0" y="0.0" width="252" height="80"/>
66+
<rect key="frame" x="0.0" y="0.0" width="258" height="80"/>
6767
<connections>
6868
<action selector="layoutCategoryButtonTouchedWithButton:" destination="-1" eventType="touchUpInside" id="chq-kT-MJR"/>
6969
</connections>
@@ -94,7 +94,7 @@
9494
</userDefinedRuntimeAttributes>
9595
</view>
9696
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2wv-bO-feC">
97-
<rect key="frame" x="267" y="0.0" width="84" height="80"/>
97+
<rect key="frame" x="273" y="0.0" width="84" height="80"/>
9898
<subviews>
9999
<stackView opaque="NO" contentMode="scaleToFill" horizontalCompressionResistancePriority="1000" alignment="center" spacing="17" translatesAutoresizingMaskIntoConstraints="NO" id="udp-04-WFA">
100100
<rect key="frame" x="17" y="0.0" width="50" height="80"/>
@@ -157,7 +157,7 @@
157157
</userDefinedRuntimeAttributes>
158158
</view>
159159
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="E4u-ez-gsh">
160-
<rect key="frame" x="366" y="0.0" width="84" height="80"/>
160+
<rect key="frame" x="372" y="0.0" width="84" height="80"/>
161161
<subviews>
162162
<stackView opaque="NO" contentMode="scaleToFill" horizontalCompressionResistancePriority="1000" alignment="center" spacing="17" translatesAutoresizingMaskIntoConstraints="NO" id="eiX-qz-laD">
163163
<rect key="frame" x="17" y="0.0" width="50" height="80"/>
@@ -222,7 +222,7 @@
222222
</subviews>
223223
</stackView>
224224
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="dmm-bK-wwh" customClass="LayoutDesignerOptionsTableView" customModule="Paging_Layout" customModuleProvider="target">
225-
<rect key="frame" x="0.0" y="188" width="494" height="570"/>
225+
<rect key="frame" x="0.0" y="188" width="500" height="570"/>
226226
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
227227
</tableView>
228228
</subviews>
@@ -237,13 +237,19 @@
237237
<constraint firstAttribute="width" relation="lessThanOrEqual" constant="500" id="qxy-3u-1M3"/>
238238
</constraints>
239239
</view>
240-
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="h51-4z-wO0" userLabel="previewContainerView">
241-
<rect key="frame" x="494" y="0.0" width="469.5" height="758"/>
242-
<color key="backgroundColor" red="0.1201978996" green="0.27515318989999998" blue="0.87504833940000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
243-
</view>
244240
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CdL-lt-E7G" userLabel="codeContainerView">
245-
<rect key="frame" x="963.5" y="0.0" width="513.5" height="758"/>
241+
<rect key="frame" x="913.5" y="0.0" width="563.5" height="758"/>
246242
<color key="backgroundColor" red="0.16078431372549018" green="0.16470588235294117" blue="0.18823529411764706" alpha="1" colorSpace="calibratedRGB"/>
243+
<constraints>
244+
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="500" id="A6T-bX-xuz"/>
245+
</constraints>
246+
</view>
247+
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="h51-4z-wO0" userLabel="previewContainerView">
248+
<rect key="frame" x="500" y="0.0" width="413.5" height="758"/>
249+
<color key="backgroundColor" red="0.1201978996" green="0.27515318989999998" blue="0.87504833940000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
250+
<constraints>
251+
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="385" id="IlK-dv-JHb"/>
252+
</constraints>
247253
</view>
248254
</subviews>
249255
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
@@ -255,7 +261,7 @@
255261
<constraint firstItem="CdL-lt-E7G" firstAttribute="leading" secondItem="h51-4z-wO0" secondAttribute="trailing" id="O26-1l-XKk"/>
256262
<constraint firstItem="nl2-ey-EcQ" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="Okj-dI-m1h"/>
257263
<constraint firstItem="NyD-R7-l0J" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" constant="27" id="SMn-96-rTn"/>
258-
<constraint firstItem="h51-4z-wO0" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" multiplier="0.317726" priority="756" id="Wv5-Oz-BQF"/>
264+
<constraint firstItem="h51-4z-wO0" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" multiplier="0.28" id="Wyn-9M-3Y3"/>
259265
<constraint firstAttribute="bottom" secondItem="nl2-ey-EcQ" secondAttribute="bottom" id="XQa-RB-BZh"/>
260266
<constraint firstItem="CdL-lt-E7G" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="e7R-N5-XO8"/>
261267
<constraint firstItem="h51-4z-wO0" firstAttribute="leading" secondItem="nl2-ey-EcQ" secondAttribute="trailing" id="iID-XG-rZH"/>

Samples/PagingLayoutSamples/Modules/LayoutDesigner/OptionsCodeGenerator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ private extension SnapshotTransformViewOptions.PiecesValue {
127127
case let .columnBasedCustom(values):
128128
return ".columnBasedCustom(\(values.map { formatValue($0) }.joined(separator: ", ")))"
129129
case let .aggregated(piecesValue, _):
130-
// Custom detection for functions, find a better way to detect it
131-
//.aggregated([.rowBasedMirror(CGPoint(x: 1
130+
// Custom detection for the functions, I don't think there is a better way for that
131+
// This works only on the current options
132132
var function = "+"
133133
if case .rowBasedMirror(let value, _) = piecesValue.first,
134134
let point = value as? CGPoint,

Samples/PagingLayoutSamples/Modules/Shapes/ShapeLayout+ScaleOptions.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ extension ShapeLayout {
6060
minTranslationRatio: CGPoint(x: -1, y: 0),
6161
maxTranslationRatio: CGPoint(x: 1, y: 1),
6262
rotation3d: ScaleTransformViewOptions.Rotation3dOptions(angle: .pi / 15, minAngle: -.pi / 3, maxAngle: .pi / 3, x: 0, y: 0, z: 1, m34: -0.004),
63-
translation3d: .init(translateRatios: (200, 375 * 0.1, 0),
64-
minTranslates: (-1_000, -375, -100),
65-
maxTranslates: (1_000, 375, -100))
63+
translation3d: .init(translateRatios: (230, 395 * 0.1, 0),
64+
minTranslates: (-1_000, -395, -100),
65+
maxTranslates: (1_000, 395, -100))
6666
)
6767
case .scaleCylinder:
6868
return ScaleTransformViewOptions(
@@ -74,7 +74,7 @@ extension ShapeLayout {
7474
maxTranslationRatio: .zero,
7575
shadowEnabled: false,
7676
rotation3d: .init(angle: .pi / 4, minAngle: -.pi, maxAngle: .pi, x: 0, y: 1, z: 0, m34: -0.000_4 - 0.8 * 0.000_2 ),
77-
translation3d: .init(translateRatios: (0, 0, 0), minTranslates: (0, 0, 340), maxTranslates: (0, 0, 340))
77+
translation3d: .init(translateRatios: (0, 0, 0), minTranslates: (0, 0, 380), maxTranslates: (0, 0, 380))
7878
)
7979
case .scaleInvertedCylinder:
8080
return ScaleTransformViewOptions(
@@ -86,9 +86,9 @@ extension ShapeLayout {
8686
maxTranslationRatio: .zero,
8787
shadowEnabled: false,
8888
rotation3d: .init(angle: .pi / 3, minAngle: -.pi, maxAngle: .pi, x: 0, y: -1, z: 0, m34: -0.002),
89-
translation3d: .init(translateRatios: (0, 0, 0),
90-
minTranslates: (0, 0, 240),
91-
maxTranslates: (0, 0, -240))
89+
translation3d: .init(translateRatios: (30, 0, 0),
90+
minTranslates: (-15, 0, 240),
91+
maxTranslates: (15, 0, -240))
9292
)
9393
case .scaleCoverFlow:
9494
return ScaleTransformViewOptions(
@@ -100,7 +100,7 @@ extension ShapeLayout {
100100
maxTranslationRatio: .zero,
101101
shadowEnabled: true,
102102
rotation3d: .init(angle: .pi / 1.65, minAngle: -.pi / 3, maxAngle: .pi / 3, x: 0, y: -1, z: 0, m34: -0.000_5),
103-
translation3d: .init(translateRatios: (30, 0, -375 * 0.42), minTranslates: (-30, 0, -1_000), maxTranslates: (30, 0, 0))
103+
translation3d: .init(translateRatios: (30, 0, -445 * 0.42), minTranslates: (-30, 0, -1_000), maxTranslates: (30, 0, 0))
104104
)
105105
default:
106106
return nil

0 commit comments

Comments
 (0)