Background opaque for FABs

This commit is contained in:
Hasinjato 2026-10-05 10:11:18 +03:00
parent aaff6c0f98
commit 373eed0b0e

View file

@ -910,7 +910,8 @@ fun MainScreenWithDrawer(
refreshTrigeer++ refreshTrigeer++
sharedScreenModel.loadNewSong("$midiFile") sharedScreenModel.loadNewSong("$midiFile")
}, },
icon = if (isExpanded) Icons.Filled.Close else Icons.Filled.Menu icon = if (isExpanded) Icons.Filled.Close else Icons.Filled.Menu,
isOpaque = false
) )
} }
} }
@ -1340,18 +1341,19 @@ private fun getIntervalToC(key: String): Int {
private fun MyFAB( private fun MyFAB(
onClick: () -> Unit, onClick: () -> Unit,
size: Dp = 55.dp, size: Dp = 55.dp,
icon: ImageVector icon: ImageVector,
isOpaque: Boolean = true
) { ) {
FloatingActionButton( FloatingActionButton(
onClick = onClick, onClick = onClick,
modifier = Modifier.size(size!!), modifier = Modifier.size(size!!),
containerColor = MaterialTheme.colorScheme.onSecondary.copy(alpha = 0.1f), containerColor = MaterialTheme.colorScheme.onSecondary.copy(alpha = if(isOpaque) 0.95f else 0.2f),
elevation = FloatingActionButtonDefaults.elevation(0.dp, 0.dp, 0.dp, 0.dp) elevation = FloatingActionButtonDefaults.elevation(0.dp, 0.dp, 0.dp, 0.dp)
) { ) {
Icon( Icon(
imageVector = icon, imageVector = icon,
contentDescription = "FAB ${icon.name}", contentDescription = "FAB ${icon.name}",
tint = MaterialTheme.colorScheme.primary tint = MaterialTheme.colorScheme.primary.copy(alpha = 0.9f)
) )
} }
} }