diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/App.kt b/src/main/kotlin/com/jetpackduba/gitnuro/App.kt index 1859ab9..f96e9fb 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/App.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/App.kt @@ -26,7 +26,6 @@ import com.jetpackduba.gitnuro.logging.printLog import com.jetpackduba.gitnuro.preferences.AppSettings import com.jetpackduba.gitnuro.theme.AppTheme import com.jetpackduba.gitnuro.theme.Theme -import com.jetpackduba.gitnuro.theme.primaryTextColor import com.jetpackduba.gitnuro.theme.secondaryTextColor import com.jetpackduba.gitnuro.ui.AppTab import com.jetpackduba.gitnuro.ui.components.RepositoriesTabPanel @@ -251,7 +250,7 @@ fun LoadingRepository(repoPath: String) { contentAlignment = Alignment.Center, ) { Column(horizontalAlignment = Alignment.CenterHorizontally) { - Text("Opening repository", fontSize = 36.sp, color = MaterialTheme.colors.primaryTextColor) + Text("Opening repository", fontSize = 36.sp, color = MaterialTheme.colors.onBackground) Text(repoPath, fontSize = 24.sp, color = MaterialTheme.colors.secondaryTextColor) } } diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/theme/Color.kt b/src/main/kotlin/com/jetpackduba/gitnuro/theme/Color.kt index d8b75b9..b1562bf 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/theme/Color.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/theme/Color.kt @@ -39,9 +39,9 @@ val darkBlueTheme = ColorsScheme( secondaryText = Color(0xFFCCCBCB), error = Color(0xFFc93838), onError = Color(0xFFFFFFFF), - background = Color(0xFF16181F), + background = Color(0xFF0E1621), backgroundSelected = Color(0xFF2f3640), - surface = Color(0xFF202538), + surface = Color(0xFF182533), secondarySurface = Color(0xFF122C46), headerBackground = Color(0xFF0a335c), borderColor = Color(0xFF989898), diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/theme/ComponentsColors.kt b/src/main/kotlin/com/jetpackduba/gitnuro/theme/ComponentsColors.kt index d6c66f1..13bd93b 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/theme/ComponentsColors.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/theme/ComponentsColors.kt @@ -12,7 +12,7 @@ fun textFieldColors( focusedIndicatorColor: Color = MaterialTheme.colors.primaryVariant, focusedLabelColor: Color = MaterialTheme.colors.primaryVariant, backgroundColor: Color = MaterialTheme.colors.background, - textColor: Color = MaterialTheme.colors.primaryTextColor, + textColor: Color = MaterialTheme.colors.onBackground, disabledTextColor: Color = MaterialTheme.colors.secondaryTextColor, ) = TextFieldDefaults.textFieldColors( cursorColor = cursorColor, @@ -29,7 +29,7 @@ fun outlinedTextFieldColors() = TextFieldDefaults.outlinedTextFieldColors( focusedBorderColor = MaterialTheme.colors.primaryVariant, focusedLabelColor = MaterialTheme.colors.primaryVariant, backgroundColor = MaterialTheme.colors.background, - textColor = MaterialTheme.colors.primaryTextColor, + textColor = MaterialTheme.colors.onBackground, ) @Composable diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/theme/Theme.kt b/src/main/kotlin/com/jetpackduba/gitnuro/theme/Theme.kt index f1c67a1..1194ce5 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/theme/Theme.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/theme/Theme.kt @@ -37,10 +37,6 @@ fun AppTheme( val Colors.backgroundSelected: Color get() = appTheme.backgroundSelected -@get:Composable -val Colors.primaryTextColor: Color - get() = appTheme.primaryText - @get:Composable val Colors.secondaryTextColor: Color get() = appTheme.secondaryText diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/theme/Typography.kt b/src/main/kotlin/com/jetpackduba/gitnuro/theme/Typography.kt index 2ab4781..ced874f 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/theme/Typography.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/theme/Typography.kt @@ -29,38 +29,38 @@ fun typography() = Typography( defaultFontFamily = openSansFontFamily, h1 = TextStyle( fontSize = 32.sp, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, letterSpacing = LETTER_SPACING.sp, ), h2 = TextStyle( fontSize = 24.sp, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, letterSpacing = LETTER_SPACING.sp, ), h3 = TextStyle( fontSize = 20.sp, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, letterSpacing = LETTER_SPACING.sp, ), h4 = TextStyle( fontSize = 17.sp, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, letterSpacing = LETTER_SPACING.sp, ), body1 = TextStyle( fontSize = 15.sp, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, letterSpacing = LETTER_SPACING.sp, ), body2 = TextStyle( fontSize = 13.sp, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, fontWeight = FontWeight.Normal, letterSpacing = LETTER_SPACING.sp, ), caption = TextStyle( fontSize = 11.sp, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, letterSpacing = LETTER_SPACING.sp, ) ) \ No newline at end of file diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/Blame.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/Blame.kt index 4c67b4d..b5de8fc 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/Blame.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/Blame.kt @@ -33,7 +33,6 @@ import com.jetpackduba.gitnuro.extensions.toStringWithSpaces import com.jetpackduba.gitnuro.keybindings.KeybindingOption import com.jetpackduba.gitnuro.keybindings.matchesBinding import com.jetpackduba.gitnuro.theme.headerBackground -import com.jetpackduba.gitnuro.theme.primaryTextColor import com.jetpackduba.gitnuro.theme.secondarySurface import com.jetpackduba.gitnuro.ui.components.PrimaryButton import com.jetpackduba.gitnuro.ui.components.ScrollableLazyColumn @@ -119,7 +118,7 @@ fun Blame( Text( text = line + blameResult.resultContents.lineDelimiter, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, modifier = Modifier.padding(vertical = 8.dp, horizontal = 16.dp), fontFamily = FontFamily.Monospace, maxLines = 1, @@ -142,7 +141,7 @@ private fun LineNumber(line: Int, highestLineLength: Int) { ) { Text( text = line.toStringWithSpaces(highestLineLength), - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, fontFamily = FontFamily.Monospace, ) } @@ -193,7 +192,7 @@ fun MinimizedBlame( Image( painter = painterResource("close.svg"), contentDescription = "Close blame", - colorFilter = ColorFilter.tint(MaterialTheme.colors.primaryTextColor), + colorFilter = ColorFilter.tint(MaterialTheme.colors.onBackground), ) } } @@ -228,7 +227,7 @@ private fun Header( Image( painter = painterResource("close.svg"), contentDescription = "Close blame", - colorFilter = ColorFilter.tint(MaterialTheme.colors.primaryTextColor), + colorFilter = ColorFilter.tint(MaterialTheme.colors.onBackground), ) } } diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/CommitChanges.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/CommitChanges.kt index 2a30945..734a98a 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/CommitChanges.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/CommitChanges.kt @@ -280,7 +280,7 @@ fun CommitLogChanges( maxLines = 1, softWrap = false, style = MaterialTheme.typography.body2, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, ) } diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/FileHistory.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/FileHistory.kt index 4fe16a1..f40d74a 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/FileHistory.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/FileHistory.kt @@ -19,8 +19,6 @@ import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.focusRequester import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.input.key.onKeyEvent -import androidx.compose.ui.input.pointer.PointerIconDefaults -import androidx.compose.ui.input.pointer.pointerHoverIcon import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp import com.jetpackduba.gitnuro.extensions.handMouseClickable @@ -30,7 +28,6 @@ import com.jetpackduba.gitnuro.git.diff.DiffResult import com.jetpackduba.gitnuro.keybindings.KeybindingOption import com.jetpackduba.gitnuro.keybindings.matchesBinding import com.jetpackduba.gitnuro.theme.headerBackground -import com.jetpackduba.gitnuro.theme.primaryTextColor import com.jetpackduba.gitnuro.theme.secondaryTextColor import com.jetpackduba.gitnuro.ui.components.AvatarImage import com.jetpackduba.gitnuro.ui.components.ScrollableLazyColumn @@ -108,7 +105,7 @@ private fun Header( Image( painter = painterResource("close.svg"), contentDescription = "Close history", - colorFilter = ColorFilter.tint(MaterialTheme.colors.primaryTextColor), + colorFilter = ColorFilter.tint(MaterialTheme.colors.onBackground), ) } } diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/RebaseInteractive.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/RebaseInteractive.kt index 3afb623..a1130f8 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/RebaseInteractive.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/RebaseInteractive.kt @@ -9,7 +9,6 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import com.jetpackduba.gitnuro.theme.primaryTextColor import com.jetpackduba.gitnuro.theme.textButtonColors import com.jetpackduba.gitnuro.ui.components.AdjustableOutlinedTextField import com.jetpackduba.gitnuro.ui.components.PrimaryButton @@ -62,7 +61,7 @@ fun RebaseStateLoaded( ) { Text( text = "Rebase interactive", - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, modifier = Modifier.padding(start = 16.dp, top = 16.dp), fontSize = 20.sp, ) diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/Remotes.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/Remotes.kt index 9ea8c0a..801c956 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/Remotes.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/Remotes.kt @@ -18,7 +18,7 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp import com.jetpackduba.gitnuro.extensions.handOnHover import com.jetpackduba.gitnuro.extensions.simpleName -import com.jetpackduba.gitnuro.theme.primaryTextColor + import com.jetpackduba.gitnuro.ui.components.SideMenuPanel import com.jetpackduba.gitnuro.ui.components.SideMenuSubentry import com.jetpackduba.gitnuro.ui.components.VerticalExpandable @@ -69,7 +69,7 @@ fun Remotes( contentDescription = null, modifier = Modifier .fillMaxSize(), - tint = MaterialTheme.colors.primaryTextColor, + tint = MaterialTheme.colors.onBackground, ) } }, diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/RepositoryOpen.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/RepositoryOpen.kt index a80e914..985bdcf 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/RepositoryOpen.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/RepositoryOpen.kt @@ -35,7 +35,6 @@ import com.jetpackduba.gitnuro.extensions.handOnHover import com.jetpackduba.gitnuro.git.DiffEntryType import com.jetpackduba.gitnuro.keybindings.KeybindingOption import com.jetpackduba.gitnuro.keybindings.matchesBinding -import com.jetpackduba.gitnuro.theme.primaryTextColor import com.jetpackduba.gitnuro.theme.secondarySurface import com.jetpackduba.gitnuro.ui.components.ScrollableColumn import com.jetpackduba.gitnuro.ui.dialogs.AuthorDialog @@ -221,6 +220,7 @@ private fun BottomInfoBar(tabViewModel: TabViewModel) { Text( text = "${userInfo.name ?: "Name not set"} <${userInfo.email ?: "Email not set"}>", style = MaterialTheme.typography.body2, + color = MaterialTheme.colors.onBackground, ) } } @@ -285,7 +285,7 @@ fun SideBarButton( painter = painterResource(painterName), contentDescription = null, modifier = Modifier, - tint = MaterialTheme.colors.primaryTextColor, + tint = MaterialTheme.colors.onBackground, ) } } diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/UncommitedChanges.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/UncommitedChanges.kt index c02e9be..b751f7f 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/UncommitedChanges.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/UncommitedChanges.kt @@ -618,7 +618,7 @@ private fun FileEntry( maxLines = 1, softWrap = false, style = MaterialTheme.typography.body2, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, ) } } diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/AdjustableOutlinedTextField.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/AdjustableOutlinedTextField.kt index 3b613d2..9bd5ac0 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/AdjustableOutlinedTextField.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/AdjustableOutlinedTextField.kt @@ -22,6 +22,7 @@ import androidx.compose.ui.graphics.Shape import androidx.compose.ui.graphics.SolidColor import androidx.compose.ui.graphics.takeOrElse import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.input.VisualTransformation import androidx.compose.ui.unit.dp import com.jetpackduba.gitnuro.theme.outlinedTextFieldColors @@ -36,10 +37,14 @@ fun AdjustableOutlinedTextField( colors: TextFieldColors = outlinedTextFieldColors(), maxLines: Int = Int.MAX_VALUE, keyboardOptions: KeyboardOptions = KeyboardOptions.Default, - textStyle: TextStyle = LocalTextStyle.current.copy(fontSize = MaterialTheme.typography.body1.fontSize), + textStyle: TextStyle = LocalTextStyle.current.copy( + fontSize = MaterialTheme.typography.body1.fontSize, + color = MaterialTheme.colors.onBackground, + ), interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, shape: Shape = RoundedCornerShape(4.dp), - backgroundColor: Color = MaterialTheme.colors.background + backgroundColor: Color = MaterialTheme.colors.background, + visualTransformation: VisualTransformation = VisualTransformation.None, ) { val textColor = textStyle.color.takeOrElse { colors.textColor(enabled).value @@ -61,6 +66,7 @@ fun AdjustableOutlinedTextField( keyboardOptions = keyboardOptions, cursorBrush = SolidColor(cursorColor), singleLine = singleLine, + visualTransformation = visualTransformation, decorationBox = { innerTextField -> Box( modifier = Modifier diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/PrimaryButton.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/PrimaryButton.kt index 7181b04..4ea972c 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/PrimaryButton.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/PrimaryButton.kt @@ -7,7 +7,7 @@ import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color -import com.jetpackduba.gitnuro.theme.primaryTextColor + @Composable fun PrimaryButton( @@ -15,7 +15,7 @@ fun PrimaryButton( text: String, enabled: Boolean = true, textColor: Color = MaterialTheme.colors.onPrimary, - disabledTextColor: Color = MaterialTheme.colors.primaryTextColor, + disabledTextColor: Color = MaterialTheme.colors.onBackground, onClick: () -> Unit, ) { Button( diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/RepositoriesTabPanel.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/RepositoriesTabPanel.kt index 8d6f2e1..898bddc 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/RepositoriesTabPanel.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/RepositoriesTabPanel.kt @@ -30,7 +30,7 @@ import com.jetpackduba.gitnuro.di.AppComponent import com.jetpackduba.gitnuro.di.DaggerTabComponent import com.jetpackduba.gitnuro.extensions.handMouseClickable import com.jetpackduba.gitnuro.extensions.handOnHover -import com.jetpackduba.gitnuro.theme.primaryTextColor + import com.jetpackduba.gitnuro.viewmodels.TabViewModel import javax.inject.Inject import kotlin.io.path.Path @@ -164,6 +164,7 @@ fun Tab(title: MutableState, isSelected: Boolean, onClick: () -> Unit, o .weight(1f), overflow = TextOverflow.Visible, style = MaterialTheme.typography.body2, + color = MaterialTheme.colors.onBackground, maxLines = 1, ) @@ -177,7 +178,7 @@ fun Tab(title: MutableState, isSelected: Boolean, onClick: () -> Unit, o Icon( Icons.Default.Close, contentDescription = null, - tint = MaterialTheme.colors.primaryTextColor + tint = MaterialTheme.colors.onBackground ) } } diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/SideMenuEntry.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/SideMenuEntry.kt index f7ddd07..1fcd55b 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/SideMenuEntry.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/SideMenuEntry.kt @@ -17,7 +17,7 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp -import com.jetpackduba.gitnuro.theme.primaryTextColor + import com.jetpackduba.gitnuro.theme.secondaryTextColor @Composable @@ -42,7 +42,7 @@ fun SideMenuEntry( Icon( painter = painterResource(if (isExpanded) "expand_more.svg" else "chevron_right.svg"), contentDescription = null, - tint = MaterialTheme.colors.primaryTextColor, + tint = MaterialTheme.colors.onBackground, modifier = Modifier .padding(horizontal = 8.dp) .size(16.dp), @@ -52,7 +52,7 @@ fun SideMenuEntry( Icon( painter = icon, contentDescription = null, - tint = MaterialTheme.colors.primaryTextColor, + tint = MaterialTheme.colors.onBackground, modifier = Modifier .size(16.dp), ) @@ -66,7 +66,7 @@ fun SideMenuEntry( maxLines = 1, style = MaterialTheme.typography.body2, fontWeight = FontWeight.Medium, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, overflow = TextOverflow.Ellipsis, ) diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/SideMenuSubentry.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/SideMenuSubentry.kt index 6fbe2e8..7ea90c5 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/SideMenuSubentry.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/SideMenuSubentry.kt @@ -17,7 +17,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp -import com.jetpackduba.gitnuro.theme.primaryTextColor + const val ENTRY_HEIGHT = 36 @@ -59,7 +59,7 @@ fun SideMenuSubentry( modifier = Modifier.weight(1f, fill = true), maxLines = 1, style = MaterialTheme.typography.body2, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, softWrap = false, ) diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/TextLink.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/TextLink.kt index 6ce340c..60e70b6 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/TextLink.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/TextLink.kt @@ -11,7 +11,7 @@ import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import com.jetpackduba.gitnuro.extensions.handMouseClickable import com.jetpackduba.gitnuro.extensions.openUrlInBrowser -import com.jetpackduba.gitnuro.theme.primaryTextColor + @Composable fun TextLink( @@ -24,7 +24,7 @@ fun TextLink( val isHovered by hoverInteraction.collectIsHoveredAsState() val textColor = if (isHovered == colorsInverted) { - MaterialTheme.colors.primaryTextColor + MaterialTheme.colors.onBackground } else { MaterialTheme.colors.primaryVariant } diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/context_menu/ContextMenu.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/context_menu/ContextMenu.kt index 25364d8..54994b0 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/context_menu/ContextMenu.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/context_menu/ContextMenu.kt @@ -22,7 +22,7 @@ import androidx.compose.ui.window.Popup import androidx.compose.ui.window.PopupPositionProvider import com.jetpackduba.gitnuro.keybindings.KeybindingOption import com.jetpackduba.gitnuro.keybindings.matchesBinding -import com.jetpackduba.gitnuro.theme.primaryTextColor + import com.jetpackduba.gitnuro.theme.secondaryTextColor import java.awt.event.MouseEvent import kotlin.math.abs @@ -126,7 +126,7 @@ fun showPopup(x: Int, y: Int, contextMenuElements: List, onD .background(MaterialTheme.colors.background) .run { return@run if (!MaterialTheme.colors.isLight) { - this.border(1.dp, MaterialTheme.colors.primaryTextColor.copy(alpha = 0.2f)) + this.border(1.dp, MaterialTheme.colors.onBackground.copy(alpha = 0.2f)) } else this } @@ -160,7 +160,7 @@ fun Separator() { .padding(horizontal = 16.dp) .fillMaxWidth() .height(1.dp) - .background(MaterialTheme.colors.primaryTextColor.copy(alpha = 0.4f)) + .background(MaterialTheme.colors.onBackground.copy(alpha = 0.4f)) ) } 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 6d09d16..2ff9312 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/AuthorDialog.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/AuthorDialog.kt @@ -14,7 +14,7 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.jetpackduba.gitnuro.theme.outlinedTextFieldColors -import com.jetpackduba.gitnuro.theme.primaryTextColor + import com.jetpackduba.gitnuro.theme.textButtonColors import com.jetpackduba.gitnuro.ui.components.AdjustableOutlinedTextField import com.jetpackduba.gitnuro.ui.components.PrimaryButton @@ -43,7 +43,7 @@ fun AuthorDialog( Text( text = "Global settings", - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, fontSize = 16.sp, modifier = Modifier.padding(vertical = 8.dp), ) @@ -61,7 +61,7 @@ fun AuthorDialog( Text( text = "Repository settings", - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, fontSize = 16.sp, modifier = Modifier.padding(top = 16.dp, bottom = 8.dp), ) @@ -88,7 +88,7 @@ fun AuthorDialog( Icon( painterResource("warning.svg"), contentDescription = null, - tint = MaterialTheme.colors.primaryTextColor, + tint = MaterialTheme.colors.onBackground, modifier = Modifier.size(16.dp) ) Text( 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 cef6f9f..75fe708 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/CloneDialog.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/CloneDialog.kt @@ -19,7 +19,7 @@ import androidx.compose.ui.graphics.Shape import androidx.compose.ui.unit.dp import com.jetpackduba.gitnuro.git.CloneStatus import com.jetpackduba.gitnuro.theme.outlinedTextFieldColors -import com.jetpackduba.gitnuro.theme.primaryTextColor + import com.jetpackduba.gitnuro.theme.textButtonColors import com.jetpackduba.gitnuro.ui.components.AdjustableOutlinedTextField import com.jetpackduba.gitnuro.ui.components.PrimaryButton @@ -166,7 +166,7 @@ private fun CloneInput( Icon( Icons.Default.Search, contentDescription = null, - tint = MaterialTheme.colors.primaryTextColor, + tint = MaterialTheme.colors.onBackground, ) } } @@ -248,7 +248,7 @@ private fun Cloning(cloneViewModel: CloneViewModel, cloneStatusValue: CloneStatu horizontalAlignment = Alignment.CenterHorizontally, ) { - Text(cloneStatusValue.taskName, color = MaterialTheme.colors.primaryTextColor) + Text(cloneStatusValue.taskName, color = MaterialTheme.colors.onBackground) if (progress >= 0f) CircularProgressIndicator( @@ -295,7 +295,7 @@ private fun Cancelling() { Text( text = "Cancelling clone operation...", - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, modifier = Modifier.padding(vertical = 16.dp), ) } diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/EditRemotesDialog.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/EditRemotesDialog.kt index a1d60db..ea905f7 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/EditRemotesDialog.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/EditRemotesDialog.kt @@ -81,6 +81,7 @@ fun EditRemotesDialog( ) { Text( text = "Remotes", + color = MaterialTheme.colors.onBackground, style = MaterialTheme.typography.h3, modifier = Modifier.padding(vertical = 8.dp), ) @@ -95,7 +96,7 @@ fun EditRemotesDialog( Icon( imageVector = Icons.Default.Clear, contentDescription = null, - tint = MaterialTheme.colors.primaryTextColor, + tint = MaterialTheme.colors.onBackground, ) } } @@ -121,7 +122,7 @@ fun EditRemotesDialog( Text( text = remote.remoteName, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, modifier = Modifier .fillMaxWidth() .handMouseClickable { @@ -176,7 +177,7 @@ fun EditRemotesDialog( Icon( painter = painterResource("add.svg"), contentDescription = null, - tint = MaterialTheme.colors.primaryTextColor, + tint = MaterialTheme.colors.onBackground, ) } IconButton( @@ -193,7 +194,7 @@ fun EditRemotesDialog( painter = painterResource("remove.svg"), contentDescription = null, tint = if (selectedRemote != null) - MaterialTheme.colors.primaryTextColor + MaterialTheme.colors.onBackground else MaterialTheme.colors.secondaryTextColor, ) @@ -211,7 +212,7 @@ fun EditRemotesDialog( if (selectedRemote.isNew) { Text( text = "New remote name", - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, modifier = Modifier.padding(top = 8.dp), ) @@ -237,7 +238,7 @@ fun EditRemotesDialog( Text( text = "Fetch URL", - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, modifier = Modifier.padding(top = 8.dp), ) @@ -257,7 +258,7 @@ fun EditRemotesDialog( Text( text = "Push URL", - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, modifier = Modifier.padding(top = 8.dp), ) @@ -305,7 +306,7 @@ fun EditRemotesDialog( color = if (remoteChanged) MaterialTheme.colors.primaryVariant else - MaterialTheme.colors.primaryTextColor, + MaterialTheme.colors.onBackground, ) } } diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/MaterialDialog.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/MaterialDialog.kt index db23b8d..c3b0551 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/MaterialDialog.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/MaterialDialog.kt @@ -33,7 +33,7 @@ fun MaterialDialog( alignment: Alignment = Alignment.Center, paddingHorizontal: Dp = 16.dp, paddingVertical: Dp = 16.dp, - background: Color = MaterialTheme.colors.background, + background: Color = MaterialTheme.colors.surface, onCloseRequested: () -> Unit = {}, content: @Composable () -> Unit ) { 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 fdbb4bb..c4fecac 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/PasswordDialog.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/PasswordDialog.kt @@ -2,10 +2,7 @@ package com.jetpackduba.gitnuro.ui.dialogs import androidx.compose.foundation.background 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 @@ -13,12 +10,16 @@ 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.input.PasswordVisualTransformation +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.primaryTextColor + +import com.jetpackduba.gitnuro.theme.secondaryTextColor +import com.jetpackduba.gitnuro.ui.components.AdjustableOutlinedTextField import com.jetpackduba.gitnuro.ui.components.PrimaryButton @Composable @@ -32,21 +33,38 @@ fun PasswordDialog( MaterialDialog(onCloseRequested = onReject) { Column( - modifier = Modifier - .background(MaterialTheme.colors.background), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center, ) { - Text( - text = "Introduce your default SSH key's password", + Icon( + painterResource("lock.svg"), + contentDescription = null, modifier = Modifier - .padding(vertical = 8.dp), - color = MaterialTheme.colors.primaryTextColor, + .size(64.dp) + .padding(vertical = 16.dp), + tint = MaterialTheme.colors.onBackground, ) - OutlinedTextField( + + Text( + text = "Introduce your SSH key's password", + modifier = Modifier + .padding(bottom = 8.dp), + color = MaterialTheme.colors.onBackground, + style = MaterialTheme.typography.body1, + ) + + Text( + text = "Your SSH key is protected with a password", + modifier = Modifier + .padding(bottom = 16.dp), + color = MaterialTheme.colors.secondaryTextColor, + style = MaterialTheme.typography.body2, + textAlign = TextAlign.Center, + ) + + AdjustableOutlinedTextField( modifier = Modifier - .padding(bottom = 8.dp) .focusRequester(passwordFieldFocusRequester) .focusProperties { this.next = buttonFieldFocusRequester @@ -61,14 +79,7 @@ fun PasswordDialog( } }, value = passwordField, - singleLine = true, - label = { - Text( - "Password", - style = MaterialTheme.typography.body1.copy(MaterialTheme.colors.primaryVariant), - ) - }, - textStyle = MaterialTheme.typography.body1, + maxLines = 1, colors = outlinedTextFieldColors(), onValueChange = { passwordField = it 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 5884ed2..41fb81d 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/ResetDialog.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/ResetDialog.kt @@ -14,7 +14,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import com.jetpackduba.gitnuro.git.log.ResetType -import com.jetpackduba.gitnuro.theme.primaryTextColor + import com.jetpackduba.gitnuro.theme.textButtonColors import com.jetpackduba.gitnuro.ui.components.PrimaryButton @@ -109,7 +109,7 @@ fun RadioButtonText( Text( text = text, modifier = Modifier.padding(horizontal = 8.dp), - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, ) } } \ No newline at end of file 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 f346ef9..658d232 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/UserPasswordDialog.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/UserPasswordDialog.kt @@ -18,7 +18,7 @@ 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.primaryTextColor + import com.jetpackduba.gitnuro.theme.textButtonColors import com.jetpackduba.gitnuro.ui.components.PrimaryButton @@ -49,7 +49,7 @@ fun UserPasswordDialog( text = "Introduce your remote server credentials", modifier = Modifier .padding(vertical = 8.dp), - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, ) OutlinedTextField( diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/settings/SettingsDialog.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/settings/SettingsDialog.kt index 1b22b88..6616149 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/settings/SettingsDialog.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/settings/SettingsDialog.kt @@ -62,7 +62,7 @@ fun SettingsDialog( Text( text = "Settings", style = MaterialTheme.typography.h3, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, modifier = Modifier.padding(top = 8.dp, bottom = 16.dp) ) @@ -247,7 +247,7 @@ fun Category( .handMouseClickable(onClick) .padding(8.dp), style = MaterialTheme.typography.body1, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, ) } @@ -278,7 +278,7 @@ fun SettingDropDown( Text( text = currentOption.optionName, style = MaterialTheme.typography.body1, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, modifier = Modifier.weight(1f), maxLines = 1 ) @@ -286,7 +286,7 @@ fun SettingDropDown( Icon( painter = painterResource("dropdown.svg"), contentDescription = null, - tint = MaterialTheme.colors.primaryTextColor, + tint = MaterialTheme.colors.onBackground, ) } @@ -328,7 +328,7 @@ fun SettingButton( OutlinedButton(onClick = onClick) { Text( text = buttonText, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, style = MaterialTheme.typography.body1, ) } @@ -462,7 +462,7 @@ private fun FieldTitles( ) { Text( text = title, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, style = MaterialTheme.typography.body1, ) 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 47543f4..deeb9e9 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt @@ -226,7 +226,7 @@ fun SideTitle(text: String) { Text( text = text, fontSize = 20.sp, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, ) } @@ -504,7 +504,7 @@ fun HunkHeader( ) { Text( text = header, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, style = MaterialTheme.typography.body1, ) @@ -602,7 +602,7 @@ private fun DiffHeader( Image( painter = painterResource("close.svg"), contentDescription = "Close diff", - colorFilter = ColorFilter.tint(MaterialTheme.colors.primaryTextColor), + colorFilter = ColorFilter.tint(MaterialTheme.colors.onBackground), ) } } @@ -616,7 +616,7 @@ fun DiffTypeButtons(diffType: TextDiffType, onChangeDiffType: (TextDiffType) -> ) { Text( "Unified", - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, style = MaterialTheme.typography.caption, ) @@ -639,7 +639,7 @@ fun DiffTypeButtons(diffType: TextDiffType, onChangeDiffType: (TextDiffType) -> Text( "Split", - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, // modifier = Modifier.padding(horizontal = 4.dp), style = MaterialTheme.typography.caption, ) @@ -706,7 +706,7 @@ private fun PathOnlyDiffHeader( Image( painter = painterResource("close.svg"), contentDescription = "Close diff", - colorFilter = ColorFilter.tint(MaterialTheme.colors.primaryTextColor), + colorFilter = ColorFilter.tint(MaterialTheme.colors.onBackground), ) } } @@ -820,7 +820,7 @@ fun LineNumber(text: String, remarked: Boolean) { .padding(start = 8.dp, end = 4.dp), fontFamily = FontFamily.Monospace, style = MaterialTheme.typography.body2, - color = if (remarked) MaterialTheme.colors.primaryTextColor else MaterialTheme.colors.secondaryTextColor, + color = if (remarked) MaterialTheme.colors.onBackground else MaterialTheme.colors.secondaryTextColor, ) } 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 30e714c..5038897 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/log/Log.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/log/Log.kt @@ -409,7 +409,7 @@ fun MessagesList( ) { Text( text = "The commits list has been limited to $commitsLimit. Access the settings to change it.", - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, fontStyle = FontStyle.Italic, style = MaterialTheme.typography.body2, maxLines = 1, @@ -600,7 +600,7 @@ fun GraphHeader( Icons.Default.Search, modifier = Modifier.size(18.dp), contentDescription = null, - tint = MaterialTheme.colors.primaryTextColor, + tint = MaterialTheme.colors.onBackground, ) } } @@ -639,7 +639,7 @@ fun UncommitedChangesLine( modifier = Modifier.padding(start = 16.dp), style = MaterialTheme.typography.body2, maxLines = 1, - color = MaterialTheme.colors.primaryTextColor, + color = MaterialTheme.colors.onBackground, ) Spacer(modifier = Modifier.weight(1f)) @@ -844,7 +844,7 @@ fun CommitMessage( .padding(start = 8.dp) .weight(1f), style = MaterialTheme.typography.body2, - color = if (matchesSearchFilter == false) MaterialTheme.colors.secondaryTextColor else MaterialTheme.colors.primaryTextColor, + color = if (matchesSearchFilter == false) MaterialTheme.colors.secondaryTextColor else MaterialTheme.colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis, ) @@ -1137,6 +1137,7 @@ fun RefChip( Text( text = ref.simpleLogName, style = MaterialTheme.typography.body2, + color = MaterialTheme.colors.onBackground, maxLines = 1, modifier = Modifier.padding(horizontal = 6.dp) ) diff --git a/src/main/resources/lock.svg b/src/main/resources/lock.svg new file mode 100644 index 0000000..1a38f2f --- /dev/null +++ b/src/main/resources/lock.svg @@ -0,0 +1 @@ + \ No newline at end of file