Ver código fonte

Add scrolling to grammar checker Your Content panel.

Long corrected text can now be scrolled while keeping the copy button fixed at the bottom.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 1 mês atrás
pai
commit
c39f5cf147
1 arquivos alterados com 9 adições e 5 exclusões
  1. 9 5
      gramora/Views/GrammarCheckerView.swift

+ 9 - 5
gramora/Views/GrammarCheckerView.swift

@@ -218,11 +218,15 @@ struct GrammarCheckerView: View {
                 .foregroundStyle(AppTheme.textPrimary)
 
             VStack(alignment: .leading, spacing: 0) {
-                Text(viewModel.correctedText)
-                    .font(.system(size: 14))
-                    .foregroundStyle(AppTheme.textPrimary)
-                    .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
-                    .padding(20)
+                ScrollView(.vertical, showsIndicators: true) {
+                    Text(viewModel.correctedText)
+                        .font(.system(size: 14))
+                        .foregroundStyle(AppTheme.textPrimary)
+                        .frame(maxWidth: .infinity, alignment: .topLeading)
+                        .multilineTextAlignment(.leading)
+                        .padding(20)
+                }
+                .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
 
                 HStack {
                     ToolbarButton(title: "Copy Text", iconName: "doc.on.doc") {