mirror of
https://github.com/yattee/yattee.git
synced 2025-08-08 19:54:07 +00:00
Minor tvOS fixes
This commit is contained in:
@@ -13,7 +13,7 @@ struct AccountSelectionView: View {
|
||||
|
||||
var body: some View {
|
||||
Section(header: Text(showHeader ? "Current Account" : "")) {
|
||||
Button(accountButtonTitle(account: accountsModel.current)) {
|
||||
Button(accountButtonTitle(account: accountsModel.current, long: true)) {
|
||||
if let account = nextAccount {
|
||||
accountsModel.setCurrent(account)
|
||||
}
|
||||
@@ -40,11 +40,13 @@ struct AccountSelectionView: View {
|
||||
allAccounts.next(after: accountsModel.current)
|
||||
}
|
||||
|
||||
func accountButtonTitle(account: Account! = nil) -> String {
|
||||
func accountButtonTitle(account: Account! = nil, long: Bool = false) -> String {
|
||||
guard account != nil else {
|
||||
return "Not selected"
|
||||
}
|
||||
|
||||
return instances.count > 1 ? "\(account.description) — \(account.instance.shortDescription)" : account.description
|
||||
let instanceDescription = long ? account.instance.longDescription : account.instance.description
|
||||
|
||||
return instances.count > 1 ? "\(account.description) — \(instanceDescription)" : account.description
|
||||
}
|
||||
}
|
||||
|
@@ -1,12 +1,12 @@
|
||||
import SwiftUI
|
||||
|
||||
struct NowPlayingView: View {
|
||||
var infoViewController = false
|
||||
var inInfoViewController = false
|
||||
|
||||
@EnvironmentObject<PlayerModel> private var player
|
||||
|
||||
var body: some View {
|
||||
if infoViewController {
|
||||
if inInfoViewController {
|
||||
content
|
||||
.background(.thinMaterial)
|
||||
.mask(RoundedRectangle(cornerRadius: 24))
|
||||
@@ -18,7 +18,7 @@ struct NowPlayingView: View {
|
||||
var content: some View {
|
||||
ScrollView(.vertical) {
|
||||
VStack(alignment: .leading) {
|
||||
if !infoViewController, let item = player.currentItem {
|
||||
if !inInfoViewController, let item = player.currentItem {
|
||||
Group {
|
||||
header("Now Playing")
|
||||
|
||||
@@ -93,7 +93,7 @@ struct NowPlayingView: View {
|
||||
|
||||
func header(_ text: String) -> some View {
|
||||
Text(text)
|
||||
.font(.title3.bold())
|
||||
.font((inInfoViewController ? Font.system(size: 40) : .title3).bold())
|
||||
.foregroundColor(.secondary)
|
||||
.padding(.leading, 40)
|
||||
}
|
||||
@@ -103,5 +103,8 @@ struct NowPlayingView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
NowPlayingView()
|
||||
.injectFixtureEnvironmentObjects()
|
||||
|
||||
NowPlayingView(inInfoViewController: true)
|
||||
.injectFixtureEnvironmentObjects()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user