mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Add TimeilneToolbar. Issue #2195
This commit is contained in:
@@ -13,19 +13,15 @@ struct ArticleContainerView: View {
|
||||
|
||||
@EnvironmentObject private var sceneModel: SceneModel
|
||||
@StateObject private var articleModel = ArticleModel()
|
||||
var article: Article? = nil
|
||||
var article: Article
|
||||
|
||||
@ViewBuilder var body: some View {
|
||||
if let article = article {
|
||||
ArticleView()
|
||||
.environmentObject(articleModel)
|
||||
.onAppear {
|
||||
sceneModel.articleModel = articleModel
|
||||
articleModel.delegate = sceneModel
|
||||
}
|
||||
} else {
|
||||
EmptyView()
|
||||
}
|
||||
ArticleView()
|
||||
.environmentObject(articleModel)
|
||||
.onAppear {
|
||||
sceneModel.articleModel = articleModel
|
||||
articleModel.delegate = sceneModel
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,11 @@ struct TimelineContainerView: View {
|
||||
timelineModel.delegate = sceneModel
|
||||
timelineModel.rebuildTimelineItems(feed)
|
||||
}
|
||||
.overlay(Group {
|
||||
#if os(iOS)
|
||||
TimelineToolbar()
|
||||
#endif
|
||||
},alignment: .bottom)
|
||||
} else {
|
||||
EmptyView()
|
||||
}
|
||||
|
||||
56
Multiplatform/Shared/Timeline/TimelineToolbar.swift
Normal file
56
Multiplatform/Shared/Timeline/TimelineToolbar.swift
Normal file
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// TimelineToolbar.swift
|
||||
// NetNewsWire
|
||||
//
|
||||
// Created by Maurice Parker on 7/3/20.
|
||||
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct TimelineToolbar: View {
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
Divider()
|
||||
HStack(alignment: .center) {
|
||||
Button(action: {
|
||||
}, label: {
|
||||
AppAssets.markAllAsReadImage
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.frame(width: 24, height: 24, alignment: .center)
|
||||
.foregroundColor(.accentColor)
|
||||
}).help("Mark All As Read")
|
||||
|
||||
Spacer()
|
||||
|
||||
Text("Last updated")
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
|
||||
Spacer()
|
||||
|
||||
Button(action: {
|
||||
}, label: {
|
||||
AppAssets.nextUnreadArticleImage
|
||||
.font(.title3)
|
||||
.foregroundColor(.accentColor)
|
||||
})
|
||||
.help("Next Unread")
|
||||
}
|
||||
.padding(.horizontal, 16)
|
||||
.padding(.bottom, 12)
|
||||
.padding(.top, 4)
|
||||
}
|
||||
.background(VisualEffectBlur(blurStyle: .systemChromeMaterial).edgesIgnoringSafeArea(.bottom))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct TimelineToolbar_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
TimelineToolbar()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user