Skip to content

Commit

Permalink
Minor player UI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lbrndnr committed Jul 18, 2023
1 parent 422c5f8 commit e77a2f2
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions Nuage/Views/PlayerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ struct PlayerView: View {
resizableImage(name: "speaker.wave.2.fill")
}
.buttonStyle(.borderless)
.if(showingVolumeControls) { $0.foregroundColor(.accentColor) }
.if(showingVolumeControls) { $0.foregroundColor(.primary) }
.popover(isPresented: $showingVolumeControls, content: volumeControls)

Button(action: { self.showingQueue.toggle() }) {
resizableImage(name: "text.line.first.and.arrowtriangle.forward")
}
.buttonStyle(.borderless)
.if(showingQueue) { $0.foregroundColor(.accentColor) }
.if(showingQueue) { $0.foregroundColor(.primary) }
.popover(isPresented: $showingQueue, content: queue)
}
}
Expand All @@ -136,7 +136,7 @@ struct PlayerView: View {
Button(action: {
player.volume = 0
}, label: {
resizableImage(name: "speaker.fill")
resizableImage(name: "speaker.fill", height: 13, width: nil)
})
.focusable(false)
.buttonStyle(.borderless)
Expand All @@ -147,7 +147,7 @@ struct PlayerView: View {
Button(action: {
player.volume = 1
}, label: {
resizableImage(name: "speaker.wave.3.fill")
resizableImage(name: "speaker.wave.3.fill", height: 13, width: nil)
})
.focusable(false)
.buttonStyle(.borderless)
Expand Down Expand Up @@ -203,17 +203,13 @@ struct PlayerView: View {
}
}

@ViewBuilder private func resizableImage(name: String) -> some View {
@ViewBuilder private func resizableImage(name: String, height: CGFloat? = 15, width: CGFloat? = 15) -> some View {
Image(systemName: name)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 15, height: 15)
.frame(width: width, height: height)
}

private var backgroundColor: Color { colorScheme == .light ? .white : Color(hex: 0x1A1A1A) }

private var controlColor: Color { colorScheme == .light ? Color(hex: 0xBFBFBF) : Color(hex: 0x5B5B5B) }

}

struct PlayerView_Previews: PreviewProvider {
Expand Down

0 comments on commit e77a2f2

Please sign in to comment.