From d8f1bcb8bfbd43fab7c7b956b1e5d7adb3307088 Mon Sep 17 00:00:00 2001 From: Abdelilah El Aissaoui Date: Sun, 28 Nov 2021 06:44:50 +0100 Subject: [PATCH] Changed current branch design in left branches panel --- src/main/kotlin/app/ui/Branches.kt | 10 ++++++++-- src/main/kotlin/app/ui/components/SideMenuSubentry.kt | 3 +++ src/main/resources/location.svg | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/location.svg diff --git a/src/main/kotlin/app/ui/Branches.kt b/src/main/kotlin/app/ui/Branches.kt index 097e3d0..025f7a5 100644 --- a/src/main/kotlin/app/ui/Branches.kt +++ b/src/main/kotlin/app/ui/Branches.kt @@ -62,10 +62,16 @@ private fun BranchRow( ) { SideMenuSubentry( text = branch.simpleName, - iconResourcePath = "branch.svg" + iconResourcePath = "branch.svg", + bold = isCurrentBranch, ) { if (isCurrentBranch) { - Text("***") + Icon( + painter = painterResource("location.svg"), + contentDescription = null, + modifier = Modifier.padding(horizontal = 4.dp), + tint = MaterialTheme.colors.primary, + ) } } } \ No newline at end of file diff --git a/src/main/kotlin/app/ui/components/SideMenuSubentry.kt b/src/main/kotlin/app/ui/components/SideMenuSubentry.kt index 6d50a44..5b66c44 100644 --- a/src/main/kotlin/app/ui/components/SideMenuSubentry.kt +++ b/src/main/kotlin/app/ui/components/SideMenuSubentry.kt @@ -12,6 +12,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.text.style.TextOverflow import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp @@ -21,6 +22,7 @@ import app.theme.primaryTextColor fun SideMenuSubentry( text: String, iconResourcePath: String, + bold: Boolean = false, additionalInfo: @Composable () -> Unit = {} ) { Row( @@ -44,6 +46,7 @@ fun SideMenuSubentry( modifier = Modifier.weight(1f, fill = true), maxLines = 1, fontSize = 14.sp, + fontWeight = if(bold) FontWeight.SemiBold else FontWeight.Normal, color = MaterialTheme.colors.primaryTextColor, overflow = TextOverflow.Ellipsis, ) diff --git a/src/main/resources/location.svg b/src/main/resources/location.svg new file mode 100644 index 0000000..c6413a3 --- /dev/null +++ b/src/main/resources/location.svg @@ -0,0 +1 @@ + \ No newline at end of file