mirror of
https://github.com/yattee/yattee.git
synced 2025-01-06 12:57:11 +00:00
Home changes
This commit is contained in:
parent
50e1491990
commit
35867ba14a
@ -200,7 +200,12 @@ struct HomeView: View {
|
|||||||
.frame(minWidth: 360)
|
.frame(minWidth: 360)
|
||||||
#endif
|
#endif
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
.navigationBarTitleDisplayMode(RefreshControl.navigationBarTitleDisplayMode)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
|
.toolbar {
|
||||||
|
ToolbarItem(placement: .principal) {
|
||||||
|
homeMenu
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#if !os(macOS)
|
#if !os(macOS)
|
||||||
.onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in
|
.onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in
|
||||||
@ -220,16 +225,40 @@ struct HomeView: View {
|
|||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if os(iOS)
|
||||||
|
var homeMenu: some View {
|
||||||
|
Menu {
|
||||||
|
Section {
|
||||||
|
HideWatchedButtons()
|
||||||
|
HideShortsButtons()
|
||||||
|
}
|
||||||
|
} label: {
|
||||||
|
HStack(spacing: 12) {
|
||||||
|
Text("Home")
|
||||||
|
.foregroundColor(.primary)
|
||||||
|
.font(.headline)
|
||||||
|
|
||||||
|
Image(systemName: "chevron.down.circle.fill")
|
||||||
|
.foregroundColor(.accentColor)
|
||||||
|
.imageScale(.small)
|
||||||
|
}
|
||||||
|
.transaction { t in t.animation = nil }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Home_Previews: PreviewProvider {
|
struct Home_Previews: PreviewProvider {
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
TabView {
|
TabView {
|
||||||
HomeView()
|
NavigationView {
|
||||||
.injectFixtureEnvironmentObjects()
|
HomeView()
|
||||||
.tabItem {
|
.injectFixtureEnvironmentObjects()
|
||||||
Label("Home", systemImage: "house")
|
.tabItem {
|
||||||
}
|
Label("Home", systemImage: "house")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user