handle chaotically long titles
This commit is contained in:
parent
cf0471c7ad
commit
cf872d5fd3
@ -175,8 +175,8 @@ struct RecordHeroView: View {
|
||||
private let heroHeight: CGFloat = 360
|
||||
private let heroTopPadding: CGFloat = 74
|
||||
private let heroBottomPadding: CGFloat = 20
|
||||
private let titleLineLimit = 3
|
||||
private let titleMinimumScale: CGFloat = 0.82
|
||||
private let titleLineLimit = 5
|
||||
private let titleMinimumScale: CGFloat = 0.78
|
||||
private let detailsColumnSpacing: CGFloat = 18
|
||||
|
||||
let item: MinecraftContentItem
|
||||
@ -199,7 +199,7 @@ struct RecordHeroView: View {
|
||||
endPoint: .bottom
|
||||
)
|
||||
|
||||
HStack(alignment: .top, spacing: 28) {
|
||||
HStack(alignment: .top, spacing: 18) {
|
||||
HeroThumbnailView(
|
||||
iconURL: item.iconURL,
|
||||
contentType: item.contentType,
|
||||
@ -216,6 +216,7 @@ struct RecordHeroView: View {
|
||||
.minimumScaleFactor(titleMinimumScale)
|
||||
.truncationMode(.tail)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.textSelection(.enabled)
|
||||
|
||||
Button(action: copyAction) {
|
||||
@ -291,8 +292,8 @@ struct RecordHeroView: View {
|
||||
}
|
||||
|
||||
private struct HeroThumbnailView: View {
|
||||
private let thumbnailMaxWidth: CGFloat = 320
|
||||
private let thumbnailMaxHeight: CGFloat = 200
|
||||
private let thumbnailMaxWidth: CGFloat = 280
|
||||
private let thumbnailMaxHeight: CGFloat = 180
|
||||
private let thumbnailMinHeight: CGFloat = 120
|
||||
|
||||
let iconURL: URL?
|
||||
|
||||
@ -81,7 +81,8 @@ struct ItemDetailColumnView: View {
|
||||
}
|
||||
|
||||
struct ItemDetailView: View {
|
||||
private let contentMaxWidth: CGFloat = 760
|
||||
private let detailContentMaxWidth: CGFloat = 760
|
||||
private let heroContentMaxWidth: CGFloat = 1080
|
||||
|
||||
let item: MinecraftContentItem
|
||||
let source: MinecraftSource?
|
||||
@ -232,7 +233,7 @@ struct ItemDetailView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: contentMaxWidth, alignment: .leading)
|
||||
.frame(maxWidth: detailContentMaxWidth, alignment: .leading)
|
||||
.padding(.horizontal, 28)
|
||||
.padding(.top, 28)
|
||||
.padding(.bottom, 24)
|
||||
@ -254,7 +255,7 @@ struct ItemDetailView: View {
|
||||
copyToPasteboard(item.displayName)
|
||||
},
|
||||
actionRow: AnyView(actionRow),
|
||||
contentMaxWidth: contentMaxWidth
|
||||
contentMaxWidth: heroContentMaxWidth
|
||||
)
|
||||
}
|
||||
|
||||
@ -273,7 +274,7 @@ struct ItemDetailView: View {
|
||||
|
||||
private var summaryGrid: some View {
|
||||
VStack(alignment: .leading, spacing: 14) {
|
||||
detailValueRow(title: "Name", value: item.displayName)
|
||||
detailRow(title: "Name", value: item.displayName)
|
||||
detailValueRow(title: "Size", value: sizeText)
|
||||
detailValueRow(title: item.displayDateLabel, value: displayDateText)
|
||||
detailValueRow(title: "Created", value: createdDateText)
|
||||
@ -517,7 +518,7 @@ struct ItemDetailView: View {
|
||||
.foregroundStyle(.secondary)
|
||||
|
||||
Text(value)
|
||||
.lineLimit(3)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.textSelection(.enabled)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user