Fixed rebase interactive layout

This commit is contained in:
Abdelilah El Aissaoui 2022-10-24 17:57:46 +02:00
parent 5d7d1d6f8b
commit d934b83c4e
11 changed files with 35 additions and 24 deletions

View File

@ -7,6 +7,7 @@ import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.jetpackduba.gitnuro.theme.textButtonColors
@ -83,21 +84,18 @@ fun RebaseStateLoaded(
}
}
Row(modifier = Modifier.padding(bottom = 16.dp)) {
Spacer(modifier = Modifier.weight(1f))
TextButton(
modifier = Modifier.padding(end = 8.dp),
onClick = {
onCancel()
},
colors = textButtonColors(),
Row(
modifier = Modifier.padding(bottom = 16.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Text(
Spacer(modifier = Modifier.weight(1f))
PrimaryButton(
text = "Cancel",
color = MaterialTheme.colors.onBackground,
style = MaterialTheme.typography.body1,
modifier = Modifier.padding(end = 8.dp),
onClick = onCancel,
backgroundColor = Color.Transparent,
textColor = MaterialTheme.colors.onBackground,
)
}
PrimaryButton(
modifier = Modifier.padding(end = 16.dp),
enabled = stepsList.any { it.action != Action.PICK },
@ -130,6 +128,7 @@ fun RebaseCommit(
modifier = Modifier
.padding(horizontal = 16.dp, vertical = 8.dp)
.height(IntrinsicSize.Min)
.fillMaxWidth()
) {
ActionDropdown(
rebaseLine.action,

View File

@ -55,13 +55,15 @@ fun AdjustableOutlinedTextField(
val indicatorColor by colors.indicatorColor(enabled, isError, interactionSource)
Box(
modifier = Modifier
modifier = modifier
.height(IntrinsicSize.Min)
.background(Color.Red)
) {
BasicTextField(
modifier = modifier
modifier = Modifier
.heightIn(min = 40.dp)
.background(backgroundColor),
.background(backgroundColor)
.fillMaxWidth(),
value = value,
onValueChange = onValueChange,
enabled = enabled,

View File

@ -7,6 +7,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
@ -37,8 +38,9 @@ fun PrimaryButton(
onClick()
}
} else
handOnHover()
this
},
contentAlignment = Alignment.Center,
) {
Text(
text,

View File

@ -106,6 +106,7 @@ fun AuthorDialog(
modifier = Modifier.padding(end = 8.dp),
onClick = onClose,
backgroundColor = Color.Transparent,
textColor = MaterialTheme.colors.onBackground,
)
PrimaryButton(
onClick = {

View File

@ -207,7 +207,8 @@ private fun CloneInput(
next = urlFocusRequester
},
onClick = onClose,
backgroundColor = Color.Transparent
backgroundColor = Color.Transparent,
textColor = MaterialTheme.colors.onBackground,
)
PrimaryButton(
onClick = {

View File

@ -91,7 +91,8 @@ fun NewBranchDialog(
text = "Cancel",
modifier = Modifier.padding(end = 8.dp),
onClick = onClose,
backgroundColor = Color.Transparent
backgroundColor = Color.Transparent,
textColor = MaterialTheme.colors.onBackground,
)
PrimaryButton(
modifier = Modifier

View File

@ -91,7 +91,8 @@ fun NewTagDialog(
text = "Cancel",
modifier = Modifier.padding(end = 8.dp),
onClick = onReject,
backgroundColor = Color.Transparent
backgroundColor = Color.Transparent,
textColor = MaterialTheme.colors.onBackground,
)
PrimaryButton(
modifier = Modifier

View File

@ -97,7 +97,8 @@ fun PasswordDialog(
text = "Cancel",
modifier = Modifier.padding(end = 8.dp),
onClick = onReject,
backgroundColor = Color.Transparent
backgroundColor = Color.Transparent,
textColor = MaterialTheme.colors.onBackground,
)
PrimaryButton(
modifier = Modifier

View File

@ -96,7 +96,8 @@ fun ResetBranchDialog(
text = "Cancel",
modifier = Modifier.padding(end = 8.dp),
onClick = onReject,
backgroundColor = Color.Transparent
backgroundColor = Color.Transparent,
textColor = MaterialTheme.colors.onBackground,
)
PrimaryButton(
onClick = {

View File

@ -91,7 +91,8 @@ fun StashWithMessageDialog(
text = "Cancel",
modifier = Modifier.padding(end = 8.dp),
onClick = onClose,
backgroundColor = Color.Transparent
backgroundColor = Color.Transparent,
textColor = MaterialTheme.colors.onBackground,
)
PrimaryButton(
modifier = Modifier

View File

@ -122,7 +122,8 @@ fun UserPasswordDialog(
text = "Cancel",
modifier = Modifier.padding(end = 8.dp),
onClick = onReject,
backgroundColor = Color.Transparent
backgroundColor = Color.Transparent,
textColor = MaterialTheme.colors.onBackground,
)
PrimaryButton(
modifier = Modifier