[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 { func topBarTrailing(@ViewBuilder content: @escaping () -> some View) -> some View {
toolbar { toolbar {
ToolbarItemGroup(placement: .topBarTrailing) { ToolbarItemGroup(
content() placement: .topBarTrailing,
} content: content
)
} }
} }

View File

@ -9,40 +9,27 @@
import Factory import Factory
import SwiftUI 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 { struct SettingsBarButton: View {
@State
private var isUserImage = false
let server: ServerState let server: ServerState
let user: UserState let user: UserState
let action: () -> Void let action: () -> Void
var body: some View { var body: some View {
Button { Button(action: action) {
action() AlternateLayoutView {
} label: { // Seems necessary for button layout
Image(systemName: "gearshape.fill") Image(systemName: "gearshape.fill")
.visible(!isUserImage) } content: {
.overlay { UserProfileImage(
ZStack { userID: user.id,
Color.clear source: user.profileImageSource(
client: server.client,
UserProfileImage( maxWidth: 120
userID: user.id, ),
source: user.profileImageSource( pipeline: .Swiftfin.local
client: server.client, )
maxWidth: 120 }
),
pipeline: .Swiftfin.local
) {
Color.clear
}
}
}
} }
.accessibilityLabel(L10n.settings) .accessibilityLabel(L10n.settings)
} }