NetNewsWire/Multiplatform/Shared/Timeline/TimelineToolbarModifier.swift

68 lines
1.4 KiB
Swift
Raw Normal View History

//
2020-07-09 00:50:18 +02:00
// TimelineToolbarModifier.swift
// NetNewsWire
//
// Created by Maurice Parker on 7/5/20.
// Copyright © 2020 Ranchero Software. All rights reserved.
//
import SwiftUI
struct TimelineToolbarModifier: ViewModifier {
@EnvironmentObject private var timelineModel: TimelineModel
func body(content: Content) -> some View {
content
.toolbar {
#if os(iOS)
2020-07-05 22:11:45 +02:00
ToolbarItem(placement: .navigation) {
Button (action: {
withAnimation {
timelineModel.toggleReadFilter()
}
2020-07-05 22:11:45 +02:00
}, label: {
if timelineModel.isReadFiltered ?? false {
AppAssets.filterActiveImage.font(.title3)
} else {
AppAssets.filterInactiveImage.font(.title3)
}
})
.hidden(timelineModel.isReadFiltered == nil)
.help(timelineModel.isReadFiltered ?? false ? "Show Read Articles" : "Filter Read Articles")
2020-07-05 22:11:45 +02:00
}
ToolbarItem {
Button(action: {
}, label: {
AppAssets.markAllAsReadImage
.foregroundColor(.accentColor)
}).help("Mark All As Read")
}
2020-07-05 22:11:45 +02:00
ToolbarItem {
Spacer()
}
2020-07-05 22:11:45 +02:00
ToolbarItem(placement: .automatic) {
RefreshProgressView()
}
2020-07-05 22:11:45 +02:00
ToolbarItem {
Spacer()
}
2020-07-05 22:11:45 +02:00
ToolbarItem {
Button(action: {
}, label: {
AppAssets.nextUnreadArticleImage
.font(.title3)
}).help("Next Unread")
}
2020-07-05 22:11:45 +02:00
#endif
}
}
}