Compare commits

..

1 Commits

Author SHA1 Message Date
5bf5402919 Fix side menu label size so that translations in longer languages fit without wrapping
Changelog-Fixed: Fix side menu label size so that translations in longer languages fit without wrapping
2023-05-26 00:13:36 -04:00
6 changed files with 9 additions and 22 deletions

View File

@@ -43,9 +43,7 @@ struct UserView: View {
let profile = damus_state.profiles.lookup(id: pubkey)
ProfileName(pubkey: pubkey, profile: profile, damus: damus_state, show_nip5_domain: false)
if let about = profile?.about {
let blocks = parse_mentions(content: about, tags: [])
let about_string = render_blocks(blocks: blocks, profiles: damus_state.profiles).content.attributed
Text(about_string)
Text(about)
.lineLimit(3)
.font(.footnote)
}

View File

@@ -12,7 +12,6 @@ enum EventViewKind {
case small
case normal
case selected
case subheadline
}
struct EventView: View {
@@ -107,8 +106,6 @@ func eventviewsize_to_font(_ size: EventViewKind) -> Font {
return .body
case .selected:
return .custom("selected", size: 21.0)
case .subheadline:
return .subheadline
}
}
@@ -120,8 +117,6 @@ func eventviewsize_to_uifont(_ size: EventViewKind) -> UIFont {
return .preferredFont(forTextStyle: .body)
case .selected:
return .preferredFont(forTextStyle: .title2)
case .subheadline:
return .preferredFont(forTextStyle: .subheadline)
}
}

View File

@@ -15,8 +15,6 @@ func eventview_pfp_size(_ size: EventViewKind) -> CGFloat {
return PFP_SIZE
case .selected:
return PFP_SIZE
case .subheadline:
return PFP_SIZE * 0.5
}
}

View File

@@ -57,9 +57,7 @@ struct ParticipantsView: View {
let profile = damus_state.profiles.lookup(id: pubkey)
ProfileName(pubkey: pubkey, profile: profile, damus: damus_state, show_nip5_domain: false)
if let about = profile?.about {
let blocks = parse_mentions(content: about, tags: [])
let about_string = render_blocks(blocks: blocks, profiles: damus_state.profiles).content.attributed
Text(about_string)
Text(FollowUserView.markdown.process(about))
.lineLimit(3)
.font(.footnote)
}

View File

@@ -370,15 +370,9 @@ struct ProfileView: View {
let profile_data = damus_state.profiles.lookup(id: profile.pubkey)
nameSection(profile_data: profile_data)
if let about = profile_data?.about {
let blocks = parse_mentions(content: about, tags: [])
let about_string = render_blocks(blocks: blocks, profiles: damus_state.profiles).content.attributed
SelectableText(attributedString: about_string, size: .subheadline)
} else {
Text(verbatim: "")
.font(.subheadline)
}
Text(ProfileView.markdown.process(profile_data?.about ?? ""))
.font(.subheadline).textSelection(.enabled)
if let url = profile_data?.website_url {
WebsiteLink(url: url)

View File

@@ -57,6 +57,7 @@ struct SideMenuView: View {
.font(.title2)
.foregroundColor(textColor())
.frame(maxWidth: .infinity, alignment: .leading)
.dynamicTypeSize(.xSmall)
}
}
@@ -144,6 +145,7 @@ struct SideMenuView: View {
.font(.title3)
.foregroundColor(textColor())
.frame(maxWidth: .infinity, alignment: .leading)
.dynamicTypeSize(.xSmall)
})
Spacer()
@@ -154,6 +156,7 @@ struct SideMenuView: View {
Label("", systemImage: "qrcode")
.font(.title)
.foregroundColor(textColor())
.dynamicTypeSize(.xSmall)
}).fullScreenCover(isPresented: $showQRCode) {
QRCodeView(damus_state: damus_state, pubkey: damus_state.pubkey)
}
@@ -188,6 +191,7 @@ struct SideMenuView: View {
.font(.title2)
.foregroundColor(textColor())
.frame(maxWidth: .infinity, alignment: .leading)
.dynamicTypeSize(.xSmall)
}
struct SideMenuLabelStyle: LabelStyle {