Fix read filter accessibility labels (help)

This commit is contained in:
Maurice Parker 2020-07-12 15:03:43 -05:00
parent 6c236fc0e3
commit 2ebec7801c
4 changed files with 15 additions and 5 deletions

View File

@ -30,7 +30,7 @@ struct SidebarToolbarModifier: ViewModifier {
} else {
AppAssets.filterInactiveImage.font(.title3)
}
}).help("Filter Read Feeds")
}).help(sidebarModel.isReadFiltered ? "Show Read Feeds" : "Filter Read Feeds")
}
ToolbarItem(placement: .automatic) {

View File

@ -35,6 +35,7 @@ struct SidebarView: View {
})
.padding(.top, 8).padding(.trailing)
.buttonStyle(PlainButtonStyle())
.help(sidebarModel.isReadFiltered ? "Show Read Feeds" : "Filter Read Feeds")
}
ZStack {
NavigationLink(destination: TimelineContainerView(feeds: sidebarModel.selectedFeeds), isActive: $navigate) {

View File

@ -10,16 +10,24 @@ import SwiftUI
struct TimelineToolbarModifier: ViewModifier {
@EnvironmentObject private var timelineModel: TimelineModel
func body(content: Content) -> some View {
content
.toolbar {
#if os(iOS)
ToolbarItem(placement: .navigation) {
Button (action: {
withAnimation {
timelineModel.isReadFiltered.toggle()
}
}, label: {
AppAssets.filterInactiveImage
.font(.title3)
}).help("Filter Read Articles")
if timelineModel.isReadFiltered {
AppAssets.filterActiveImage.font(.title3)
} else {
AppAssets.filterInactiveImage.font(.title3)
}
}).help(timelineModel.isReadFiltered ? "Show Read Articles" : "Filter Read Articles")
}
ToolbarItem {

View File

@ -31,6 +31,7 @@ struct TimelineView: View {
})
.padding(.top, 8).padding(.trailing)
.buttonStyle(PlainButtonStyle())
.help(timelineModel.isReadFiltered ? "Show Read Articles" : "Filter Read Articles")
}
ZStack {
NavigationLink(destination: ArticleContainerView(articles: timelineModel.selectedArticles), isActive: $navigate) {