Removed replacing of whitespaces with dashes in tab name
This commit is contained in:
parent
4d32df5717
commit
6fab65cf2c
1 changed files with 2 additions and 11 deletions
|
@ -100,7 +100,6 @@ fun RepositoriesTabPanel(
|
|||
Tab(
|
||||
title = tab.tabName,
|
||||
isSelected = currentTab == tab,
|
||||
isNewTab = tab.path == null,
|
||||
onClick = {
|
||||
onTabSelected(tab)
|
||||
},
|
||||
|
@ -147,7 +146,6 @@ fun RepositoriesTabPanel(
|
|||
fun Tab(
|
||||
title: MutableState<String>,
|
||||
isSelected: Boolean,
|
||||
isNewTab: Boolean,
|
||||
onClick: () -> Unit, onCloseTab: () -> Unit
|
||||
) {
|
||||
val backgroundColor = if (isSelected)
|
||||
|
@ -157,18 +155,11 @@ fun Tab(
|
|||
|
||||
val hoverInteraction = remember { MutableInteractionSource() }
|
||||
val isHovered by hoverInteraction.collectIsHoveredAsState()
|
||||
val tabTitle = if (isNewTab)
|
||||
title.value
|
||||
else
|
||||
title.value.replace(
|
||||
" ",
|
||||
"-"
|
||||
) // Long tab names with spaces make compose not taking full text width for the tab. More info https://issuetracker.google.com/issues/278044455
|
||||
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.widthIn(min = 200.dp)
|
||||
.width(IntrinsicSize.Min)
|
||||
.width(IntrinsicSize.Max)
|
||||
.fillMaxHeight()
|
||||
.hoverable(hoverInteraction)
|
||||
.handMouseClickable { onClick() }
|
||||
|
@ -181,7 +172,7 @@ fun Tab(
|
|||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
) {
|
||||
Text(
|
||||
text = tabTitle,
|
||||
text = title.value,
|
||||
modifier = Modifier
|
||||
.padding(start = 16.dp)
|
||||
.weight(1f)
|
||||
|
|
Loading…
Reference in a new issue