Minor image fixes

This commit is contained in:
Arkadiusz Fal 2023-07-25 13:20:20 +02:00
parent 19d11a3ad9
commit 1980e8a10e
2 changed files with 12 additions and 3 deletions

View File

@ -10,6 +10,7 @@ struct ChannelAvatarView: View {
@ObservedObject private var subscribedChannels = SubscribedChannelsModel.shared
@State private var url: URL?
@State private var loaded = false
var body: some View {
ZStack(alignment: .bottomTrailing) {
@ -19,13 +20,20 @@ struct ChannelAvatarView: View {
ThumbnailView(url: url)
} else {
ZStack {
Color("PlaceholderColor")
if loaded {
Image(systemName: "person.circle")
.imageScale(.large)
.foregroundColor(.accentColor)
} else {
Color("PlaceholderColor")
}
if let video, video.isLocal {
Image(systemName: video.localStreamImageSystemName)
.foregroundColor(.accentColor)
.font(.system(size: 20))
.contentShape(Rectangle())
.imageScale(.small)
}
}
.onAppear(perform: updateURL)
@ -47,10 +55,10 @@ struct ChannelAvatarView: View {
#endif
.clipShape(Circle())
.foregroundColor(.secondary)
.imageScale(.small)
}
}
}
.imageScale(.small)
}
func updateURL() {
@ -60,6 +68,7 @@ struct ChannelAvatarView: View {
self.url = url
}
}
self.loaded = true
}
}
}

View File

@ -41,7 +41,7 @@ struct VideoDetails: View {
)
} else {
Circle()
.foregroundColor(Color(white: 0.6).opacity(0.5))
.foregroundColor(Color("PlaceholderColor"))
}
}
.frame(width: 40, height: 40)