From f9cce6c9016fc040ed28757d5c56d1e432c89654 Mon Sep 17 00:00:00 2001 From: Angelo Stavrow Date: Wed, 30 Dec 2020 09:24:04 -0500 Subject: [PATCH] Fix button-image sizing and tap target/a11y frame --- Shared/PostList/PostListView.swift | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Shared/PostList/PostListView.swift b/Shared/PostList/PostListView.swift index 0f9e371..6f7d4fa 100644 --- a/Shared/PostList/PostListView.swift +++ b/Shared/PostList/PostListView.swift @@ -49,11 +49,17 @@ struct PostListView: View { self.model.selectedPost = managedPost } }, label: { - Image(systemName: "square.and.pencil") - .scaleEffect(1.25) // These modifiers compensate for the resizing - .padding(.vertical, 12) // done to the Image (and the button tap target) - .padding(.leading, 12) // by the SwiftUI layout system from adding a - .padding(.trailing, 8) // Spacer in this ZStack (FB8956392). + ZStack { + Image("does.not.exist") + .accessibilityHidden(true) + Image(systemName: "square.and.pencil") + .accessibilityHidden(true) + .imageScale(.large) // These modifiers compensate for the resizing + .padding(.vertical, 12) // done to the Image (and the button tap target) + .padding(.leading, 12) // by the SwiftUI layout system from adding a + .padding(.trailing, 8) // Spacer in this ZStack (FB8956392). + } + .frame(maxWidth: .infinity, maxHeight: .infinity) }) .accessibilityLabel(Text("Compose")) .accessibilityHint(Text("Compose a new local draft")) @@ -65,6 +71,10 @@ struct PostListView: View { model.isPresentingSettingsView = true }, label: { Image(systemName: "gear") + .imageScale(.large) + .padding(.vertical, 12) + .padding(.leading, 8) + .padding(.trailing, 12) }) .accessibilityLabel(Text("Settings")) .accessibilityHint(Text("Open the Settings sheet")) @@ -82,6 +92,10 @@ struct PostListView: View { } }, label: { Image(systemName: "arrow.clockwise") + .imageScale(.large) + .padding(.vertical, 12) + .padding(.leading, 12) + .padding(.trailing, 8) }) .accessibilityLabel(Text("Refresh Posts")) .accessibilityHint(Text("Fetch changes from the server"))