diff --git a/src/main/kotlin/app/theme/Theme.kt b/src/main/kotlin/app/theme/Theme.kt index a6761ec..99b3b54 100644 --- a/src/main/kotlin/app/theme/Theme.kt +++ b/src/main/kotlin/app/theme/Theme.kt @@ -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 diff --git a/src/main/kotlin/app/ui/Diff.kt b/src/main/kotlin/app/ui/Diff.kt index a9ba952..2ea3d25 100644 --- a/src/main/kotlin/app/ui/Diff.kt +++ b/src/main/kotlin/app/ui/Diff.kt @@ -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( diff --git a/src/main/kotlin/app/ui/UncommitedChanges.kt b/src/main/kotlin/app/ui/UncommitedChanges.kt index 3b20fd1..224d064 100644 --- a/src/main/kotlin/app/ui/UncommitedChanges.kt +++ b/src/main/kotlin/app/ui/UncommitedChanges.kt @@ -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, 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 ) } diff --git a/src/main/kotlin/app/ui/components/PrimaryButton.kt b/src/main/kotlin/app/ui/components/PrimaryButton.kt index 496ea3a..ba50700 100644 --- a/src/main/kotlin/app/ui/components/PrimaryButton.kt +++ b/src/main/kotlin/app/ui/components/PrimaryButton.kt @@ -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 + ) } } \ No newline at end of file diff --git a/src/main/kotlin/app/ui/components/SecondaryButton.kt b/src/main/kotlin/app/ui/components/SecondaryButton.kt index 615ebfb..8ffc71d 100644 --- a/src/main/kotlin/app/ui/components/SecondaryButton.kt +++ b/src/main/kotlin/app/ui/components/SecondaryButton.kt @@ -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,