Skip to content

Commit a2892e3

Browse files
author
Sven
committed
feat: 重新布局 token 设置。
1 parent d5659e6 commit a2892e3

File tree

6 files changed

+106
-69
lines changed

6 files changed

+106
-69
lines changed

SwiftJSONModeler For Xcode.xcodeproj/project.pbxproj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,15 @@
177177
path = View;
178178
sourceTree = "<group>";
179179
};
180+
C9E393EB24EF68E900D80B28 /* Controller */ = {
181+
isa = PBXGroup;
182+
children = (
183+
C961C1DD23D82A8D008D0DE6 /* ConfigViewController.swift */,
184+
C9E393E924EE47D300D80B28 /* TokenViewController.swift */,
185+
);
186+
path = Controller;
187+
sourceTree = "<group>";
188+
};
180189
C9ED9CB923D7F9B3004567A1 = {
181190
isa = PBXGroup;
182191
children = (
@@ -201,6 +210,7 @@
201210
C9ED9CC423D7F9B3004567A1 /* SwiftJSONModeler For Xcode */ = {
202211
isa = PBXGroup;
203212
children = (
213+
C9E393EB24EF68E900D80B28 /* Controller */,
204214
C9E393E224EE245D00D80B28 /* View */,
205215
C92A971B24E514D700C87CCD /* Constants */,
206216
C94AFC02241F4E6D00389AF3 /* YApi */,
@@ -210,11 +220,9 @@
210220
C9ED9CCD23D7F9B4004567A1 /* Main.storyboard */,
211221
C9ED9CD023D7F9B4004567A1 /* Info.plist */,
212222
C9ED9CD123D7F9B4004567A1 /* SwiftJSONModeler For Xcode.entitlements */,
213-
C961C1DD23D82A8D008D0DE6 /* ConfigViewController.swift */,
214223
C9DE045E242C8535008A0070 /* Config.swift */,
215224
C9CB247F241F559C00F4D5CE /* ErrorCenter.swift */,
216225
C935B49B24EA24BE00E48231 /* JSONHelper.swift */,
217-
C9E393E924EE47D300D80B28 /* TokenViewController.swift */,
218226
);
219227
path = "SwiftJSONModeler For Xcode";
220228
sourceTree = "<group>";

SwiftJSONModeler For Xcode.xcodeproj/xcuserdata/yibin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
filePath = "SwiftJSONModeler For Xcode/TokenViewController.swift"
6363
startingColumnNumber = "9223372036854775807"
6464
endingColumnNumber = "9223372036854775807"
65-
startingLineNumber = "81"
66-
endingLineNumber = "81"
65+
startingLineNumber = "83"
66+
endingLineNumber = "83"
6767
landmarkName = "updateTokenView()"
6868
landmarkType = "7">
6969
</BreakpointContent>
@@ -78,8 +78,8 @@
7878
filePath = "SwiftJSONModeler For Xcode/TokenViewController.swift"
7979
startingColumnNumber = "9223372036854775807"
8080
endingColumnNumber = "9223372036854775807"
81-
startingLineNumber = "89"
82-
endingLineNumber = "89"
81+
startingLineNumber = "91"
82+
endingLineNumber = "91"
8383
landmarkName = "updateDataSource()"
8484
landmarkType = "7">
8585
</BreakpointContent>
@@ -94,8 +94,8 @@
9494
filePath = "SwiftJSONModeler For Xcode/TokenViewController.swift"
9595
startingColumnNumber = "9223372036854775807"
9696
endingColumnNumber = "9223372036854775807"
97-
startingLineNumber = "92"
98-
endingLineNumber = "92"
97+
startingLineNumber = "94"
98+
endingLineNumber = "94"
9999
landmarkName = "updateDataSource()"
100100
landmarkType = "7">
101101
</BreakpointContent>
@@ -126,8 +126,8 @@
126126
filePath = "SwiftJSONModeler For Xcode/TokenViewController.swift"
127127
startingColumnNumber = "9223372036854775807"
128128
endingColumnNumber = "9223372036854775807"
129-
startingLineNumber = "70"
130-
endingLineNumber = "70"
129+
startingLineNumber = "72"
130+
endingLineNumber = "72"
131131
landmarkName = "updateTokenView()"
132132
landmarkType = "7">
133133
</BreakpointContent>
@@ -142,8 +142,8 @@
142142
filePath = "SwiftJSONModeler For Xcode/TokenViewController.swift"
143143
startingColumnNumber = "9223372036854775807"
144144
endingColumnNumber = "9223372036854775807"
145-
startingLineNumber = "68"
146-
endingLineNumber = "68"
145+
startingLineNumber = "70"
146+
endingLineNumber = "70"
147147
landmarkName = "updateTokenView()"
148148
landmarkType = "7">
149149
</BreakpointContent>

SwiftJSONModeler For Xcode/Base.lproj/Main.storyboard

Lines changed: 62 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@
774774
<constraint firstAttribute="width" constant="80" id="cy3-XY-hR7"/>
775775
</constraints>
776776
<textFieldCell key="cell" lineBreakMode="clipping" title="前缀:" id="n9e-oo-TZ5">
777-
<font key="font" metaFont="label" size="16"/>
777+
<font key="font" metaFont="system" size="16"/>
778778
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
779779
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
780780
</textFieldCell>
@@ -796,7 +796,7 @@
796796
<constraint firstAttribute="width" constant="80" id="dew-vC-605"/>
797797
</constraints>
798798
<textFieldCell key="cell" lineBreakMode="clipping" title="后缀:" id="pft-UG-a8v">
799-
<font key="font" metaFont="label" size="16"/>
799+
<font key="font" metaFont="system" size="16"/>
800800
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
801801
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
802802
</textFieldCell>
@@ -892,7 +892,7 @@
892892
<constraint firstAttribute="width" constant="80" id="r76-oI-ssb"/>
893893
</constraints>
894894
<textFieldCell key="cell" lineBreakMode="clipping" title="其他设置" id="PMg-9i-jHB">
895-
<font key="font" metaFont="label" size="16"/>
895+
<font key="font" metaFont="system" size="16"/>
896896
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
897897
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
898898
</textFieldCell>
@@ -1007,7 +1007,7 @@
10071007
<constraint firstAttribute="width" constant="80" id="hqF-dk-Dsb"/>
10081008
</constraints>
10091009
<textFieldCell key="cell" lineBreakMode="clipping" title="YApi设置" id="Yyq-3e-wE2">
1010-
<font key="font" metaFont="label" size="16"/>
1010+
<font key="font" metaFont="system" size="16"/>
10111011
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
10121012
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
10131013
</textFieldCell>
@@ -1018,7 +1018,7 @@
10181018
<constraint firstAttribute="width" constant="80" id="H1x-4y-gS0"/>
10191019
</constraints>
10201020
<textFieldCell key="cell" lineBreakMode="clipping" title="备注" id="vRi-ca-vqg">
1021-
<font key="font" metaFont="label" size="16"/>
1021+
<font key="font" metaFont="system" size="16"/>
10221022
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
10231023
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
10241024
</textFieldCell>
@@ -1137,41 +1137,90 @@
11371137
<objects>
11381138
<viewController title="token设置" id="dRj-c1-ovZ" customClass="TokenViewController" customModule="SwiftJSONModeler_For_Xcode" customModuleProvider="target" sceneMemberID="viewController">
11391139
<view key="view" id="xuc-OP-pKh">
1140-
<rect key="frame" x="0.0" y="0.0" width="567" height="350"/>
1140+
<rect key="frame" x="0.0" y="0.0" width="798" height="499"/>
11411141
<autoresizingMask key="autoresizingMask"/>
11421142
<subviews>
11431143
<customView translatesAutoresizingMaskIntoConstraints="NO" id="vzF-1s-O6P">
1144-
<rect key="frame" x="0.0" y="0.0" width="567" height="350"/>
1144+
<rect key="frame" x="0.0" y="0.0" width="798" height="499"/>
11451145
<subviews>
11461146
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Dfr-yA-26T">
1147-
<rect key="frame" x="50" y="30" width="467" height="290"/>
1147+
<rect key="frame" x="50" y="30" width="698" height="439"/>
11481148
<subviews>
11491149
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Z2i-Lv-jye">
1150-
<rect key="frame" x="0.0" y="210" width="467" height="60"/>
1150+
<rect key="frame" x="0.0" y="359" width="698" height="60"/>
11511151
<subviews>
11521152
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="l7l-RJ-2Of">
1153-
<rect key="frame" x="385" y="8" width="73" height="41"/>
1153+
<rect key="frame" x="616" y="8" width="73" height="41"/>
11541154
<constraints>
11551155
<constraint firstAttribute="width" constant="61" id="9Hb-xt-ogA"/>
11561156
<constraint firstAttribute="height" constant="30" id="yuK-or-Tn0"/>
11571157
</constraints>
11581158
<buttonCell key="cell" type="push" title="添加" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="NWl-tG-Nvt">
11591159
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
1160-
<font key="font" size="16" name=".AppleSimplifiedChineseFont-Medium"/>
1160+
<font key="font" metaFont="system" size="16"/>
11611161
</buttonCell>
11621162
<connections>
11631163
<action selector="AddButtonTap:" target="dRj-c1-ovZ" id="48I-uA-w0v"/>
11641164
</connections>
11651165
</button>
1166+
<textField horizontalHuggingPriority="1000" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="u2F-7R-G6v">
1167+
<rect key="frame" x="74" y="15" width="120" height="30"/>
1168+
<constraints>
1169+
<constraint firstAttribute="height" constant="30" id="2SJ-AI-UJY"/>
1170+
<constraint firstAttribute="width" constant="120" id="hGs-fR-gEJ"/>
1171+
</constraints>
1172+
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" placeholderString="项目名" bezelStyle="round" id="7Tf-aW-gCq">
1173+
<font key="font" metaFont="system"/>
1174+
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
1175+
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
1176+
</textFieldCell>
1177+
</textField>
1178+
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cmb-gd-KcC">
1179+
<rect key="frame" x="272" y="15" width="320" height="30"/>
1180+
<constraints>
1181+
<constraint firstAttribute="height" constant="30" id="rZ6-kR-Hfy"/>
1182+
</constraints>
1183+
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" placeholderString="token值" bezelStyle="round" id="fbF-cr-jl3">
1184+
<font key="font" usesAppearanceFont="YES"/>
1185+
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
1186+
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
1187+
</textFieldCell>
1188+
</textField>
1189+
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="idp-6L-bef">
1190+
<rect key="frame" x="18" y="22" width="54" height="16"/>
1191+
<textFieldCell key="cell" lineBreakMode="clipping" title="项目名:" id="UH9-BF-ttw">
1192+
<font key="font" usesAppearanceFont="YES"/>
1193+
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
1194+
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
1195+
</textFieldCell>
1196+
</textField>
1197+
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9zb-qq-MQr">
1198+
<rect key="frame" x="222" y="22" width="48" height="16"/>
1199+
<textFieldCell key="cell" lineBreakMode="clipping" title="token:" id="o8c-gl-dwL">
1200+
<font key="font" metaFont="system"/>
1201+
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
1202+
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
1203+
</textFieldCell>
1204+
</textField>
11661205
</subviews>
11671206
<constraints>
11681207
<constraint firstItem="l7l-RJ-2Of" firstAttribute="centerY" secondItem="Z2i-Lv-jye" secondAttribute="centerY" id="0MT-bS-QNz"/>
1208+
<constraint firstItem="idp-6L-bef" firstAttribute="leading" secondItem="Z2i-Lv-jye" secondAttribute="leading" constant="20" id="3lc-nO-haG"/>
1209+
<constraint firstItem="cmb-gd-KcC" firstAttribute="centerY" secondItem="Z2i-Lv-jye" secondAttribute="centerY" id="5pk-fh-h2G"/>
1210+
<constraint firstItem="cmb-gd-KcC" firstAttribute="leading" secondItem="9zb-qq-MQr" secondAttribute="trailing" constant="4" id="9jV-SZ-hxt"/>
1211+
<constraint firstItem="idp-6L-bef" firstAttribute="centerY" secondItem="Z2i-Lv-jye" secondAttribute="centerY" id="C2N-f7-c2j"/>
1212+
<constraint firstItem="9zb-qq-MQr" firstAttribute="centerY" secondItem="Z2i-Lv-jye" secondAttribute="centerY" id="FJv-VP-sXI"/>
11691213
<constraint firstAttribute="trailing" secondItem="l7l-RJ-2Of" secondAttribute="trailing" constant="15" id="Mfh-A5-Ubd"/>
1214+
<constraint firstItem="u2F-7R-G6v" firstAttribute="leading" secondItem="idp-6L-bef" secondAttribute="trailing" constant="4" id="Y1N-Pm-yog"/>
11701215
<constraint firstAttribute="height" constant="60" id="hZx-If-hcP"/>
1216+
<constraint firstItem="9zb-qq-MQr" firstAttribute="leading" secondItem="u2F-7R-G6v" secondAttribute="trailing" constant="30" id="j2h-q4-wn1"/>
1217+
<constraint firstItem="l7l-RJ-2Of" firstAttribute="leading" secondItem="cmb-gd-KcC" secondAttribute="trailing" constant="30" id="o1R-bU-ReE"/>
1218+
<constraint firstItem="cmb-gd-KcC" firstAttribute="centerY" secondItem="u2F-7R-G6v" secondAttribute="centerY" id="w2g-79-klh"/>
1219+
<constraint firstItem="u2F-7R-G6v" firstAttribute="centerY" secondItem="Z2i-Lv-jye" secondAttribute="centerY" id="y3K-49-SU9"/>
11711220
</constraints>
11721221
</customView>
11731222
<stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hgT-F4-Ywd">
1174-
<rect key="frame" x="0.0" y="0.0" width="467" height="210"/>
1223+
<rect key="frame" x="0.0" y="0.0" width="698" height="359"/>
11751224
</stackView>
11761225
</subviews>
11771226
<constraints>
@@ -1206,7 +1255,7 @@
12061255
</viewController>
12071256
<customObject id="d6U-Sm-fOC" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
12081257
</objects>
1209-
<point key="canvasLocation" x="1022.5" y="1413"/>
1258+
<point key="canvasLocation" x="1138" y="1487.5"/>
12101259
</scene>
12111260
</scenes>
12121261
</document>

SwiftJSONModeler For Xcode/TokenViewController.swift renamed to SwiftJSONModeler For Xcode/Controller/TokenViewController.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class TokenViewController: NSViewController {
6565
// willRemoveTokenView.forEach { stackView.removeArrangedSubview($0) }
6666
}
6767
for (index, tokenView) in tokenViews.enumerated() {
68+
tokenView.titleTextField.stringValue = ""
69+
tokenView.tokenTextField.stringValue = ""
6870
if index < dataSource.count {
6971
let value = dataSource[index]
7072
tokenView.titleTextField.stringValue = value.title

0 commit comments

Comments
 (0)