Skip to content

Commit e44143b

Browse files
committed
Optimize the UI of the detail page
1 parent 37fb5cd commit e44143b

File tree

5 files changed

+108
-8
lines changed

5 files changed

+108
-8
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1420"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "0D2334CD2996944500DF4B73"
18+
BuildableName = "V2exOSiOS.app"
19+
BlueprintName = "V2exOSiOS"
20+
ReferencedContainer = "container:V2exOS.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
language = "zh-Hans"
38+
launchStyle = "0"
39+
useCustomWorkingDirectory = "NO"
40+
ignoresPersistentStateOnLaunch = "NO"
41+
debugDocumentVersioning = "YES"
42+
debugServiceExtension = "internal"
43+
allowLocationSimulation = "YES">
44+
<BuildableProductRunnable
45+
runnableDebuggingMode = "0">
46+
<BuildableReference
47+
BuildableIdentifier = "primary"
48+
BlueprintIdentifier = "0D2334CD2996944500DF4B73"
49+
BuildableName = "V2exOSiOS.app"
50+
BlueprintName = "V2exOSiOS"
51+
ReferencedContainer = "container:V2exOS.xcodeproj">
52+
</BuildableReference>
53+
</BuildableProductRunnable>
54+
</LaunchAction>
55+
<ProfileAction
56+
buildConfiguration = "Release"
57+
shouldUseLaunchSchemeArgsEnv = "YES"
58+
savedToolIdentifier = ""
59+
useCustomWorkingDirectory = "NO"
60+
debugDocumentVersioning = "YES">
61+
<BuildableProductRunnable
62+
runnableDebuggingMode = "0">
63+
<BuildableReference
64+
BuildableIdentifier = "primary"
65+
BlueprintIdentifier = "0D2334CD2996944500DF4B73"
66+
BuildableName = "V2exOSiOS.app"
67+
BlueprintName = "V2exOSiOS"
68+
ReferencedContainer = "container:V2exOS.xcodeproj">
69+
</BuildableReference>
70+
</BuildableProductRunnable>
71+
</ProfileAction>
72+
<AnalyzeAction
73+
buildConfiguration = "Debug">
74+
</AnalyzeAction>
75+
<ArchiveAction
76+
buildConfiguration = "Release"
77+
revealArchiveInOrganizer = "YES">
78+
</ArchiveAction>
79+
</Scheme>

V2exOS.xcodeproj/xcuserdata/isaced.xcuserdatad/xcschemes/xcschememanagement.plist

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@
1717
<key>V2exOSiOS.xcscheme_^#shared#^_</key>
1818
<dict>
1919
<key>orderHint</key>
20-
<integer>6</integer>
20+
<integer>2</integer>
2121
</dict>
2222
</dict>
2323
<key>SuppressBuildableAutocreation</key>
2424
<dict>
25+
<key>0D2334CD2996944500DF4B73</key>
26+
<dict>
27+
<key>primary</key>
28+
<true/>
29+
</dict>
2530
<key>0DA7FA63298799B300374B3A</key>
2631
<dict>
2732
<key>primary</key>

V2exOS/Views/Components/UserName.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,30 @@ struct UserName: View {
1717
}
1818

1919
var body: some View {
20-
#if os(macOS)
20+
#if os(macOS) || os(iOS)
2121
Button {
2222
if let url = URL(string: "https://www.v2ex.com/member/\(username)") {
23+
24+
#if os(iOS)
25+
UIApplication.shared.open(url)
26+
#endif
27+
#if os(macOS)
2328
NSWorkspace.shared.open(url)
29+
#endif
2430
}
2531
} label: {
2632
Text(username)
2733
.foregroundColor(.secondary)
28-
.fontWeight(.bold)
34+
// .fontWeight(.bold)
35+
#if os(macOS)
2936
.onHover { inside in
3037
if inside {
3138
NSCursor.pointingHand.push()
3239
} else {
3340
NSCursor.pop()
3441
}
3542
}
43+
#endif
3644
}
3745
.buttonStyle(PlainButtonStyle())
3846
#elseif os(tvOS)

V2exOS/Views/TopicDetail/CommentListView.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ struct CommentListView: View {
1919

2020
var body: some View {
2121
Label("\(commentCount ?? 0) 条回复", systemImage: "bubble.middle.bottom.fill")
22+
.foregroundColor(.secondary)
2223
#if os(tvOS)
23-
.focusable()
24+
.focusable()
2425
#endif
2526

2627
if let commentList {
@@ -75,7 +76,7 @@ struct CommentListView: View {
7576
range: nil
7677
)
7778
)
78-
#if !os(tvOS)
79+
#if os(macOS)
7980
.markdownStyle(MarkdownStyle(font: .system(size: settingsConfig.fontSize)))
8081
#endif
8182
}

V2exOS/Views/TopicDetail/TopicDetailView.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ struct TopicDetailView: View {
4545
}
4646
#if !os(tvOS)
4747
Link(destination: URL(string: "https://www.v2ex.com/t/\(topic.id)")!) {
48-
Image(systemName: "safari")
49-
Text("在网页中打开")
48+
49+
HStack(alignment: .bottom, spacing: 5) {
50+
Image(systemName: "safari")
51+
Text("在浏览器中打开")
52+
}
5053
}
5154
#endif
5255

@@ -56,7 +59,7 @@ struct TopicDetailView: View {
5659
Spacer()
5760

5861
Markdown(topic.content ?? "")
59-
#if !os(tvOS)
62+
#if os(macOS)
6063
.markdownStyle(MarkdownStyle(font: .system(size: settingsConfig.fontSize)))
6164
#endif
6265
#if os(tvOS)
@@ -79,6 +82,9 @@ struct TopicDetailView: View {
7982
}
8083
}
8184
}
85+
#if os(iOS)
86+
.listStyle(.plain)
87+
#endif
8288
.task {
8389
loadComments(page: 1)
8490
}
@@ -106,6 +112,7 @@ struct TopicDetailView_Previews: PreviewProvider {
106112
PreviewData.comment,
107113
PreviewData.comment
108114
])
115+
.environmentObject(SettingsConfig.shared)
109116
.previewLayout(.fixed(width: 300, height: .infinity))
110117
}
111118
}

0 commit comments

Comments
 (0)