|
|
@@ -8,14 +8,11 @@ struct ToolPageHeader<Tagline: View, Trailing: View>: View {
|
|
|
@ViewBuilder var tagline: () -> Tagline
|
|
|
@ViewBuilder var trailing: () -> Trailing
|
|
|
|
|
|
+ /// IconButton width (~30) plus gap before the title.
|
|
|
+ private let backButtonLeadingInset: CGFloat = 38
|
|
|
+
|
|
|
var body: some View {
|
|
|
HStack(alignment: .top, spacing: 8) {
|
|
|
- if showsBackButton {
|
|
|
- IconButton(iconName: "arrow.left", action: onBack)
|
|
|
- .accessibilityLabel("Go back")
|
|
|
- .padding(.top, 8)
|
|
|
- }
|
|
|
-
|
|
|
VStack(alignment: .leading, spacing: 8) {
|
|
|
Text(title)
|
|
|
.font(.system(size: titleFontSize, weight: .bold))
|
|
|
@@ -23,6 +20,17 @@ struct ToolPageHeader<Tagline: View, Trailing: View>: View {
|
|
|
|
|
|
tagline()
|
|
|
}
|
|
|
+ .overlay(alignment: .topLeading) {
|
|
|
+ if showsBackButton {
|
|
|
+ IconButton(icon: {
|
|
|
+ Image(systemName: "arrow.left")
|
|
|
+ .font(.system(size: 17, weight: .semibold))
|
|
|
+ }, action: onBack)
|
|
|
+ .accessibilityLabel("Go back")
|
|
|
+ .padding(.top, 8)
|
|
|
+ .offset(x: -backButtonLeadingInset)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
Spacer(minLength: 0)
|
|
|
|