mirror of
https://github.com/yattee/yattee.git
synced 2026-01-11 14:22:35 +00:00
Fix iOS menu text disappearing in navigation headers
Extended the ZStack overlay fix to all iOS navigation header menus where text labels would disappear when tapping the menu: - HomeView: "Home" title menu - PopularView: "Popular" title with icon menu - TrendingView: Country/flag title menu - PlaylistsView: Playlist title with thumbnail menu - ChannelPlaylistView: Playlist title with thumbnail menu - OpenVideosView: Playback mode picker menu All menus now use the same pattern as PlaybackSettings: - Visible static label layer in ZStack - Invisible Menu overlay with .opacity(0) - Prevents text disappearing and resizing animations
This commit is contained in:
@@ -109,22 +109,7 @@ struct ChannelPlaylistView: View {
|
|||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
private var playlistMenu: some View {
|
private var playlistMenu: some View {
|
||||||
Menu {
|
ZStack {
|
||||||
playButtons
|
|
||||||
|
|
||||||
favoriteButton
|
|
||||||
|
|
||||||
ListingStyleButtons(listingStyle: $channelPlaylistListingStyle)
|
|
||||||
|
|
||||||
Section {
|
|
||||||
HideWatchedButtons()
|
|
||||||
HideShortsButtons()
|
|
||||||
}
|
|
||||||
|
|
||||||
Section {
|
|
||||||
SettingsButtons()
|
|
||||||
}
|
|
||||||
} label: {
|
|
||||||
HStack(spacing: 12) {
|
HStack(spacing: 12) {
|
||||||
if let url = store.item?.thumbnailURL ?? playlist.thumbnailURL {
|
if let url = store.item?.thumbnailURL ?? playlist.thumbnailURL {
|
||||||
ThumbnailView(url: url)
|
ThumbnailView(url: url)
|
||||||
@@ -141,8 +126,43 @@ struct ChannelPlaylistView: View {
|
|||||||
.imageScale(.small)
|
.imageScale(.small)
|
||||||
}
|
}
|
||||||
.frame(maxWidth: 320)
|
.frame(maxWidth: 320)
|
||||||
.transaction { t in t.animation = nil }
|
|
||||||
|
Menu {
|
||||||
|
playButtons
|
||||||
|
|
||||||
|
favoriteButton
|
||||||
|
|
||||||
|
ListingStyleButtons(listingStyle: $channelPlaylistListingStyle)
|
||||||
|
|
||||||
|
Section {
|
||||||
|
HideWatchedButtons()
|
||||||
|
HideShortsButtons()
|
||||||
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
SettingsButtons()
|
||||||
|
}
|
||||||
|
} label: {
|
||||||
|
HStack(spacing: 12) {
|
||||||
|
if let url = store.item?.thumbnailURL ?? playlist.thumbnailURL {
|
||||||
|
ThumbnailView(url: url)
|
||||||
|
.frame(width: 60, height: 30)
|
||||||
|
.clipShape(RoundedRectangle(cornerRadius: 2))
|
||||||
|
}
|
||||||
|
|
||||||
|
Text(playlist.title)
|
||||||
|
.font(.headline)
|
||||||
|
.foregroundColor(.primary)
|
||||||
|
|
||||||
|
Image(systemName: "chevron.down.circle.fill")
|
||||||
|
.foregroundColor(.accentColor)
|
||||||
|
.imageScale(.small)
|
||||||
|
}
|
||||||
|
.frame(maxWidth: 320)
|
||||||
|
.opacity(0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
.transaction { t in t.animation = nil }
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -211,19 +211,7 @@ struct HomeView: View {
|
|||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
var homeMenu: some View {
|
var homeMenu: some View {
|
||||||
Menu {
|
ZStack {
|
||||||
Section {
|
|
||||||
HideWatchedButtons()
|
|
||||||
HideShortsButtons()
|
|
||||||
}
|
|
||||||
Section {
|
|
||||||
Button {
|
|
||||||
navigation.presentingHomeSettings = true
|
|
||||||
} label: {
|
|
||||||
Label("Home Settings", systemImage: "gear")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} label: {
|
|
||||||
HStack(spacing: 12) {
|
HStack(spacing: 12) {
|
||||||
Text("Home")
|
Text("Home")
|
||||||
.foregroundColor(.primary)
|
.foregroundColor(.primary)
|
||||||
@@ -233,8 +221,33 @@ struct HomeView: View {
|
|||||||
.foregroundColor(.accentColor)
|
.foregroundColor(.accentColor)
|
||||||
.imageScale(.small)
|
.imageScale(.small)
|
||||||
}
|
}
|
||||||
.transaction { t in t.animation = nil }
|
|
||||||
|
Menu {
|
||||||
|
Section {
|
||||||
|
HideWatchedButtons()
|
||||||
|
HideShortsButtons()
|
||||||
|
}
|
||||||
|
Section {
|
||||||
|
Button {
|
||||||
|
navigation.presentingHomeSettings = true
|
||||||
|
} label: {
|
||||||
|
Label("Home Settings", systemImage: "gear")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} label: {
|
||||||
|
HStack(spacing: 12) {
|
||||||
|
Text("Home")
|
||||||
|
.foregroundColor(.primary)
|
||||||
|
.font(.headline)
|
||||||
|
|
||||||
|
Image(systemName: "chevron.down.circle.fill")
|
||||||
|
.foregroundColor(.accentColor)
|
||||||
|
.imageScale(.small)
|
||||||
|
}
|
||||||
|
.opacity(0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
.transaction { t in t.animation = nil }
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -190,40 +190,7 @@ struct PlaylistsView: View {
|
|||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
var playlistsMenu: some View {
|
var playlistsMenu: some View {
|
||||||
let title = currentPlaylist?.title ?? "Playlists"
|
let title = currentPlaylist?.title ?? "Playlists"
|
||||||
return Menu {
|
return ZStack {
|
||||||
Menu {
|
|
||||||
selectPlaylistButton
|
|
||||||
} label: {
|
|
||||||
Label(title, systemImage: "list.and.film")
|
|
||||||
}
|
|
||||||
Section {
|
|
||||||
if let currentPlaylist {
|
|
||||||
playButtons
|
|
||||||
|
|
||||||
editPlaylistButton
|
|
||||||
|
|
||||||
if let account = accounts.current {
|
|
||||||
FavoriteButton(item: FavoriteItem(section: .playlist(account.id, currentPlaylist.id)))
|
|
||||||
.id(currentPlaylist.id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if accounts.signedIn {
|
|
||||||
newPlaylistButton
|
|
||||||
}
|
|
||||||
|
|
||||||
ListingStyleButtons(listingStyle: $playlistListingStyle)
|
|
||||||
|
|
||||||
Section {
|
|
||||||
HideWatchedButtons()
|
|
||||||
HideShortsButtons()
|
|
||||||
}
|
|
||||||
|
|
||||||
Section {
|
|
||||||
SettingsButtons()
|
|
||||||
}
|
|
||||||
} label: {
|
|
||||||
HStack(spacing: 12) {
|
HStack(spacing: 12) {
|
||||||
HStack(spacing: 6) {
|
HStack(spacing: 6) {
|
||||||
Image(systemName: "list.and.film")
|
Image(systemName: "list.and.film")
|
||||||
@@ -239,9 +206,61 @@ struct PlaylistsView: View {
|
|||||||
.imageScale(.small)
|
.imageScale(.small)
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
.frame(maxWidth: 320)
|
.frame(maxWidth: 320)
|
||||||
.transaction { t in t.animation = nil }
|
|
||||||
|
Menu {
|
||||||
|
Menu {
|
||||||
|
selectPlaylistButton
|
||||||
|
} label: {
|
||||||
|
Label(title, systemImage: "list.and.film")
|
||||||
|
}
|
||||||
|
Section {
|
||||||
|
if let currentPlaylist {
|
||||||
|
playButtons
|
||||||
|
|
||||||
|
editPlaylistButton
|
||||||
|
|
||||||
|
if let account = accounts.current {
|
||||||
|
FavoriteButton(item: FavoriteItem(section: .playlist(account.id, currentPlaylist.id)))
|
||||||
|
.id(currentPlaylist.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if accounts.signedIn {
|
||||||
|
newPlaylistButton
|
||||||
|
}
|
||||||
|
|
||||||
|
ListingStyleButtons(listingStyle: $playlistListingStyle)
|
||||||
|
|
||||||
|
Section {
|
||||||
|
HideWatchedButtons()
|
||||||
|
HideShortsButtons()
|
||||||
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
SettingsButtons()
|
||||||
|
}
|
||||||
|
} label: {
|
||||||
|
HStack(spacing: 12) {
|
||||||
|
HStack(spacing: 6) {
|
||||||
|
Image(systemName: "list.and.film")
|
||||||
|
|
||||||
|
Text(title)
|
||||||
|
.font(.headline)
|
||||||
|
}
|
||||||
|
.foregroundColor(.primary)
|
||||||
|
|
||||||
|
Image(systemName: "chevron.down.circle.fill")
|
||||||
|
.foregroundColor(.accentColor)
|
||||||
|
}
|
||||||
|
.imageScale(.small)
|
||||||
|
.lineLimit(1)
|
||||||
|
.frame(maxWidth: 320)
|
||||||
|
.opacity(0)
|
||||||
|
}
|
||||||
|
.disabled(!accounts.signedIn)
|
||||||
}
|
}
|
||||||
.disabled(!accounts.signedIn)
|
.transaction { t in t.animation = nil }
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -168,22 +168,7 @@ struct TrendingView: View {
|
|||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
var trendingMenu: some View {
|
var trendingMenu: some View {
|
||||||
Menu {
|
ZStack {
|
||||||
countryButton
|
|
||||||
|
|
||||||
categoryButton
|
|
||||||
|
|
||||||
ListingStyleButtons(listingStyle: $trendingListingStyle)
|
|
||||||
|
|
||||||
Section {
|
|
||||||
HideWatchedButtons()
|
|
||||||
HideShortsButtons()
|
|
||||||
}
|
|
||||||
|
|
||||||
Section {
|
|
||||||
SettingsButtons()
|
|
||||||
}
|
|
||||||
} label: {
|
|
||||||
HStack(spacing: 12) {
|
HStack(spacing: 12) {
|
||||||
Text("\(country.flag) \(country.name)")
|
Text("\(country.flag) \(country.name)")
|
||||||
.font(.headline)
|
.font(.headline)
|
||||||
@@ -194,6 +179,35 @@ struct TrendingView: View {
|
|||||||
.imageScale(.small)
|
.imageScale(.small)
|
||||||
}
|
}
|
||||||
.frame(maxWidth: 320)
|
.frame(maxWidth: 320)
|
||||||
|
|
||||||
|
Menu {
|
||||||
|
countryButton
|
||||||
|
|
||||||
|
categoryButton
|
||||||
|
|
||||||
|
ListingStyleButtons(listingStyle: $trendingListingStyle)
|
||||||
|
|
||||||
|
Section {
|
||||||
|
HideWatchedButtons()
|
||||||
|
HideShortsButtons()
|
||||||
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
SettingsButtons()
|
||||||
|
}
|
||||||
|
} label: {
|
||||||
|
HStack(spacing: 12) {
|
||||||
|
Text("\(country.flag) \(country.name)")
|
||||||
|
.font(.headline)
|
||||||
|
.foregroundColor(.primary)
|
||||||
|
|
||||||
|
Image(systemName: "chevron.down.circle.fill")
|
||||||
|
.foregroundColor(.accentColor)
|
||||||
|
.imageScale(.small)
|
||||||
|
}
|
||||||
|
.frame(maxWidth: 320)
|
||||||
|
.opacity(0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -144,10 +144,15 @@ struct OpenVideosView: View {
|
|||||||
Spacer()
|
Spacer()
|
||||||
#endif
|
#endif
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
Menu {
|
ZStack {
|
||||||
playbackModePicker
|
|
||||||
} label: {
|
|
||||||
Text(playbackMode.description)
|
Text(playbackMode.description)
|
||||||
|
|
||||||
|
Menu {
|
||||||
|
playbackModePicker
|
||||||
|
} label: {
|
||||||
|
Text(playbackMode.description)
|
||||||
|
.opacity(0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
playbackModePicker
|
playbackModePicker
|
||||||
|
|||||||
@@ -90,18 +90,7 @@ struct PopularView: View {
|
|||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
private var popularMenu: some View {
|
private var popularMenu: some View {
|
||||||
Menu {
|
ZStack {
|
||||||
ListingStyleButtons(listingStyle: $popularListingStyle)
|
|
||||||
|
|
||||||
Section {
|
|
||||||
HideWatchedButtons()
|
|
||||||
HideShortsButtons()
|
|
||||||
}
|
|
||||||
|
|
||||||
Section {
|
|
||||||
SettingsButtons()
|
|
||||||
}
|
|
||||||
} label: {
|
|
||||||
HStack(spacing: 12) {
|
HStack(spacing: 12) {
|
||||||
HStack(spacing: 6) {
|
HStack(spacing: 6) {
|
||||||
Image(systemName: "chart.bar.fill")
|
Image(systemName: "chart.bar.fill")
|
||||||
@@ -117,8 +106,38 @@ struct PopularView: View {
|
|||||||
.foregroundColor(.accentColor)
|
.foregroundColor(.accentColor)
|
||||||
.imageScale(.small)
|
.imageScale(.small)
|
||||||
}
|
}
|
||||||
.transaction { t in t.animation = nil }
|
|
||||||
|
Menu {
|
||||||
|
ListingStyleButtons(listingStyle: $popularListingStyle)
|
||||||
|
|
||||||
|
Section {
|
||||||
|
HideWatchedButtons()
|
||||||
|
HideShortsButtons()
|
||||||
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
SettingsButtons()
|
||||||
|
}
|
||||||
|
} label: {
|
||||||
|
HStack(spacing: 12) {
|
||||||
|
HStack(spacing: 6) {
|
||||||
|
Image(systemName: "chart.bar.fill")
|
||||||
|
.foregroundColor(.primary)
|
||||||
|
.imageScale(.small)
|
||||||
|
|
||||||
|
Text("Popular")
|
||||||
|
.font(.headline)
|
||||||
|
.foregroundColor(.primary)
|
||||||
|
}
|
||||||
|
|
||||||
|
Image(systemName: "chevron.down.circle.fill")
|
||||||
|
.foregroundColor(.accentColor)
|
||||||
|
.imageScale(.small)
|
||||||
|
}
|
||||||
|
.opacity(0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
.transaction { t in t.animation = nil }
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user