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,18 +636,15 @@ 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).
}
} else {
Button({ state.stopPlayback() }) { Button({ state.stopPlayback() }) {
Icon(Icons.Filled.Stop, contentDescription = null, Icon(Icons.Filled.Stop, contentDescription = null,
modifier = Modifier.size(18.dp)) modifier = Modifier.size(18.dp))
Spacer(Modifier.width(6.dp)) Spacer(Modifier.width(6.dp))
Text("Stop") Text("Stop")
} }
}
if (transport && ps.durationSec > 0) { if (transport && ps.durationSec > 0) {
val dur = ps.durationSec val dur = ps.durationSec
Slider( Slider(
@ -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,