1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-14 14:20:32 +05:30

Change subscriptions view picker

This commit is contained in:
Arkadiusz Fal 2023-05-25 17:13:01 +02:00
parent 59f48c739a
commit 4d70c8a3c3

View File

@ -31,8 +31,17 @@ struct SubscriptionsView: View {
.navigationBarTitleDisplayMode(.inline) .navigationBarTitleDisplayMode(.inline)
.toolbar { .toolbar {
ToolbarItem(placement: .principal) { ToolbarItem(placement: .principal) {
HStack {
Picker("Page", selection: $subscriptionsViewPage) {
Label("Feed", systemImage: "film").tag(Page.feed)
Label("Channels", systemImage: "person.3.fill").tag(Page.channels)
}
.pickerStyle(.segmented)
subscriptionsMenu subscriptionsMenu
} }
.frame(maxWidth: 500)
}
ToolbarItem { ToolbarItem {
RequestErrorButton(error: requestError) RequestErrorButton(error: requestError)
@ -61,11 +70,6 @@ struct SubscriptionsView: View {
#if os(iOS) #if os(iOS)
var subscriptionsMenu: some View { var subscriptionsMenu: some View {
Menu { Menu {
Picker("Page", selection: $subscriptionsViewPage) {
Label("Feed", systemImage: "film").tag(Page.feed)
Label("Channels", systemImage: "person.3.fill").tag(Page.channels)
}
if subscriptionsViewPage == .feed { if subscriptionsViewPage == .feed {
ListingStyleButtons(listingStyle: $subscriptionsListingStyle) ListingStyleButtons(listingStyle: $subscriptionsListingStyle)
} }
@ -84,12 +88,9 @@ struct SubscriptionsView: View {
} }
} label: { } label: {
HStack(spacing: 12) { HStack(spacing: 12) {
menuLabel
.foregroundColor(.primary)
Image(systemName: "chevron.down.circle.fill") Image(systemName: "chevron.down.circle.fill")
.foregroundColor(.accentColor) .foregroundColor(.accentColor)
.imageScale(.small) .imageScale(.large)
} }
.transaction { t in t.animation = nil } .transaction { t in t.animation = nil }
} }