[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:
Joe Kribs 2025-04-19 15:07:05 -06:00 committed by GitHub
parent 8b58c52a87
commit a2e8076f98
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 30 deletions

View File

@ -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
)
}
}

View File

@ -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)