mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 04:04:07 +00:00
UI improvements
This commit is contained in:
@@ -11,6 +11,24 @@
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "display-p3",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0.263",
|
||||
"green" : "0.290",
|
||||
"red" : "0.859"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
@@ -10,24 +10,37 @@ struct FavoritesView: View {
|
||||
@State private var dragging: FavoriteItem?
|
||||
@State private var presentingEditFavorites = false
|
||||
|
||||
@State private var favoritesChanged = false
|
||||
|
||||
var favoritesObserver: Any?
|
||||
|
||||
#if !os(tvOS)
|
||||
@Default(.favorites) private var favorites
|
||||
#endif
|
||||
|
||||
var body: some View {
|
||||
PlayerControlsView {
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
if !accounts.current.isNil {
|
||||
ForEach(Defaults[.favorites]) { item in
|
||||
FavoriteItemView(item: item, dragging: $dragging)
|
||||
}
|
||||
|
||||
#if os(tvOS)
|
||||
Button {
|
||||
presentingEditFavorites = true
|
||||
} label: {
|
||||
Text("Edit Favorites...")
|
||||
ForEach(Defaults[.favorites]) { item in
|
||||
FavoriteItemView(item: item, dragging: $dragging)
|
||||
}
|
||||
#else
|
||||
ForEach(favorites) { item in
|
||||
FavoriteItemView(item: item, dragging: $dragging)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
.redrawOn(change: presentingEditFavorites)
|
||||
.onAppear {
|
||||
Defaults.observe(.favorites) { _ in
|
||||
favoritesChanged.toggle()
|
||||
}
|
||||
.tieToLifetime(of: accounts)
|
||||
}
|
||||
.redrawOn(change: favoritesChanged)
|
||||
|
||||
#if os(tvOS)
|
||||
.sheet(isPresented: $presentingEditFavorites) {
|
||||
EditFavorites()
|
||||
|
@@ -26,7 +26,7 @@ struct Sidebar: View {
|
||||
}
|
||||
.navigationTitle("Yattee")
|
||||
#if os(iOS)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -34,6 +34,14 @@ struct PlaybackBar: View {
|
||||
Image(systemName: "dot.radiowaves.left.and.right")
|
||||
} else if player.isLoadingAvailableStreams || player.isLoadingStream {
|
||||
Image(systemName: "bolt.horizontal.fill")
|
||||
} else if !player.playerError.isNil {
|
||||
Button {
|
||||
player.presentingErrorDetails = true
|
||||
} label: {
|
||||
Image(systemName: "exclamationmark.circle.fill")
|
||||
.foregroundColor(.red)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
|
||||
streamControl
|
||||
@@ -57,6 +65,9 @@ struct PlaybackBar: View {
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
.alert(player.playerError?.localizedDescription ?? "", isPresented: $player.presentingErrorDetails) {
|
||||
Button("OK") {}
|
||||
}
|
||||
.environment(\.colorScheme, .dark)
|
||||
.frame(minWidth: 0, maxWidth: .infinity)
|
||||
.padding(4)
|
||||
|
@@ -55,6 +55,12 @@ struct SettingsView: View {
|
||||
List {
|
||||
#if os(tvOS)
|
||||
AccountSelectionView()
|
||||
|
||||
Section(header: SettingsHeader(text: "Favorites")) {
|
||||
NavigationLink("Edit favorites...") {
|
||||
EditFavorites()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
InstancesSettings()
|
||||
BrowsingSettings()
|
||||
|
Reference in New Issue
Block a user