Detail page: Play and Delete match library Delete-1 style — red-outline ghost buttons with white ink (ShonarDangerButton gains ink param; solid-filled variant removed)
This commit is contained in:
parent
d0de0cc405
commit
7cc3737f92
2 changed files with 9 additions and 30 deletions
|
|
@ -165,12 +165,15 @@ fun ShonarGhostButton(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Destructive action: quiet red outline — visible without shouting. */
|
/** Destructive action: quiet red outline — visible without shouting.
|
||||||
|
* ink overrides the label/icon color (detail-page Play/Delete use
|
||||||
|
* TextPrimary = white-on-dark per user directive, Sep 21). */
|
||||||
@Composable
|
@Composable
|
||||||
fun ShonarDangerButton(
|
fun ShonarDangerButton(
|
||||||
onClick: () -> Unit,
|
onClick: () -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
enabled: Boolean = true,
|
enabled: Boolean = true,
|
||||||
|
ink: Color = Shonar.Error,
|
||||||
content: @Composable RowScope.() -> Unit,
|
content: @Composable RowScope.() -> Unit,
|
||||||
) {
|
) {
|
||||||
OutlinedButton(
|
OutlinedButton(
|
||||||
|
|
@ -180,33 +183,7 @@ fun ShonarDangerButton(
|
||||||
shape = Shonar.ShapeButton,
|
shape = Shonar.ShapeButton,
|
||||||
border = BorderStroke(1.dp, Shonar.Error.copy(alpha = 0.5f)),
|
border = BorderStroke(1.dp, Shonar.Error.copy(alpha = 0.5f)),
|
||||||
colors = ButtonDefaults.outlinedButtonColors(
|
colors = ButtonDefaults.outlinedButtonColors(
|
||||||
contentColor = Shonar.Error,
|
contentColor = ink,
|
||||||
disabledContentColor = Shonar.TextMuted,
|
|
||||||
),
|
|
||||||
content = content,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Solid destructive fill: one red, no transparency, black ink.
|
|
||||||
* Used for Play + Delete on the recording detail page (user directive:
|
|
||||||
* same solid red as the delete button, black text). */
|
|
||||||
@Composable
|
|
||||||
fun ShonarDangerFilledButton(
|
|
||||||
onClick: () -> Unit,
|
|
||||||
modifier: Modifier = Modifier,
|
|
||||||
enabled: Boolean = true,
|
|
||||||
content: @Composable RowScope.() -> Unit,
|
|
||||||
) {
|
|
||||||
Button(
|
|
||||||
onClick = onClick,
|
|
||||||
modifier = modifier.height(Shonar.ControlH).shonarFocus(Shonar.ShapeButton),
|
|
||||||
enabled = enabled,
|
|
||||||
shape = Shonar.ShapeButton,
|
|
||||||
elevation = null,
|
|
||||||
colors = ButtonDefaults.buttonColors(
|
|
||||||
containerColor = Shonar.Error,
|
|
||||||
contentColor = Color.Black,
|
|
||||||
disabledContainerColor = Shonar.SurfaceAlt,
|
|
||||||
disabledContentColor = Shonar.TextMuted,
|
disabledContentColor = Shonar.TextMuted,
|
||||||
),
|
),
|
||||||
content = content,
|
content = content,
|
||||||
|
|
|
||||||
|
|
@ -719,9 +719,10 @@ fun DetailScreen(state: DesktopState) {
|
||||||
?.let(state::openDetail) },
|
?.let(state::openDetail) },
|
||||||
enabled = state.neighborOf(detail.file, forward = true) != null,
|
enabled = state.neighborOf(detail.file, forward = true) != null,
|
||||||
) { Text("Next →") }
|
) { Text("Next →") }
|
||||||
ShonarDangerFilledButton(
|
ShonarDangerButton(
|
||||||
{ confirmDelete = true },
|
{ confirmDelete = true },
|
||||||
enabled = detail.busy == null,
|
enabled = detail.busy == null,
|
||||||
|
ink = Shonar.TextPrimary,
|
||||||
) {
|
) {
|
||||||
Text("Delete")
|
Text("Delete")
|
||||||
}
|
}
|
||||||
|
|
@ -762,7 +763,8 @@ fun DetailScreen(state: DesktopState) {
|
||||||
Spacer(Modifier.weight(1f))
|
Spacer(Modifier.weight(1f))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ShonarDangerFilledButton({ state.playFrom(detail.file) }) {
|
ShonarDangerButton({ state.playFrom(detail.file) },
|
||||||
|
ink = Shonar.TextPrimary) {
|
||||||
Icon(Icons.Filled.PlayArrow, contentDescription = null,
|
Icon(Icons.Filled.PlayArrow, contentDescription = null,
|
||||||
modifier = Modifier.size(Shonar.IconSm))
|
modifier = Modifier.size(Shonar.IconSm))
|
||||||
Spacer(Modifier.width(Shonar.Space2))
|
Spacer(Modifier.width(Shonar.Space2))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue