From 64f825465de9fa30c4dfe2707067efdb96110db8 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Thu, 23 Oct 2025 21:59:37 -0700 Subject: Init --- .../liz/abstractionengine/ui/ArcadeButton.kt | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 composeApp/src/commonMain/kotlin/coffee/liz/abstractionengine/ui/ArcadeButton.kt (limited to 'composeApp/src/commonMain/kotlin/coffee/liz/abstractionengine/ui/ArcadeButton.kt') diff --git a/composeApp/src/commonMain/kotlin/coffee/liz/abstractionengine/ui/ArcadeButton.kt b/composeApp/src/commonMain/kotlin/coffee/liz/abstractionengine/ui/ArcadeButton.kt new file mode 100644 index 0000000..9d50192 --- /dev/null +++ b/composeApp/src/commonMain/kotlin/coffee/liz/abstractionengine/ui/ArcadeButton.kt @@ -0,0 +1,52 @@ +package coffee.liz.abstractionengine.ui + +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material3.Button +import androidx.compose.material3.ButtonDefaults +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp + +enum class ArcadeButtonColor { + RED, YELLOW +} + +@Composable +fun ArcadeButton( + label: String, + color: ArcadeButtonColor = ArcadeButtonColor.RED, + onClick: () -> Unit, + modifier: Modifier = Modifier +) { + val buttonColor = when (color) { + ArcadeButtonColor.RED -> GameBoyColors.ButtonRed + ArcadeButtonColor.YELLOW -> GameBoyColors.ButtonYellow + } + + Button( + onClick = onClick, + modifier = modifier + .size(65.dp) + .border(1.dp, MaterialTheme.colorScheme.outline, CircleShape), + shape = CircleShape, + colors = ButtonDefaults.buttonColors( + containerColor = buttonColor, + contentColor = MaterialTheme.colorScheme.onPrimary + ), + contentPadding = PaddingValues(0.dp) + ) { + Text( + text = label, + fontSize = 20.sp, + fontWeight = FontWeight.Bold, + color = MaterialTheme.colorScheme.onPrimary + ) + } +} -- cgit v1.2.3-70-g09d2