Explorar o código

Align tool page back button with content and widen the default window.

Keep titles flush with page content by overlaying a larger back arrow in the margin, and bump the default window width to 1180 for a bit more breathing room.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 hai 1 mes
pai
achega
1c694fdf39

+ 1 - 1
gramora/Utilities/AppTheme.swift

@@ -1,7 +1,7 @@
 import SwiftUI
 
 enum AppTheme {
-    static let windowWidth: CGFloat = 1100
+    static let windowWidth: CGFloat = 1180
     static let windowHeight: CGFloat = 720
     static let windowMinWidth: CGFloat = windowWidth
     static let windowMinHeight: CGFloat = windowHeight

+ 14 - 6
gramora/Views/Components/ToolPageHeader.swift

@@ -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)