Detail playback row: drop the redundant Pause/Resume pill and the duplicate Stop text button — one filled Stop button, always present while playing

This commit is contained in:
avi 2026-09-18 08:33:43 -05:00
commit bcb32e4f01

View file

@ -636,17 +636,14 @@ fun DetailScreen(state: DesktopState) {
Row(verticalAlignment = Alignment.CenterVertically, Row(verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(8.dp)) { horizontalArrangement = Arrangement.spacedBy(8.dp)) {
if (isPlaying) { if (isPlaying) {
if (transport) { // One Stop control, always present (the pause/resume pill
OutlinedButton({ state.setPaused(!ps.paused) }) { // was redundant: Stop already ends playback, and the
Text(if (ps.paused) "Resume" else "Pause") // separate Stop text button duplicated it).
} Button({ state.stopPlayback() }) {
} else { Icon(Icons.Filled.Stop, contentDescription = null,
Button({ state.stopPlayback() }) { modifier = Modifier.size(18.dp))
Icon(Icons.Filled.Stop, contentDescription = null, Spacer(Modifier.width(6.dp))
modifier = Modifier.size(18.dp)) Text("Stop")
Spacer(Modifier.width(6.dp))
Text("Stop")
}
} }
if (transport && ps.durationSec > 0) { if (transport && ps.durationSec > 0) {
val dur = ps.durationSec val dur = ps.durationSec
@ -663,7 +660,6 @@ fun DetailScreen(state: DesktopState) {
color = MaterialTheme.colorScheme.primary) color = MaterialTheme.colorScheme.primary)
Spacer(Modifier.weight(1f)) Spacer(Modifier.weight(1f))
} }
TextButton({ state.stopPlayback() }) { Text("Stop") }
} else { } else {
OutlinedButton({ state.playFrom(detail.file) }) { OutlinedButton({ state.playFrom(detail.file) }) {
Icon(Icons.Filled.PlayArrow, contentDescription = null, Icon(Icons.Filled.PlayArrow, contentDescription = null,