Compose screen VoiceOver improvements
This commit is contained in:
parent
ea6698a2d8
commit
c01bc4d840
|
@ -22,7 +22,7 @@ struct ComposeCurrentAccount: View {
|
|||
ComposeAvatarImageView(url: account?.avatar)
|
||||
.frame(width: 50, height: 50)
|
||||
.cornerRadius(preferences.avatarStyle.cornerRadiusFraction * 50)
|
||||
.accessibility(label: Text(account != nil ? "\(account!.displayName) avatar" : "Avatar"))
|
||||
.accessibilityHidden(true)
|
||||
|
||||
if let id = account?.id,
|
||||
let account = mastodonController.persistentContainer.account(for: id) {
|
||||
|
|
|
@ -107,6 +107,11 @@ class ComposeHostingController: UIHostingController<ComposeHostingController.Wra
|
|||
}
|
||||
}
|
||||
|
||||
override func accessibilityPerformEscape() -> Bool {
|
||||
dismissCompose(mode: .cancel)
|
||||
return true
|
||||
}
|
||||
|
||||
// MARK: Duckable
|
||||
|
||||
func duckableViewControllerWillAnimateDuck(withDuration duration: CGFloat, afterDelay delay: CGFloat) {
|
||||
|
|
|
@ -80,6 +80,7 @@ struct ComposeReplyView: View {
|
|||
.frame(width: 50, height: 50)
|
||||
.cornerRadius(preferences.avatarStyle.cornerRadiusFraction * 50)
|
||||
.offset(x: 0, y: offset)
|
||||
.accessibilityHidden(true)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -202,11 +202,16 @@ struct ComposeView: View {
|
|||
private var header: some View {
|
||||
HStack(alignment: .top) {
|
||||
ComposeCurrentAccount()
|
||||
.accessibilitySortPriority(1)
|
||||
|
||||
Spacer()
|
||||
|
||||
Text(verbatim: charactersRemaining.description)
|
||||
.foregroundColor(charactersRemaining < 0 ? .red : .secondary)
|
||||
.font(Font.body.monospacedDigit())
|
||||
.accessibility(label: Text(charactersRemaining < 0 ? "\(-charactersRemaining) characters too many" : "\(charactersRemaining) characters remaining"))
|
||||
// this should come first, so VO users can back to it from the main compose text view
|
||||
.accessibilitySortPriority(0)
|
||||
}.frame(height: 50)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue