Fixed color scheme for light theme

This commit is contained in:
Abdelilah El Aissaoui 2022-08-07 17:24:13 +02:00
parent 4de4c5f76a
commit 975b0730d9
5 changed files with 19 additions and 15 deletions

View File

@ -77,12 +77,6 @@ val Colors.conflictFile: Color
val Colors.headerText: Color
get() = appTheme.onHeader
val Colors.stageButton: Color
get() = appTheme.primary
val Colors.unstageButton: Color
get() = appTheme.error
val Colors.abortButton: Color
get() = appTheme.error

View File

@ -302,16 +302,17 @@ fun HunkHeader(
val color: Color
if (diffEntryType is DiffEntryType.StagedDiff) {
buttonText = "Unstage hunk"
color = MaterialTheme.colors.unstageButton
color = MaterialTheme.colors.error
} else {
buttonText = "Stage hunk"
color = MaterialTheme.colors.stageButton
color = MaterialTheme.colors.primary
}
if (diffEntryType is DiffEntryType.UnstagedDiff) {
SecondaryButton(
text = "Discard hunk",
backgroundButton = MaterialTheme.colors.error,
textColor = MaterialTheme.colors.onError,
onClick = onResetHunk
)
}
@ -367,10 +368,10 @@ fun DiffHeader(
if (diffEntryType is DiffEntryType.StagedDiff) {
buttonText = "Unstage file"
color = MaterialTheme.colors.unstageButton
color = MaterialTheme.colors.error
} else {
buttonText = "Stage file"
color = MaterialTheme.colors.stageButton
color = MaterialTheme.colors.primary
}
SecondaryButton(

View File

@ -111,7 +111,8 @@ fun UncommitedChanges(
allActionTitle = "Unstage all",
actionTitle = "Unstage",
selectedEntryType = if (selectedEntryType is DiffEntryType.StagedDiff) selectedEntryType else null,
actionColor = MaterialTheme.colors.unstageButton,
actionColor = MaterialTheme.colors.error,
actionTextColor = MaterialTheme.colors.onError,
statusEntries = staged,
lazyListState = stagedListState,
onDiffEntrySelected = onStagedDiffEntrySelected,
@ -140,7 +141,8 @@ fun UncommitedChanges(
title = "Unstaged",
actionTitle = "Stage",
selectedEntryType = if (selectedEntryType is DiffEntryType.UnstagedDiff) selectedEntryType else null,
actionColor = MaterialTheme.colors.stageButton,
actionColor = MaterialTheme.colors.primary,
actionTextColor = MaterialTheme.colors.onPrimary,
statusEntries = unstaged,
lazyListState = unstagedListState,
onDiffEntrySelected = onUnstagedDiffEntrySelected,
@ -481,13 +483,14 @@ fun ConfirmationButton(
}
}
@OptIn(ExperimentalAnimationApi::class, ExperimentalFoundationApi::class)
@OptIn(ExperimentalFoundationApi::class)
@Composable
private fun EntriesList(
modifier: Modifier,
title: String,
actionTitle: String,
actionColor: Color,
actionTextColor: Color,
statusEntries: List<StatusEntry>,
lazyListState: LazyListState,
onDiffEntrySelected: (StatusEntry) -> Unit,
@ -518,6 +521,7 @@ private fun EntriesList(
modifier = Modifier.align(Alignment.CenterEnd),
text = allActionTitle,
backgroundButton = actionColor,
textColor = actionTextColor,
onClick = onAllAction
)
}

View File

@ -7,6 +7,7 @@ import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import app.theme.primaryTextColor
@Composable
fun PrimaryButton(
@ -14,6 +15,7 @@ fun PrimaryButton(
text: String,
enabled: Boolean = true,
textColor: Color = MaterialTheme.colors.onPrimary,
disabledTextColor: Color = MaterialTheme.colors.primaryTextColor,
onClick: () -> Unit,
) {
Button(
@ -25,6 +27,9 @@ fun PrimaryButton(
contentColor = textColor
),
) {
Text(text)
Text(
text,
color = if(enabled) textColor else disabledTextColor
)
}
}

View File

@ -17,7 +17,7 @@ import app.extensions.handMouseClickable
fun SecondaryButton(
modifier: Modifier = Modifier,
text: String,
textColor: Color = Color.White,
textColor: Color = MaterialTheme.colors.onPrimary,
backgroundButton: Color,
maxLines: Int = 1,
onClick: () -> Unit,