mirror of
https://github.com/yattee/yattee.git
synced 2026-04-10 01:26:57 +00:00
Fix ContentUnavailableView centering on Apple TV
On tvOS, ContentUnavailableView inside a Group doesn't expand to fill available space — it sizes to content and aligns top-leading. Add .frame(maxWidth: .infinity, maxHeight: .infinity) to all instances so they center correctly in their parent containers.
This commit is contained in:
@@ -47,6 +47,7 @@ struct ContributorsView: View {
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
} else {
|
||||
contributorsList
|
||||
}
|
||||
|
||||
@@ -138,6 +138,7 @@ struct ImportPlaylistsView: View {
|
||||
}
|
||||
.buttonStyle(.bordered)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.accessibilityIdentifier(AccessibilityID.errorMessage)
|
||||
}
|
||||
|
||||
@@ -147,6 +148,7 @@ struct ImportPlaylistsView: View {
|
||||
systemImage: "list.bullet.rectangle",
|
||||
description: Text(String(localized: "import.playlists.emptyDescription"))
|
||||
)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.accessibilityIdentifier(AccessibilityID.emptyState)
|
||||
}
|
||||
|
||||
|
||||
@@ -109,6 +109,7 @@ struct ImportSubscriptionsView: View {
|
||||
}
|
||||
.buttonStyle(.bordered)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.accessibilityIdentifier(AccessibilityID.errorMessage)
|
||||
}
|
||||
|
||||
@@ -118,6 +119,7 @@ struct ImportSubscriptionsView: View {
|
||||
systemImage: "person.2.slash",
|
||||
description: Text(String(localized: "import.subscriptions.emptyDescription"))
|
||||
)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.accessibilityIdentifier(AccessibilityID.emptyState)
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ struct LegacyDataImportView: View {
|
||||
systemImage: "doc.questionmark",
|
||||
description: Text(String(localized: "migration.noDataFoundDescription"))
|
||||
)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
} else {
|
||||
importContent
|
||||
}
|
||||
|
||||
@@ -109,6 +109,7 @@ struct LogViewerView: View {
|
||||
Text(String(localized: "settings.advanced.logs.disabled"))
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
} else {
|
||||
List(loggingService.filteredEntries) { entry in
|
||||
LogEntryRow(entry: entry)
|
||||
|
||||
@@ -81,6 +81,7 @@ struct NetworkShareDiscoverySheet: View {
|
||||
service.startDiscovery()
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
} else {
|
||||
// Group shares by type
|
||||
@@ -124,6 +125,7 @@ struct NetworkShareDiscoverySheet: View {
|
||||
} description: {
|
||||
Text(String(localized: "discovery.unavailable.description"))
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -182,6 +182,7 @@ struct ManageChannelNotificationsView: View {
|
||||
} description: {
|
||||
Text(errorMessage)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
} else if subscriptions.isEmpty {
|
||||
ContentUnavailableView {
|
||||
Label(
|
||||
@@ -191,6 +192,7 @@ struct ManageChannelNotificationsView: View {
|
||||
} description: {
|
||||
Text(String(localized: "settings.notifications.noSubscriptions.description"))
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
} else {
|
||||
ForEach(subscriptions, id: \.channelID) { subscription in
|
||||
ChannelNotificationToggle(subscription: subscription)
|
||||
|
||||
@@ -117,12 +117,14 @@ struct PeerTubeInstancesExploreView: View {
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
} else if displayedInstances.isEmpty {
|
||||
ContentUnavailableView {
|
||||
Label(String(localized: "peertube.explore.noResults"), systemImage: "magnifyingglass")
|
||||
} description: {
|
||||
Text(String(localized: "peertube.explore.noResults.description"))
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
} else {
|
||||
instancesList
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ struct ButtonConfigurationView: View {
|
||||
String(localized: "settings.playerControls.buttonNotFound"),
|
||||
systemImage: "exclamationmark.triangle"
|
||||
)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -283,6 +283,7 @@ struct MiniPlayerButtonConfigurationView: View {
|
||||
String(localized: "settings.playerControls.buttonNotFound"),
|
||||
systemImage: "exclamationmark.triangle"
|
||||
)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ struct PillButtonConfigurationView: View {
|
||||
String(localized: "settings.playerControls.buttonNotFound"),
|
||||
systemImage: "exclamationmark.triangle"
|
||||
)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@ struct SourcesListView: View {
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.accessibilityIdentifier("sources.view")
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ struct TranslationContributorsView: View {
|
||||
ContentUnavailableView {
|
||||
Label(String(localized: "settings.translators.empty"), systemImage: "globe")
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
} else {
|
||||
contributorsList
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user