Changed multiple elements colors
Button and log border
This commit is contained in:
parent
7a86ed8227
commit
82d9479e55
@ -10,6 +10,8 @@ val mainText = Color(0xFF212934)
|
||||
val mainTextDark = Color(0xFFFFFFFF)
|
||||
val secondaryText = Color(0xFF595858)
|
||||
val secondaryTextDark = Color(0xFFCCCBCB)
|
||||
val borderColorLight = Color(0xFF989898)
|
||||
val borderColorDark = Color(0xFF989898)
|
||||
val errorColor = Color(0xFFc93838)
|
||||
|
||||
val backgroundColorLight = Color(0xFFFFFFFF)
|
||||
|
@ -54,11 +54,11 @@ val Colors.secondaryTextColor: Color
|
||||
get() = if (isLight) secondaryText else secondaryTextDark
|
||||
|
||||
@get:Composable
|
||||
val Colors.semiSecondaryTextColor: Color
|
||||
val Colors.borderColor: Color
|
||||
get() = if (isLight)
|
||||
secondaryText.copy(alpha = 0.3f)
|
||||
borderColorLight
|
||||
else
|
||||
secondaryTextDark.copy(alpha = 0.3f)
|
||||
borderColorDark
|
||||
|
||||
@get:Composable
|
||||
val Colors.headerBackground: Color
|
||||
@ -112,6 +112,12 @@ val Colors.stageButton: Color
|
||||
val Colors.unstageButton: Color
|
||||
get() = error
|
||||
|
||||
val Colors.abortButton: Color
|
||||
get() = error
|
||||
|
||||
val Colors.confirmationButton: Color
|
||||
get() = if (isLight) primary else primaryDark
|
||||
|
||||
val Colors.scrollbarUnhover: Color
|
||||
get() = if (isLight) unhoverScrollbarColorLight else unhoverScrollbarColorDark
|
||||
|
||||
|
@ -7,6 +7,7 @@ import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import app.git.DiffEntryType
|
||||
import app.theme.borderColor
|
||||
import app.ui.dialogs.NewBranchDialog
|
||||
import app.ui.log.Log
|
||||
import app.viewmodels.TabViewModel
|
||||
@ -83,8 +84,8 @@ fun RepositoryOpenPage(tabViewModel: TabViewModel) {
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.border(
|
||||
width = 2.dp,
|
||||
color = MaterialTheme.colors.primary,
|
||||
width = 1.dp,
|
||||
color = MaterialTheme.colors.borderColor,
|
||||
)
|
||||
) {
|
||||
when (diffSelected) {
|
||||
|
@ -9,6 +9,7 @@ import androidx.compose.animation.fadeOut
|
||||
import androidx.compose.foundation.*
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.lazy.itemsIndexed
|
||||
import androidx.compose.foundation.shape.CornerSize
|
||||
import androidx.compose.material.*
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.ArrowDropDown
|
||||
@ -16,8 +17,10 @@ import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.ExperimentalComposeUiApi
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.RectangleShape
|
||||
import androidx.compose.ui.graphics.Shape
|
||||
import androidx.compose.ui.input.key.Key
|
||||
import androidx.compose.ui.input.key.isCtrlPressed
|
||||
import androidx.compose.ui.input.key.key
|
||||
@ -223,19 +226,28 @@ fun UncommitedChangesButtons(
|
||||
modifier = Modifier
|
||||
.padding(top = 2.dp)
|
||||
) {
|
||||
Button(
|
||||
ConfirmationButton(
|
||||
text = "Commit",
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.height(40.dp),
|
||||
onClick = { onCommit(false) },
|
||||
enabled = canCommit,
|
||||
shape = RectangleShape,
|
||||
) {
|
||||
Text(
|
||||
text = "Commit",
|
||||
fontSize = 14.sp,
|
||||
shape = MaterialTheme.shapes.small.copy(topEnd = CornerSize(0.dp), bottomEnd = CornerSize(0.dp))
|
||||
)
|
||||
}
|
||||
// Button(
|
||||
// modifier = Modifier
|
||||
// .weight(1f)
|
||||
// .height(40.dp),
|
||||
// onClick = { onCommit(false) },
|
||||
// enabled = canCommit,
|
||||
// shape = RectangleShape,
|
||||
// ) {
|
||||
// Text(
|
||||
// text = "Commit",
|
||||
// fontSize = 14.sp,
|
||||
// )
|
||||
// }
|
||||
Spacer(
|
||||
modifier = Modifier
|
||||
.width(1.dp)
|
||||
@ -245,13 +257,14 @@ fun UncommitedChangesButtons(
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.height(40.dp)
|
||||
.background(MaterialTheme.colors.primary)
|
||||
.clickable { showDropDownMenu = true },
|
||||
.clip(MaterialTheme.shapes.small.copy(topStart = CornerSize(0.dp), bottomStart = CornerSize(0.dp)))
|
||||
.background(MaterialTheme.colors.confirmationButton)
|
||||
.clickable { showDropDownMenu = true }
|
||||
) {
|
||||
Icon(
|
||||
Icons.Default.ArrowDropDown,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colors.inversePrimaryTextColor,
|
||||
tint = Color.White,
|
||||
modifier = Modifier
|
||||
.padding(horizontal = 8.dp)
|
||||
.align(Alignment.Center),
|
||||
@ -273,9 +286,7 @@ fun UncommitedChangesButtons(
|
||||
},
|
||||
expanded = showDropDownMenu,
|
||||
)
|
||||
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@ -295,20 +306,15 @@ fun MergeButtons(
|
||||
onClick = onAbort
|
||||
)
|
||||
|
||||
Button(
|
||||
onClick = onMerge,
|
||||
enabled = haveConflictsBeenSolved,
|
||||
ConfirmationButton(
|
||||
text = "Merge",
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.padding(start = 8.dp, end = 4.dp),
|
||||
) {
|
||||
Text(
|
||||
text = "Merge",
|
||||
fontSize = 14.sp,
|
||||
enabled = haveConflictsBeenSolved,
|
||||
onClick = onMerge,
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
@ -330,30 +336,22 @@ fun RebasingButtons(
|
||||
)
|
||||
|
||||
if (canContinue) {
|
||||
Button(
|
||||
onClick = onContinue,
|
||||
enabled = haveConflictsBeenSolved,
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.padding(start = 8.dp, end = 4.dp),
|
||||
) {
|
||||
Text(
|
||||
ConfirmationButton(
|
||||
text = "Continue",
|
||||
fontSize = 14.sp,
|
||||
)
|
||||
}
|
||||
} else {
|
||||
Button(
|
||||
onClick = onSkip,
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.padding(start = 8.dp, end = 4.dp),
|
||||
) {
|
||||
Text(
|
||||
text = "Skip",
|
||||
fontSize = 14.sp,
|
||||
enabled = haveConflictsBeenSolved,
|
||||
onClick = onContinue,
|
||||
)
|
||||
} else {
|
||||
ConfirmationButton(
|
||||
text = "Skip",
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.padding(start = 8.dp, end = 4.dp),
|
||||
onClick = onSkip,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -365,7 +363,7 @@ fun AbortButton(modifier: Modifier, onClick: () -> Unit) {
|
||||
onClick = onClick,
|
||||
modifier = modifier,
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
backgroundColor = MaterialTheme.colors.unstageButton,
|
||||
backgroundColor = MaterialTheme.colors.abortButton,
|
||||
contentColor = Color.White
|
||||
)
|
||||
) {
|
||||
@ -376,6 +374,32 @@ fun AbortButton(modifier: Modifier, onClick: () -> Unit) {
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun ConfirmationButton(
|
||||
text: String,
|
||||
modifier: Modifier,
|
||||
enabled: Boolean = true,
|
||||
shape: Shape = MaterialTheme.shapes.small,
|
||||
onClick: () -> Unit,
|
||||
) {
|
||||
Button(
|
||||
onClick = onClick,
|
||||
modifier = modifier,
|
||||
enabled = enabled,
|
||||
shape = shape,
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
backgroundColor = MaterialTheme.colors.confirmationButton,
|
||||
contentColor = Color.White
|
||||
)
|
||||
) {
|
||||
Text(
|
||||
text = text,
|
||||
fontSize = 14.sp,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// TODO: This logic should be part of the diffViewModel where it gets the latest version of the diffEntry
|
||||
fun checkIfSelectedEntryShouldBeUpdated(
|
||||
selectedEntryType: DiffEntryType,
|
||||
|
@ -19,7 +19,7 @@ import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.unit.dp
|
||||
import app.theme.primaryTextColor
|
||||
import app.theme.secondaryTextColor
|
||||
import app.theme.semiSecondaryTextColor
|
||||
import app.theme.borderColor
|
||||
import app.viewmodels.RemotesViewModel
|
||||
import org.eclipse.jgit.transport.RemoteConfig
|
||||
|
||||
@ -102,7 +102,7 @@ fun EditRemotesDialog(
|
||||
.border(
|
||||
width = 1.dp,
|
||||
shape = RoundedCornerShape(5.dp),
|
||||
color = MaterialTheme.colors.semiSecondaryTextColor,
|
||||
color = MaterialTheme.colors.borderColor,
|
||||
)
|
||||
.background(MaterialTheme.colors.surface)
|
||||
) {
|
||||
@ -190,7 +190,7 @@ fun EditRemotesDialog(
|
||||
modifier = Modifier
|
||||
.fillMaxHeight()
|
||||
.width(1.dp)
|
||||
.background(MaterialTheme.colors.semiSecondaryTextColor)
|
||||
.background(MaterialTheme.colors.borderColor)
|
||||
)
|
||||
|
||||
Column(
|
||||
|
Loading…
Reference in New Issue
Block a user