Skip to content

Commit

Permalink
Update volume slider
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmuslos committed Nov 24, 2024
1 parent 490fa8e commit a5084de
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"color-space" : "extended-srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.600",
"green" : "0.102",
"red" : "0.478"
"blue" : "0.765",
"green" : "0.361",
"red" : "0.667"
}
},
"idiom" : "universal"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 1 addition & 6 deletions Multiplatform/NowPlaying/Sliders/VolumeSlider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal extension NowPlaying {

var body: some View {
HStack {
Slider(percentage: $volume, dragging: $dragging)
Slider(percentage: .init() { volume } set: { AudioPlayer.current.volume = Float($0) }, dragging: $dragging)
}
.foregroundStyle(.thinMaterial)
.saturation(1.6)
Expand All @@ -26,11 +26,6 @@ internal extension NowPlaying {
volume = Double(AudioPlayer.current.volume)
}
}
.onChange(of: volume) {
if dragging {
AudioPlayer.current.volume = Float(volume)
}
}
}
}
}

0 comments on commit a5084de

Please # to comment.