mirror of
https://github.com/yattee/yattee.git
synced 2026-11-06 03:47:17 +00:00
Give the empty tvOS Accounts screen a focusable Open Sources button
With no accounts the screen showed only a ContentUnavailableView, so the focus engine had nothing to land on and the remote could not reach the sidebar again; the app had to be force-quit. Sources is also where an account is signed in.
This commit is contained in:
@@ -256,6 +256,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"accounts.empty.openSources" : {
|
||||||
|
"comment" : "tvOS button on the empty Accounts screen that opens the Sources list",
|
||||||
|
"localizations" : {
|
||||||
|
"en" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Open Sources"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"accounts.empty.title" : {
|
"accounts.empty.title" : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"en" : {
|
"en" : {
|
||||||
|
|||||||
@@ -158,6 +158,17 @@ struct AccountsListView: View {
|
|||||||
Label(String(localized: "accounts.empty.title"), systemImage: "person.crop.circle")
|
Label(String(localized: "accounts.empty.title"), systemImage: "person.crop.circle")
|
||||||
} description: {
|
} description: {
|
||||||
Text(String(localized: "accounts.empty.description"))
|
Text(String(localized: "accounts.empty.description"))
|
||||||
|
} actions: {
|
||||||
|
#if os(tvOS)
|
||||||
|
// Without a focusable element the focus engine has nowhere to
|
||||||
|
// land, and the remote can no longer reach the sidebar either.
|
||||||
|
// Sources is also where an account is actually signed in.
|
||||||
|
NavigationLink {
|
||||||
|
SourcesListView()
|
||||||
|
} label: {
|
||||||
|
Label(String(localized: "accounts.empty.openSources"), systemImage: "server.rack")
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user