mirror of
				https://github.com/yattee/yattee.git
				synced 2025-11-03 22:22:02 +00:00 
			
		
		
		
	Listing styles
This commit is contained in:
		@@ -6,6 +6,10 @@ struct FeedView: View {
 | 
			
		||||
    @ObservedObject private var feed = FeedModel.shared
 | 
			
		||||
    @ObservedObject private var accounts = AccountsModel.shared
 | 
			
		||||
 | 
			
		||||
    #if os(tvOS)
 | 
			
		||||
        @Default(.subscriptionsListingStyle) private var subscriptionsListingStyle
 | 
			
		||||
    #endif
 | 
			
		||||
 | 
			
		||||
    var videos: [ContentItem] {
 | 
			
		||||
        ContentItem.array(of: feed.videos)
 | 
			
		||||
    }
 | 
			
		||||
@@ -15,6 +19,7 @@ struct FeedView: View {
 | 
			
		||||
            HStack {
 | 
			
		||||
                #if os(tvOS)
 | 
			
		||||
                    SubscriptionsPageButton()
 | 
			
		||||
                    ListingStyleButtons(listingStyle: $subscriptionsListingStyle)
 | 
			
		||||
                #endif
 | 
			
		||||
 | 
			
		||||
                Spacer()
 | 
			
		||||
 
 | 
			
		||||
@@ -8,6 +8,7 @@ struct SubscriptionsView: View {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Default(.subscriptionsViewPage) private var subscriptionsViewPage
 | 
			
		||||
    @Default(.subscriptionsListingStyle) private var subscriptionsListingStyle
 | 
			
		||||
 | 
			
		||||
    var body: some View {
 | 
			
		||||
        SignInRequiredView(title: "Subscriptions".localized()) {
 | 
			
		||||
@@ -21,12 +22,20 @@ struct SubscriptionsView: View {
 | 
			
		||||
                #endif
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        .environment(\.listingStyle, subscriptionsListingStyle)
 | 
			
		||||
 | 
			
		||||
        #if os(iOS)
 | 
			
		||||
        .navigationBarTitleDisplayMode(.inline)
 | 
			
		||||
            .navigationBarTitleDisplayMode(.inline)
 | 
			
		||||
            .toolbar {
 | 
			
		||||
                ToolbarItem(placement: .principal) {
 | 
			
		||||
                    subscriptionsMenu
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        #endif
 | 
			
		||||
        #if os(macOS)
 | 
			
		||||
        .toolbar {
 | 
			
		||||
            ToolbarItem(placement: .principal) {
 | 
			
		||||
                subscriptionsMenu
 | 
			
		||||
            ToolbarItem {
 | 
			
		||||
                ListingStyleButtons(listingStyle: $subscriptionsListingStyle)
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        #endif
 | 
			
		||||
@@ -40,6 +49,10 @@ struct SubscriptionsView: View {
 | 
			
		||||
                    Label("Channels", systemImage: "person.3.fill").tag(Page.channels)
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                if subscriptionsViewPage == .feed {
 | 
			
		||||
                    ListingStyleButtons(listingStyle: $subscriptionsListingStyle)
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                Section {
 | 
			
		||||
                    SettingsButtons()
 | 
			
		||||
                }
 | 
			
		||||
@@ -59,6 +72,7 @@ struct SubscriptionsView: View {
 | 
			
		||||
        var menuLabel: some View {
 | 
			
		||||
            HStack {
 | 
			
		||||
                Image(systemName: subscriptionsViewPage == .channels ? "person.3.fill" : "film")
 | 
			
		||||
                    .imageScale(.small)
 | 
			
		||||
                Text(subscriptionsViewPage.rawValue.capitalized.localized())
 | 
			
		||||
                    .font(.headline)
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user