[iOS] Replace Gear Icon with User Icon Only (#1497)
* Resolves Gear showing through transparent user icons and defaults user icon to the user placeholder instead of the gear. Mirrors Jellyfin-Web's behavior. * wip --------- Co-authored-by: Ethan Pippin <ethanpippin2343@gmail.com>
This commit is contained in:
parent
8b58c52a87
commit
a2e8076f98
|
@ -327,9 +327,10 @@ extension View {
|
|||
|
||||
func topBarTrailing(@ViewBuilder content: @escaping () -> some View) -> some View {
|
||||
toolbar {
|
||||
ToolbarItemGroup(placement: .topBarTrailing) {
|
||||
content()
|
||||
}
|
||||
ToolbarItemGroup(
|
||||
placement: .topBarTrailing,
|
||||
content: content
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,28 +9,18 @@
|
|||
import Factory
|
||||
import SwiftUI
|
||||
|
||||
// Want the default navigation bar `Image(systemName:)` styling
|
||||
// but using within `ImageView.placeholder/failure` ruins it.
|
||||
// Need to do manual checking of image loading.
|
||||
struct SettingsBarButton: View {
|
||||
|
||||
@State
|
||||
private var isUserImage = false
|
||||
|
||||
let server: ServerState
|
||||
let user: UserState
|
||||
let action: () -> Void
|
||||
|
||||
var body: some View {
|
||||
Button {
|
||||
action()
|
||||
} label: {
|
||||
Button(action: action) {
|
||||
AlternateLayoutView {
|
||||
// Seems necessary for button layout
|
||||
Image(systemName: "gearshape.fill")
|
||||
.visible(!isUserImage)
|
||||
.overlay {
|
||||
ZStack {
|
||||
Color.clear
|
||||
|
||||
} content: {
|
||||
UserProfileImage(
|
||||
userID: user.id,
|
||||
source: user.profileImageSource(
|
||||
|
@ -38,10 +28,7 @@ struct SettingsBarButton: View {
|
|||
maxWidth: 120
|
||||
),
|
||||
pipeline: .Swiftfin.local
|
||||
) {
|
||||
Color.clear
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
.accessibilityLabel(L10n.settings)
|
||||
|
|
Loading…
Reference in New Issue