Skip to content

Commit

Permalink
fix: spacing between player controls
Browse files Browse the repository at this point in the history
  • Loading branch information
godly-devotion committed Mar 28, 2024
1 parent d462f93 commit 08912cc
Showing 1 changed file with 43 additions and 41 deletions.
84 changes: 43 additions & 41 deletions Front Row/Views/PlayerControlsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,52 +16,54 @@ struct PlayerControlsView: View {
var body: some View {
@Bindable var playEngine = playEngine

HStack(spacing: 16) {
// MARK: Backwards
Button {
Task { await PlayEngine.shared.goBackwards() }
} label: {
Image(systemName: "gobackward.5")
.resizable()
.scaledToFit()
.foregroundStyle(foregroundColor)
.frame(height: 20)
}
.buttonStyle(PlainButtonStyle())
.keyboardShortcut("J", modifiers: [])
.disabled(!playEngine.isLoaded)

// MARK: Pause/Play
Button {
PlayEngine.shared.playPause()
} label: {
Image(
systemName: playEngine.timeControlStatus == .playing
? "pause.fill"
: "play.fill"
)
.resizable()
.scaledToFit()
.foregroundStyle(foregroundColor)
.frame(width: 24, height: 24)
}
.buttonStyle(PlainButtonStyle())
.keyboardShortcut("K", modifiers: [])
.disabled(!playEngine.isLoaded)
HStack(spacing: 8) {
HStack(spacing: 16) {
// MARK: Backwards
Button {
Task { await PlayEngine.shared.goBackwards() }
} label: {
Image(systemName: "gobackward.5")
.resizable()
.scaledToFit()
.foregroundStyle(foregroundColor)
.frame(height: 20)
}
.buttonStyle(PlainButtonStyle())
.keyboardShortcut("J", modifiers: [])
.disabled(!playEngine.isLoaded)

// MARK: Forwards
Button {
Task { await PlayEngine.shared.goForwards() }
} label: {
Image(systemName: "goforward.5")
// MARK: Pause/Play
Button {
PlayEngine.shared.playPause()
} label: {
Image(
systemName: playEngine.timeControlStatus == .playing
? "pause.fill"
: "play.fill"
)
.resizable()
.scaledToFit()
.foregroundStyle(foregroundColor)
.frame(height: 20)
.frame(width: 24, height: 24)
}
.buttonStyle(PlainButtonStyle())
.keyboardShortcut("K", modifiers: [])
.disabled(!playEngine.isLoaded)

// MARK: Forwards
Button {
Task { await PlayEngine.shared.goForwards() }
} label: {
Image(systemName: "goforward.5")
.resizable()
.scaledToFit()
.foregroundStyle(foregroundColor)
.frame(height: 20)
}
.buttonStyle(PlainButtonStyle())
.keyboardShortcut("L", modifiers: [])
.disabled(!playEngine.isLoaded)
}
.buttonStyle(PlainButtonStyle())
.keyboardShortcut("L", modifiers: [])
.disabled(!playEngine.isLoaded)

// MARK: Current time
Text(verbatim: playEngine.currentTime.asTimecode(using: playEngine.duration))
Expand Down

0 comments on commit 08912cc

Please sign in to comment.