Skip to content

Commit 7541a95

Browse files
committed
perf: Optimize font scaling
1 parent bdae21a commit 7541a95

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

V2exOS/Views/SettingsView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct AppearanceSettingsView: View {
2828

2929
var body: some View {
3030
Form {
31-
Slider(value: $SettingsConfig.fontSize, in: 10.0 ... 30.0) {
31+
Slider(value: $SettingsConfig.fontSize, in: 14.0 ... 20.0, step: 2) {
3232
Text("字体大小")
3333
}
3434
}

V2exOS/Views/TopicDetail/CommentListView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct CommentListView: View {
6868
Text(LocalizedStringKey(comment.content))
6969
.foregroundColor(.label)
7070
#if os(macOS)
71-
.font(.system(size: settingsConfig.fontSize))
71+
.font(.system(size: settingsConfig.fontSize - 1))
7272
#endif
7373
}
7474
}

V2exOS/Views/TopicList/TopicListCellView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import V2exAPI
1212
struct TopicListCellView: View {
1313
@State var isMemberLoading = false
1414

15+
@EnvironmentObject private var settingsConfig: SettingsConfig
1516
@Environment(\.colorScheme) var colorScheme
1617

1718
let topic: V2Topic
@@ -37,6 +38,7 @@ struct TopicListCellView: View {
3738
VStack(alignment: .leading, spacing: 6) {
3839
Text(topic.title ?? "")
3940
.lineLimit(2)
41+
.font(Font.system(size: settingsConfig.fontSize - 1))
4042

4143
HStack {
4244
if let username = topic.member?.username ?? topic.lastReplyBy {

0 commit comments

Comments
 (0)