diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/theme/Theme.kt b/src/main/kotlin/com/jetpackduba/gitnuro/theme/Theme.kt index 1194ce5..be4da0e 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/theme/Theme.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/theme/Theme.kt @@ -25,11 +25,11 @@ fun AppTheme( } appTheme = theme - + val composeColors = theme.toComposeColors() MaterialTheme( - colors = theme.toComposeColors(), + colors = composeColors, content = content, - typography = typography(), + typography = typography(composeColors), ) } diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/theme/Typography.kt b/src/main/kotlin/com/jetpackduba/gitnuro/theme/Typography.kt index ced874f..a876bdb 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/theme/Typography.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/theme/Typography.kt @@ -1,5 +1,6 @@ package com.jetpackduba.gitnuro.theme +import androidx.compose.material.Colors import androidx.compose.material.MaterialTheme import androidx.compose.material.Typography import androidx.compose.runtime.Composable @@ -25,42 +26,42 @@ val openSansFontFamily = FontFamily( const val LETTER_SPACING = 0.5 @Composable -fun typography() = Typography( +fun typography(composeColors: Colors) = Typography( defaultFontFamily = openSansFontFamily, h1 = TextStyle( fontSize = 32.sp, - color = MaterialTheme.colors.onBackground, + color = composeColors.onBackground, letterSpacing = LETTER_SPACING.sp, ), h2 = TextStyle( fontSize = 24.sp, - color = MaterialTheme.colors.onBackground, + color = composeColors.onBackground, letterSpacing = LETTER_SPACING.sp, ), h3 = TextStyle( fontSize = 20.sp, - color = MaterialTheme.colors.onBackground, + color = composeColors.onBackground, letterSpacing = LETTER_SPACING.sp, ), h4 = TextStyle( fontSize = 17.sp, - color = MaterialTheme.colors.onBackground, + color = composeColors.onBackground, letterSpacing = LETTER_SPACING.sp, ), body1 = TextStyle( fontSize = 15.sp, - color = MaterialTheme.colors.onBackground, + color = composeColors.onBackground, letterSpacing = LETTER_SPACING.sp, ), body2 = TextStyle( fontSize = 13.sp, - color = MaterialTheme.colors.onBackground, + color = composeColors.onBackground, fontWeight = FontWeight.Normal, letterSpacing = LETTER_SPACING.sp, ), caption = TextStyle( fontSize = 11.sp, - color = MaterialTheme.colors.onBackground, + color = composeColors.onBackground, letterSpacing = LETTER_SPACING.sp, ) ) \ No newline at end of file diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/RebaseInteractive.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/RebaseInteractive.kt index a1130f8..9535406 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/RebaseInteractive.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/RebaseInteractive.kt @@ -91,7 +91,11 @@ fun RebaseStateLoaded( }, colors = textButtonColors(), ) { - Text("Cancel") + Text( + text = "Cancel", + color = MaterialTheme.colors.onBackground, + style = MaterialTheme.typography.body1, + ) } PrimaryButton( modifier = Modifier.padding(end = 16.dp), diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/AuthorDialog.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/AuthorDialog.kt index 2ff9312..01af340 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/AuthorDialog.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/AuthorDialog.kt @@ -110,7 +110,11 @@ fun AuthorDialog( onClose() } ) { - Text("Cancel") + Text( + text = "Cancel", + color = MaterialTheme.colors.onBackground, + style = MaterialTheme.typography.body1, + ) } PrimaryButton( onClick = { diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/CloneDialog.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/CloneDialog.kt index 75fe708..13f2d6b 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/CloneDialog.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/CloneDialog.kt @@ -209,7 +209,11 @@ private fun CloneInput( onClose() } ) { - Text("Cancel") + Text( + text = "Cancel", + color = MaterialTheme.colors.onBackground, + style = MaterialTheme.typography.body1, + ) } PrimaryButton( onClick = { @@ -275,7 +279,11 @@ private fun Cloning(cloneViewModel: CloneViewModel, cloneStatusValue: CloneStatu cloneViewModel.cancelClone() } ) { - Text("Cancel") + Text( + text = "Cancel", + color = MaterialTheme.colors.onBackground, + style = MaterialTheme.typography.body1, + ) } } } diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/NewBranchDialog.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/NewBranchDialog.kt index f6356cf..203dca1 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/NewBranchDialog.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/NewBranchDialog.kt @@ -1,10 +1,7 @@ package com.jetpackduba.gitnuro.ui.dialogs import androidx.compose.foundation.layout.* -import androidx.compose.material.MaterialTheme -import androidx.compose.material.OutlinedTextField -import androidx.compose.material.Text -import androidx.compose.material.TextButton +import androidx.compose.material.* import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -12,11 +9,15 @@ import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.focusProperties import androidx.compose.ui.focus.focusRequester import androidx.compose.ui.input.key.onPreviewKeyEvent +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import com.jetpackduba.gitnuro.keybindings.KeybindingOption import com.jetpackduba.gitnuro.keybindings.matchesBinding import com.jetpackduba.gitnuro.theme.outlinedTextFieldColors +import com.jetpackduba.gitnuro.theme.secondaryTextColor import com.jetpackduba.gitnuro.theme.textButtonColors +import com.jetpackduba.gitnuro.ui.components.AdjustableOutlinedTextField import com.jetpackduba.gitnuro.ui.components.PrimaryButton @Composable @@ -33,7 +34,33 @@ fun NewBranchDialog( horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center, ) { - OutlinedTextField( + Icon( + painterResource("branch.svg"), + contentDescription = null, + modifier = Modifier + .size(64.dp) + .padding(vertical = 16.dp), + tint = MaterialTheme.colors.onBackground, + ) + + Text( + text = "Set branch name", + modifier = Modifier + .padding(bottom = 8.dp), + color = MaterialTheme.colors.onBackground, + style = MaterialTheme.typography.body1, + ) + + Text( + text = "Create a new branch and check it out", + modifier = Modifier + .padding(bottom = 16.dp), + color = MaterialTheme.colors.secondaryTextColor, + style = MaterialTheme.typography.body2, + textAlign = TextAlign.Center, + ) + + AdjustableOutlinedTextField( modifier = Modifier .focusRequester(branchFieldFocusRequester) .focusProperties { @@ -49,15 +76,7 @@ fun NewBranchDialog( } }, value = branchField, - singleLine = true, - label = { - Text( - "New branch name", - style = MaterialTheme.typography.body1.copy(MaterialTheme.colors.primaryVariant), - ) - }, - textStyle = MaterialTheme.typography.body1, - colors = outlinedTextFieldColors(), + maxLines = 1, onValueChange = { branchField = it }, @@ -74,7 +93,11 @@ fun NewBranchDialog( onReject() } ) { - Text("Cancel") + Text( + text = "Cancel", + color = MaterialTheme.colors.onBackground, + style = MaterialTheme.typography.body1, + ) } PrimaryButton( modifier = Modifier diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/NewTagDialog.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/NewTagDialog.kt index 099d525..34d49f5 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/NewTagDialog.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/NewTagDialog.kt @@ -77,7 +77,11 @@ fun NewTagDialog( onReject() } ) { - Text("Cancel") + Text( + text = "Cancel", + color = MaterialTheme.colors.onBackground, + style = MaterialTheme.typography.body1, + ) } PrimaryButton( modifier = Modifier diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/PasswordDialog.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/PasswordDialog.kt index c4fecac..8268351 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/PasswordDialog.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/PasswordDialog.kt @@ -98,7 +98,11 @@ fun PasswordDialog( onReject() } ) { - Text("Cancel") + Text( + text = "Cancel", + color = MaterialTheme.colors.onBackground, + style = MaterialTheme.typography.body1, + ) } PrimaryButton( modifier = Modifier diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/ResetDialog.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/ResetDialog.kt index 41fb81d..97fa55d 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/ResetDialog.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/ResetDialog.kt @@ -64,7 +64,11 @@ fun ResetBranchDialog( onReject() } ) { - Text("Cancel") + Text( + text = "Cancel", + color = MaterialTheme.colors.onBackground, + style = MaterialTheme.typography.body1, + ) } PrimaryButton( onClick = { diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/StashWithMessageDialog.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/StashWithMessageDialog.kt index ec9671a..93f0d8e 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/StashWithMessageDialog.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/StashWithMessageDialog.kt @@ -76,7 +76,11 @@ fun StashWithMessageDialog( onReject() } ) { - Text("Cancel") + Text( + text = "Cancel", + color = MaterialTheme.colors.onBackground, + style = MaterialTheme.typography.body1, + ) } PrimaryButton( modifier = Modifier diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/UserPasswordDialog.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/UserPasswordDialog.kt index 658d232..2c483e6 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/UserPasswordDialog.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/UserPasswordDialog.kt @@ -127,7 +127,11 @@ fun UserPasswordDialog( onReject() } ) { - Text("Cancel") + Text( + text = "Cancel", + color = MaterialTheme.colors.onBackground, + style = MaterialTheme.typography.body1, + ) } PrimaryButton( modifier = Modifier diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt index deeb9e9..6f1460b 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt @@ -576,6 +576,7 @@ private fun DiffHeader( Text( text = filePath, style = MaterialTheme.typography.body2, + color = MaterialTheme.colors.onBackground, maxLines = 1, modifier = Modifier.padding(horizontal = 16.dp), ) @@ -692,6 +693,7 @@ private fun PathOnlyDiffHeader( Text( text = filePath, style = MaterialTheme.typography.body2, + color = MaterialTheme.colors.onBackground, maxLines = 1, modifier = Modifier.padding(horizontal = 16.dp), ) @@ -794,6 +796,7 @@ fun DiffLineText(text: String) { .fillMaxSize(), fontFamily = FontFamily.Monospace, style = MaterialTheme.typography.body2, + color = MaterialTheme.colors.onBackground, overflow = TextOverflow.Visible, ) @@ -806,6 +809,7 @@ fun DiffLineText(text: String) { Text( text = lineDelimiter, maxLines = 1, + color = MaterialTheme.colors.onBackground, ) } diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/log/Log.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/log/Log.kt index 5038897..458db78 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/log/Log.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/log/Log.kt @@ -701,6 +701,7 @@ fun SummaryEntry( Text( text = count.toString(), style = MaterialTheme.typography.body2, + color = MaterialTheme.colors.onBackground, ) Icon(