Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make artist play overlay clickable

Run play action asynchronously and capture errors into a new errorText
state. Use a borderless Button for the hover play control.

+20 -9
macos/Rockbox.xcodeproj/project.xcworkspace/xcuserdata/tsirysandratraina.xcuserdatad/UserInterfaceState.xcuserstate

This is a binary file and will not be displayed.

+20 -9
macos/Rockbox/Views/Artists/ArtistCardView.swift
··· 10 10 struct ArtistCardView: View { 11 11 let artist: Artist 12 12 @State private var isHovering = false 13 + @State private var errorText: String? = nil 13 14 14 15 var body: some View { 15 16 VStack(spacing: 8) { ··· 44 45 45 46 // Play button on hover 46 47 if isHovering { 47 - ZStack { 48 - Circle() 49 - .fill(.black.opacity(0.5)) 50 - .frame(width: 44, height: 44) 51 - 52 - Image(systemName: "play.fill") 53 - .font(.system(size: 18)) 54 - .foregroundStyle(.white) 55 - } 48 + Button(action: { 49 + Task { 50 + do { 51 + try await playArtistTracks(artistID: artist.cuid) 52 + } catch { 53 + errorText = String(describing: error) 54 + } 55 + } 56 + }) { 57 + ZStack { 58 + Circle() 59 + .fill(.black.opacity(0.5)) 60 + .frame(width: 44, height: 44) 61 + 62 + Image(systemName: "play.fill") 63 + .font(.system(size: 18)) 64 + .foregroundStyle(.white) 65 + } 66 + }.buttonStyle(.borderless) 56 67 } 57 68 } 58 69 .onHover { hovering in