Fix button-image sizing and tap target/a11y frame

This commit is contained in:
Angelo Stavrow 2020-12-30 09:24:04 -05:00
parent 555b988282
commit f9cce6c901
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE

View File

@ -49,11 +49,17 @@ struct PostListView: View {
self.model.selectedPost = managedPost self.model.selectedPost = managedPost
} }
}, label: { }, label: {
Image(systemName: "square.and.pencil") ZStack {
.scaleEffect(1.25) // These modifiers compensate for the resizing Image("does.not.exist")
.padding(.vertical, 12) // done to the Image (and the button tap target) .accessibilityHidden(true)
.padding(.leading, 12) // by the SwiftUI layout system from adding a Image(systemName: "square.and.pencil")
.padding(.trailing, 8) // Spacer in this ZStack (FB8956392). .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")) .accessibilityLabel(Text("Compose"))
.accessibilityHint(Text("Compose a new local draft")) .accessibilityHint(Text("Compose a new local draft"))
@ -65,6 +71,10 @@ struct PostListView: View {
model.isPresentingSettingsView = true model.isPresentingSettingsView = true
}, label: { }, label: {
Image(systemName: "gear") Image(systemName: "gear")
.imageScale(.large)
.padding(.vertical, 12)
.padding(.leading, 8)
.padding(.trailing, 12)
}) })
.accessibilityLabel(Text("Settings")) .accessibilityLabel(Text("Settings"))
.accessibilityHint(Text("Open the Settings sheet")) .accessibilityHint(Text("Open the Settings sheet"))
@ -82,6 +92,10 @@ struct PostListView: View {
} }
}, label: { }, label: {
Image(systemName: "arrow.clockwise") Image(systemName: "arrow.clockwise")
.imageScale(.large)
.padding(.vertical, 12)
.padding(.leading, 12)
.padding(.trailing, 8)
}) })
.accessibilityLabel(Text("Refresh Posts")) .accessibilityLabel(Text("Refresh Posts"))
.accessibilityHint(Text("Fetch changes from the server")) .accessibilityHint(Text("Fetch changes from the server"))