Selected branch is now shown as bold in the side panel

This commit is contained in:
Abdelilah El Aissaoui 2024-01-24 20:36:26 +01:00
parent 1c5b810f00
commit d9bd6fc905
No known key found for this signature in database
GPG Key ID: 7587FC860F594869
2 changed files with 4 additions and 0 deletions

View File

@ -437,6 +437,7 @@ private fun Branch(
) {
SideMenuSubentry(
text = branch.simpleName,
fontWeight = if (isCurrentBranch) FontWeight.Bold else FontWeight.Normal,
iconResourcePath = AppIcons.BRANCH,
isSelected = isSelectedItem,
onClick = onBranchClicked,

View File

@ -13,6 +13,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.jetpackduba.gitnuro.extensions.backgroundIf
@ -26,6 +27,7 @@ const val ENTRY_HEIGHT = 36
@Composable
fun SideMenuSubentry(
text: String,
fontWeight: FontWeight = FontWeight.Normal,
iconResourcePath: String,
isSelected: Boolean,
extraPadding: Dp = 0.dp,
@ -59,6 +61,7 @@ fun SideMenuSubentry(
Text(
text = text,
fontWeight = fontWeight,
modifier = Modifier.weight(1f, fill = true),
maxLines = 1,
style = MaterialTheme.typography.body2,