Reduced diff top bar size
This commit is contained in:
parent
6ddcd0c69d
commit
5c63d2eaf7
@ -787,9 +787,9 @@ private fun DiffHeader(
|
|||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.height(40.dp)
|
.height(34.dp)
|
||||||
.background(MaterialTheme.colors.tertiarySurface)
|
.background(MaterialTheme.colors.tertiarySurface)
|
||||||
.padding(start = 8.dp, end = 8.dp),
|
.padding(start = 16.dp, end = 8.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
val fileName = diffEntry.fileName
|
val fileName = diffEntry.fileName
|
||||||
@ -806,8 +806,7 @@ private fun DiffHeader(
|
|||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis,
|
||||||
fontWeight = FontWeight.Medium,
|
fontWeight = FontWeight.Medium,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f, false)
|
.weight(1f, false),
|
||||||
.padding(start = 16.dp),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
@ -830,8 +829,10 @@ private fun DiffHeader(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
Row(
|
||||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(16.dp)
|
||||||
|
) {
|
||||||
if (diffEntryType.statusType != StatusType.ADDED && diffEntryType.statusType != StatusType.REMOVED) {
|
if (diffEntryType.statusType != StatusType.ADDED && diffEntryType.statusType != StatusType.REMOVED) {
|
||||||
DiffTypeButtons(
|
DiffTypeButtons(
|
||||||
diffType = diffType,
|
diffType = diffType,
|
||||||
@ -840,7 +841,6 @@ private fun DiffHeader(
|
|||||||
onDisplayFullFile = onDisplayFullFile,
|
onDisplayFullFile = onDisplayFullFile,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (diffEntryType is DiffEntryType.UncommitedDiff) {
|
if (diffEntryType is DiffEntryType.UncommitedDiff) {
|
||||||
UncommitedDiffFileHeaderButtons(
|
UncommitedDiffFileHeaderButtons(
|
||||||
@ -855,10 +855,11 @@ private fun DiffHeader(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.handOnHover()
|
.handOnHover()
|
||||||
) {
|
) {
|
||||||
Image(
|
Icon(
|
||||||
painter = painterResource(AppIcons.CLOSE),
|
painter = painterResource(AppIcons.CLOSE),
|
||||||
contentDescription = "Close diff",
|
contentDescription = "Close diff",
|
||||||
colorFilter = ColorFilter.tint(MaterialTheme.colors.onBackground),
|
tint = MaterialTheme.colors.onBackground,
|
||||||
|
modifier = Modifier.size(24.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -882,7 +883,7 @@ fun StateIcon(
|
|||||||
else
|
else
|
||||||
this
|
this
|
||||||
}
|
}
|
||||||
.handMouseClickable { if(!isToggled) onClick() }
|
.handMouseClickable { if (!isToggled) onClick() }
|
||||||
.padding(4.dp)
|
.padding(4.dp)
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
@ -905,7 +906,6 @@ fun DiffTypeButtons(
|
|||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
modifier = Modifier.padding(horizontal = 16.dp)
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
@ -997,7 +997,6 @@ fun UncommitedDiffFileHeaderButtons(
|
|||||||
SecondaryButton(
|
SecondaryButton(
|
||||||
text = buttonText,
|
text = buttonText,
|
||||||
backgroundButton = color,
|
backgroundButton = color,
|
||||||
modifier = Modifier.padding(horizontal = 16.dp),
|
|
||||||
onClick = {
|
onClick = {
|
||||||
if (diffEntryType is DiffEntryType.StagedDiff) {
|
if (diffEntryType is DiffEntryType.StagedDiff) {
|
||||||
onUnstageFile(diffEntryType.statusEntry)
|
onUnstageFile(diffEntryType.statusEntry)
|
||||||
|
Loading…
Reference in New Issue
Block a user