Skip to content

Commit 21e2a10

Browse files
authored
Merge pull request #506 from alladinian/feature/Settings-window-layout
Improvements in the layout of the Settings window
2 parents bf4650e + b4e598f commit 21e2a10

File tree

7 files changed

+30
-21
lines changed

7 files changed

+30
-21
lines changed

Xcodes/Frontend/About/AcknowledgementsView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ struct AcknowledgmentsView: View {
1010
)!
1111
.addingAttribute(.foregroundColor, value: NSColor.labelColor)
1212
)
13-
.frame(minWidth: 500, minHeight: 500)
13+
.frame(minWidth: 600, minHeight: 500)
1414
}
1515
}
1616

Xcodes/Frontend/Preferences/AdvancedPreferencePane.swift

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ struct AdvancedPreferencePane: View {
3838
}
3939
Text("InstallPathDescription")
4040
.font(.footnote)
41+
.foregroundStyle(.secondary)
4142
.fixedSize(horizontal: false, vertical: true)
4243
}
4344
}
@@ -73,6 +74,7 @@ struct AdvancedPreferencePane: View {
7374
}
7475
Text("LocalCachePathDescription")
7576
.font(.footnote)
77+
.foregroundStyle(.secondary)
7678
.fixedSize(horizontal: false, vertical: true)
7779
}
7880
}
@@ -94,6 +96,7 @@ struct AdvancedPreferencePane: View {
9496

9597
Text(appState.onSelectActionType.detailedDescription)
9698
.font(.footnote)
99+
.foregroundStyle(.secondary)
97100
.fixedSize(horizontal: false, vertical: true)
98101
Spacer()
99102
.frame(height: 20)
@@ -102,6 +105,7 @@ struct AdvancedPreferencePane: View {
102105
.disabled(appState.createSymLinkOnSelectDisabled)
103106
Text("AutomaticallyCreateSymbolicLinkDescription")
104107
.font(.footnote)
108+
.foregroundStyle(.secondary)
105109
.fixedSize(horizontal: false, vertical: true)
106110
}
107111
.fixedSize(horizontal: false, vertical: true)
@@ -114,6 +118,7 @@ struct AdvancedPreferencePane: View {
114118
.disabled(appState.createSymLinkOnSelectDisabled)
115119
Text("ShowOpenInRosettaDescription")
116120
.font(.footnote)
121+
.foregroundStyle(.secondary)
117122
.fixedSize(horizontal: false, vertical: true)
118123
}
119124
.groupBoxStyle(PreferencesGroupBoxStyle())
@@ -128,16 +133,18 @@ struct AdvancedPreferencePane: View {
128133
case .installed:
129134
Text("HelperInstalled")
130135
case .notInstalled:
131-
HStack {
132-
Text("HelperNotInstalled")
136+
VStack(alignment: .leading) {
133137
Button("InstallHelper") {
134138
appState.installHelperIfNecessary()
135139
}
140+
Text("HelperNotInstalled")
141+
.font(.footnote)
136142
}
137143
}
138144

139145
Text("PrivilegedHelperDescription")
140146
.font(.footnote)
147+
.foregroundStyle(.secondary)
141148
.fixedSize(horizontal: false, vertical: true)
142149

143150
Spacer()
@@ -153,21 +160,18 @@ struct AdvancedPreferencePane_Previews: PreviewProvider {
153160
Group {
154161
AdvancedPreferencePane()
155162
.environmentObject(AppState())
156-
.frame(maxWidth: 500)
163+
.frame(maxWidth: 600)
157164
}
158-
.frame(width: 500, height: 700, alignment: .center)
165+
.frame(width: 600, height: 700, alignment: .center)
159166
}
160167
}
161168

162169
// A group style for the preferences
163170
struct PreferencesGroupBoxStyle: GroupBoxStyle {
164171
func makeBody(configuration: Configuration) -> some View {
165172
HStack(alignment: .top, spacing: 20) {
166-
HStack {
167-
Spacer()
168-
configuration.label
169-
}
170-
.frame(width: 120)
173+
configuration.label
174+
.frame(width: 180, alignment: .trailing)
171175

172176
VStack(alignment: .leading) {
173177
configuration.content

Xcodes/Frontend/Preferences/DownloadPreferencePane.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ struct DownloadPreferencePane: View {
1818
}
1919
}
2020
.labelsHidden()
21+
.fixedSize()
2122

2223
AttributedText(dataSourceFootnote)
2324
}
@@ -34,6 +35,7 @@ struct DownloadPreferencePane: View {
3435
}
3536
}
3637
.labelsHidden()
38+
.fixedSize()
3739

3840
AttributedText(downloaderFootnote)
3941
}
@@ -50,7 +52,7 @@ struct DownloadPreferencePane: View {
5052
string: string,
5153
attributes: [
5254
.font: NSFont.preferredFont(forTextStyle: .footnote, options: [:]),
53-
.foregroundColor: NSColor.labelColor
55+
.foregroundColor: NSColor.secondaryLabelColor
5456
]
5557
)
5658
attributedString.addAttribute(.link, value: URL(string: "https://xcodereleases.com")!, range: NSRange(string.range(of: "Xcode Releases")!, in: string))
@@ -63,7 +65,7 @@ struct DownloadPreferencePane: View {
6365
string: string,
6466
attributes: [
6567
.font: NSFont.preferredFont(forTextStyle: .footnote, options: [:]),
66-
.foregroundColor: NSColor.labelColor
68+
.foregroundColor: NSColor.secondaryLabelColor
6769
]
6870
)
6971
attributedString.addAttribute(.link, value: URL(string: "https://github.com/aria2/aria2")!, range: NSRange(string.range(of: "aria2")!, in: string))
@@ -74,9 +76,10 @@ struct DownloadPreferencePane: View {
7476
struct DownloadPreferencePane_Previews: PreviewProvider {
7577
static var previews: some View {
7678
Group {
77-
GeneralPreferencePane()
79+
DownloadPreferencePane()
7880
.environmentObject(AppState())
79-
.frame(maxWidth: 500)
81+
.frame(maxWidth: 600)
82+
.frame(minHeight: 300)
8083
}
8184
}
8285
}

Xcodes/Frontend/Preferences/ExperiementsPreferencePane.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ struct ExperimentsPreferencePane: View {
1818
.fixedSize(horizontal: false, vertical: true)
1919
}
2020
.groupBoxStyle(PreferencesGroupBoxStyle())
21-
22-
Divider()
2321
}
2422
}
2523

