mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Settings for new features
This commit is contained in:
@@ -27,6 +27,7 @@ struct HomeView: View {
|
||||
@Default(.homeHistoryItems) private var homeHistoryItems
|
||||
@Default(.showFavoritesInHome) private var showFavoritesInHome
|
||||
@Default(.showOpenActionsInHome) private var showOpenActionsInHome
|
||||
@Default(.showQueueInHome) private var showQueueInHome
|
||||
|
||||
private var navigation: NavigationModel { .shared }
|
||||
|
||||
@@ -69,13 +70,14 @@ struct HomeView: View {
|
||||
.padding(.horizontal, 15)
|
||||
#endif
|
||||
|
||||
QueueView()
|
||||
.padding(.vertical, 15)
|
||||
#if os(tvOS)
|
||||
.padding(.horizontal, 40)
|
||||
#else
|
||||
.padding(.horizontal, 15)
|
||||
#endif
|
||||
if showQueueInHome {
|
||||
QueueView()
|
||||
#if os(tvOS)
|
||||
.padding(.horizontal, 40)
|
||||
#else
|
||||
.padding(.horizontal, 15)
|
||||
#endif
|
||||
}
|
||||
|
||||
if !accounts.current.isNil, showFavoritesInHome {
|
||||
#if os(tvOS)
|
||||
|
@@ -8,21 +8,24 @@ struct QueueView: View {
|
||||
var body: some View {
|
||||
LazyVStack {
|
||||
if !items.isEmpty {
|
||||
HStack {
|
||||
sectionLabel("Next in queue")
|
||||
Button {
|
||||
withAnimation {
|
||||
expanded.toggle()
|
||||
}
|
||||
} label: {
|
||||
Button {
|
||||
withAnimation {
|
||||
expanded.toggle()
|
||||
}
|
||||
} label: {
|
||||
HStack {
|
||||
sectionLabel(label)
|
||||
Spacer()
|
||||
Label("Show more", systemImage: expanded ? "chevron.up" : "chevron.down")
|
||||
.animation(nil, value: expanded)
|
||||
.foregroundColor(.accentColor)
|
||||
.imageScale(.large)
|
||||
.labelStyle(.iconOnly)
|
||||
.opacity(items.count > 1 ? 1 : 0)
|
||||
}
|
||||
.opacity(items.count > 1 ? 1 : 0)
|
||||
}
|
||||
.disabled(items.count < 2)
|
||||
|
||||
ForEach(limitedItems) { item in
|
||||
ContentItemView(item: .init(video: item.video))
|
||||
.environment(\.listingStyle, .list)
|
||||
@@ -32,6 +35,15 @@ struct QueueView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(.vertical, items.isEmpty ? 0 : 15)
|
||||
}
|
||||
|
||||
var label: String {
|
||||
if items.count < 2 {
|
||||
return "Next in Queue"
|
||||
}
|
||||
|
||||
return "Next in Queue (\(items.count))"
|
||||
}
|
||||
|
||||
var limitedItems: [PlayerQueueItem] {
|
||||
|
Reference in New Issue
Block a user