Skip to content

Commit 0277592

Browse files
committed
Unify Sidebar view implementation across three views
Adds SidebarView that acts as basis for sidebars across all 3 primary views. Fixes a few bugs around playback controls in Grid view. Allows muting sound by clicking on speaker icon.
1 parent 8d4f5e7 commit 0277592

17 files changed

Lines changed: 1247 additions & 1111 deletions

Views/Components/SidebarView.swift

Lines changed: 492 additions & 0 deletions
Large diffs are not rendered by default.

Views/Components/TrackView.swift

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ private struct TrackListRow: View {
219219
.background(
220220
RoundedRectangle(cornerRadius: 6)
221221
.fill(backgroundColor)
222-
.animation(.easeInOut(duration: 0.1), value: isSelected)
222+
.animation(.easeInOut(duration: 0.15), value: isSelected)
223223
.animation(.easeInOut(duration: 0.1), value: isHovered)
224224
)
225225
.overlay(
@@ -249,9 +249,9 @@ private struct TrackListRow: View {
249249

250250
private var backgroundColor: Color {
251251
if isSelected {
252-
return Color.accentColor.opacity(0.1)
252+
return Color.accentColor.opacity(0.25)
253253
} else if isHovered {
254-
return Color.gray.opacity(0.05)
254+
return Color(NSColor.selectedContentBackgroundColor).opacity(0.15)
255255
} else {
256256
return Color.clear
257257
}
@@ -413,7 +413,15 @@ private struct TrackGridItem: View {
413413
.fill(Color.black.opacity(0.4))
414414
.frame(width: 160, height: 160)
415415
.overlay(
416-
Button(action: onPlay) {
416+
Button(action: {
417+
if isCurrentTrack {
418+
// Toggle play/pause for current track
419+
audioPlayerManager.togglePlayPause()
420+
} else {
421+
// Play this track
422+
onPlay()
423+
}
424+
}) {
417425
Image(systemName: isPlaying ? "pause.fill" : "play.fill")
418426
.font(.system(size: 24, weight: .medium))
419427
.foregroundColor(.white)
@@ -473,7 +481,7 @@ private struct TrackGridItem: View {
473481
.padding(8)
474482
.background(
475483
RoundedRectangle(cornerRadius: 10)
476-
.fill(isSelected ? Color.accentColor.opacity(0.1) : Color.clear)
484+
.fill(isSelected ? Color.accentColor.opacity(0.25) : Color.clear)
477485
)
478486
.overlay(
479487
RoundedRectangle(cornerRadius: 10)

Views/Folders/FolderListRow.swift

Lines changed: 0 additions & 48 deletions
This file was deleted.

Views/Folders/FolderTracksContainer.swift

Lines changed: 0 additions & 145 deletions
This file was deleted.

0 commit comments

Comments
 (0)