@@ -29,7 +27,7 @@ struct ExperimentsPreferencePane: View {
2927
string: string,
3028
attributes: [
3129
.font: NSFont.preferredFont(forTextStyle: .footnote, options: [:]),
32-
.foregroundColor: NSColor.labelColor
30+
.foregroundColor: NSColor.secondaryLabelColor
3331
]
3432
)
3533
attributedString.addAttribute(.link, value: URL(string: "https://twitter.com/_saagarjha")!, range: NSRange(string.range(of: "@_saagarjha")!, in: string))
@@ -43,7 +41,7 @@ struct ExperimentsPreferencePane_Previews: PreviewProvider {
4341
Group {
4442
ExperimentsPreferencePane()
4543
.environmentObject(AppState())
46-
.frame(maxWidth: 500)
44+
.frame(maxWidth: 600)
4745
}
4846
}
4947
}

Xcodes/Frontend/Preferences/GeneralPreferencePane.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct GeneralPreferencePane_Previews: PreviewProvider {
2929
Group {
3030
GeneralPreferencePane()
3131
.environmentObject(AppState())
32-
.frame(maxWidth: 500)
32+
.frame(maxWidth: 600)
3333
}
3434
}
3535
}

Xcodes/Frontend/Preferences/PreferencesView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ struct PreferencesView: View {
3939
.tag(Tabs.experiment)
4040
}
4141
.padding(20)
42-
.frame(width: 500)
42+
.frame(width: 600)
4343
}
4444
}

Xcodes/Frontend/Preferences/UpdatesPreferencePane.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ struct UpdatesPreferencePane: View {
4343
Button("CheckNow") {
4444
updater.checkForUpdates()
4545
}
46+
.padding(.top)
4647

4748
Text(String(format: localizeString("LastChecked"), lastUpdatedString))
4849
.font(.footnote)
50+
.foregroundStyle(.secondary)
4951
}
5052
.frame(maxWidth: .infinity, alignment: .leading)
5153
}
@@ -140,7 +142,9 @@ struct UpdatesPreferencePane_Previews: PreviewProvider {
140142
Group {
141143
UpdatesPreferencePane()
142144
.environmentObject(AppState())
143-
.frame(maxWidth: 500)
145+
.environmentObject(ObservableUpdater())
146+
.frame(maxWidth: 600)
147+
.frame(minHeight: 300)
144148
}
145149
}
146150
}

0 commit comments

Comments
 (0)