Unified fonts styles

This commit is contained in:
Abdelilah El Aissaoui 2022-07-10 16:04:03 +02:00
parent 4c48cd995e
commit d93e634a5c
39 changed files with 191 additions and 139 deletions

View File

@ -27,7 +27,7 @@ dependencies {
implementation(compose.desktop.currentOs)
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
implementation(compose.desktop.components.splitPane)
implementation("org.eclipse.jgit:org.eclipse.jgit:6.1.0.202203080745-r")
implementation("org.eclipse.jgit:org.eclipse.jgit:6.2.0.202206071550-r")
implementation("org.apache.sshd:sshd-core:2.8.0")
implementation("com.google.dagger:dagger:2.42")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3")

View File

@ -29,7 +29,7 @@ fun AppTheme(
MaterialTheme(
colors = theme.toComposeColors(),
content = content,
typography = typography,
typography = typography(),
)
}

View File

@ -1,24 +0,0 @@
package app.theme
import androidx.compose.material.Typography
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.platform.Font
import androidx.compose.ui.unit.sp
// Set of Material typography styles to start with
val fontFamily = FontFamily(
Font("fonts/OpenSans-Regular.ttf", FontWeight.Normal, FontStyle.Normal),
Font("fonts/OpenSans-Italic.ttf", FontWeight.Normal, FontStyle.Italic),
Font("fonts/OpenSans-Medium.ttf", FontWeight.Medium, FontStyle.Normal),
Font("fonts/OpenSans-MediumItalic.ttf", FontWeight.Medium, FontStyle.Italic),
Font("fonts/OpenSans-SemiBold.ttf", FontWeight.SemiBold, FontStyle.Normal),
Font("fonts/OpenSans-SemiBoldItalic.ttf", FontWeight.SemiBold, FontStyle.Italic),
Font("fonts/OpenSans-Bold.ttf", FontWeight.Bold, FontStyle.Normal),
Font("fonts/OpenSans-BoldItalic.ttf", FontWeight.Bold, FontStyle.Italic),
)
val typography = Typography(
defaultFontFamily = fontFamily
)

View File

@ -0,0 +1,60 @@
package app.theme
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Typography
import androidx.compose.runtime.Composable
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.platform.Font
import androidx.compose.ui.unit.sp
// Set of Material typography styles to start with
val openSansFontFamily = FontFamily(
Font("fonts/OpenSans/OpenSans-Regular.ttf", FontWeight.Normal, FontStyle.Normal),
Font("fonts/OpenSans/OpenSans-Italic.ttf", FontWeight.Normal, FontStyle.Italic),
Font("fonts/OpenSans/OpenSans-Medium.ttf", FontWeight.Medium, FontStyle.Normal),
Font("fonts/OpenSans/OpenSans-MediumItalic.ttf", FontWeight.Medium, FontStyle.Italic),
Font("fonts/OpenSans/OpenSans-SemiBold.ttf", FontWeight.SemiBold, FontStyle.Normal),
Font("fonts/OpenSans/OpenSans-SemiBoldItalic.ttf", FontWeight.SemiBold, FontStyle.Italic),
Font("fonts/OpenSans/OpenSans-Bold.ttf", FontWeight.Bold, FontStyle.Normal),
Font("fonts/OpenSans/OpenSans-BoldItalic.ttf", FontWeight.Bold, FontStyle.Italic),
)
const val LETTER_SPACING = 0.5
@Composable
fun typography() = Typography(
defaultFontFamily = openSansFontFamily,
h1 = TextStyle(
fontSize = 32.sp,
color = MaterialTheme.colors.primaryTextColor,
letterSpacing = LETTER_SPACING.sp,
),
h2 = TextStyle(
fontSize = 24.sp,
color = MaterialTheme.colors.primaryTextColor,
letterSpacing = LETTER_SPACING.sp,
),
h3 = TextStyle(
fontSize = 20.sp,
color = MaterialTheme.colors.primaryTextColor,
letterSpacing = LETTER_SPACING.sp,
),
h4 = TextStyle(
fontSize = 16.sp,
color = MaterialTheme.colors.primaryTextColor,
letterSpacing = LETTER_SPACING.sp,
),
body1 = TextStyle(
fontSize = 14.sp,
color = MaterialTheme.colors.primaryTextColor,
letterSpacing = LETTER_SPACING.sp,
),
body2 = TextStyle(
fontSize = 12.sp,
color = MaterialTheme.colors.primaryTextColor,
letterSpacing = LETTER_SPACING.sp,
)
)

View File

@ -103,10 +103,9 @@ fun Blame(
) {
Text(
text = author?.name.orEmpty(),
color = MaterialTheme.colors.primaryTextColor,
maxLines = 1,
modifier = Modifier.padding(start = 16.dp),
fontSize = 12.sp,
style = MaterialTheme.typography.body2,
)
Text(
text = commit?.shortMessage ?: "Uncommited change",
@ -174,9 +173,8 @@ fun MinimizedBlame(
)
Text(
text = filePath,
color = MaterialTheme.colors.primaryTextColor,
style = MaterialTheme.typography.body2,
maxLines = 1,
fontSize = 12.sp,
)
}
@ -216,8 +214,7 @@ private fun Header(
) {
Text(
text = filePath,
color = MaterialTheme.colors.primaryTextColor,
fontSize = 13.sp,
style = MaterialTheme.typography.body1,
modifier = Modifier.padding(horizontal = 16.dp),
)

View File

@ -96,7 +96,7 @@ private fun BranchLineEntry(
Text(
text = "HEAD",
color = MaterialTheme.colors.secondaryTextColor,
fontSize = 12.sp,
style = MaterialTheme.typography.body2,
modifier = Modifier.padding(horizontal = 16.dp),
)
}

View File

@ -82,8 +82,7 @@ fun CommitChangesView(
SelectionContainer {
Text(
text = commit.fullMessage,
fontSize = 14.sp,
color = MaterialTheme.colors.primaryTextColor,
style = MaterialTheme.typography.body1,
modifier = Modifier
.fillMaxWidth()
.background(MaterialTheme.colors.background)
@ -115,7 +114,7 @@ fun CommitChangesView(
textAlign = TextAlign.Left,
color = MaterialTheme.colors.headerText,
maxLines = 1,
fontSize = 13.sp,
style = MaterialTheme.typography.body1,
)
@ -156,9 +155,8 @@ fun Author(
) {
TooltipText(
text = author.name,
color = MaterialTheme.colors.primaryTextColor,
maxLines = 1,
fontSize = 14.sp,
style = MaterialTheme.typography.body2,
tooltipTitle = author.emailAddress,
)
@ -167,7 +165,7 @@ fun Author(
text = id.abbreviate(7).name(),
color = MaterialTheme.colors.secondaryTextColor,
maxLines = 1,
fontSize = 12.sp,
style = MaterialTheme.typography.body2,
)
@ -186,7 +184,7 @@ fun Author(
color = MaterialTheme.colors.secondaryTextColor,
maxLines = 1,
modifier = Modifier.padding(horizontal = 16.dp),
fontSize = 13.sp,
style = MaterialTheme.typography.body2,
tooltipTitle = systemDate
)
}
@ -248,8 +246,8 @@ fun CommitLogChanges(
modifier = Modifier.weight(1f, fill = false),
maxLines = 1,
softWrap = false,
fontSize = 13.sp,
overflow = TextOverflow.Ellipsis,
style = MaterialTheme.typography.body2,
color = MaterialTheme.colors.secondaryTextColor,
)
}
@ -258,7 +256,7 @@ fun CommitLogChanges(
modifier = Modifier.weight(1f, fill = false),
maxLines = 1,
softWrap = false,
fontSize = 13.sp,
style = MaterialTheme.typography.body2,
color = MaterialTheme.colors.primaryTextColor,
)
}

View File

@ -279,7 +279,7 @@ fun HunkHeader(
Text(
text = hunk.header,
color = MaterialTheme.colors.primaryTextColor,
fontSize = 13.sp,
style = MaterialTheme.typography.body1,
)
Spacer(modifier = Modifier.weight(1f))
@ -346,8 +346,7 @@ fun DiffHeader(
Text(
text = filePath,
color = MaterialTheme.colors.primaryTextColor,
fontSize = 13.sp,
style = MaterialTheme.typography.body1,
modifier = Modifier.padding(horizontal = 16.dp),
)
@ -441,10 +440,9 @@ fun DiffLine(
modifier = Modifier
.padding(start = 8.dp)
.fillMaxSize(),
color = MaterialTheme.colors.primaryTextColor,
maxLines = 1,
fontFamily = FontFamily.Monospace,
fontSize = 13.sp,
style = MaterialTheme.typography.body2,
overflow = TextOverflow.Visible,
)
}
@ -454,13 +452,12 @@ fun DiffLine(
fun LineNumber(text: String) {
Text(
text = text,
color = MaterialTheme.colors.primaryTextColor,
modifier = Modifier
.background(MaterialTheme.colors.secondarySurface)
.fillMaxHeight()
.padding(horizontal = 4.dp),
fontFamily = FontFamily.Monospace,
fontSize = 13.sp,
style = MaterialTheme.typography.body2,
)
}

View File

@ -94,8 +94,7 @@ private fun Header(
) {
Text(
text = filePath,
color = MaterialTheme.colors.primaryTextColor,
fontSize = 13.sp,
style = MaterialTheme.typography.body1,
modifier = Modifier.padding(horizontal = 16.dp),
)
@ -212,15 +211,14 @@ fun HistoryCommit(commit: RevCommit, onCommitSelected: () -> Unit) {
Text(
text = commit.shortMessage,
maxLines = 1,
fontSize = 14.sp,
color = MaterialTheme.colors.primaryTextColor,
style = MaterialTheme.typography.body1,
)
Row {
Text(
text = commit.name.take(7),
maxLines = 1,
fontSize = 12.sp,
style = MaterialTheme.typography.body2,
color = MaterialTheme.colors.secondaryTextColor,
)
Spacer(modifier = Modifier.weight(1f))
@ -234,7 +232,7 @@ fun HistoryCommit(commit: RevCommit, onCommitSelected: () -> Unit) {
color = MaterialTheme.colors.secondaryTextColor,
maxLines = 1,
modifier = Modifier.padding(horizontal = 16.dp),
fontSize = 12.sp,
style = MaterialTheme.typography.body2,
tooltipTitle = date
)
}

View File

@ -178,8 +178,7 @@ fun MenuButton(
)
Text(
text = title,
fontSize = 12.sp,
color = MaterialTheme.colors.primaryTextColor
style = MaterialTheme.typography.body2,
)
}
}
@ -221,8 +220,7 @@ fun ExtendedMenuButton(
)
Text(
text = title,
fontSize = 12.sp,
color = MaterialTheme.colors.primaryTextColor
style = MaterialTheme.typography.body2,
)
}

View File

@ -143,7 +143,7 @@ fun RebaseCommit(
newMessage = it
onMessageChanged(it)
},
textStyle = LocalTextStyle.current.copy(fontSize = 12.sp),
textStyle = MaterialTheme.typography.body2,
)
}
@ -186,7 +186,7 @@ fun ActionDropdown(
) {
Text(
text = dropDownOption.toToken().replaceFirstChar { it.uppercase() },
fontSize = 14.sp,
style = MaterialTheme.typography.body1,
)
}
}

View File

@ -150,8 +150,7 @@ fun RepositoryOpenPage(tabViewModel: TabViewModel) {
) {
Text(
text = "${userInfo.name ?: "Name not set"} <${userInfo.email ?: "Email not set"}>",
color = MaterialTheme.colors.primaryTextColor,
fontSize = 12.sp,
style = MaterialTheme.typography.body2,
)
}
}

View File

@ -185,9 +185,14 @@ fun UncommitedChanges(
statusViewModel.updateCommitMessage(it)
},
enabled = !repositoryState.isRebasing,
label = { Text("Write your commit message here", fontSize = 14.sp) },
label = {
Text(
text = "Write your commit message here",
style = MaterialTheme.typography.body1.copy(color = MaterialTheme.colors.primaryVariant),
)
},
colors = textFieldColors(),
textStyle = TextStyle.Default.copy(fontSize = 14.sp),
textStyle = MaterialTheme.typography.body1,
)
when {
@ -394,12 +399,11 @@ fun AbortButton(modifier: Modifier, onClick: () -> Unit) {
modifier = modifier,
colors = ButtonDefaults.buttonColors(
backgroundColor = MaterialTheme.colors.abortButton,
contentColor = Color.White
)
) {
Text(
text = "Abort",
fontSize = 14.sp,
style = MaterialTheme.typography.body1.copy(color = MaterialTheme.colors.onError),
)
}
}
@ -419,12 +423,11 @@ fun ConfirmationButton(
shape = shape,
colors = ButtonDefaults.buttonColors(
backgroundColor = MaterialTheme.colors.primary,
contentColor = Color.White
)
) {
Text(
text = text,
fontSize = 14.sp,
style = MaterialTheme.typography.body1.copy(color = MaterialTheme.colors.onPrimary),
)
}
}
@ -458,7 +461,7 @@ private fun EntriesList(
fontWeight = FontWeight.Normal,
textAlign = TextAlign.Left,
color = MaterialTheme.colors.headerText,
fontSize = 13.sp,
style = MaterialTheme.typography.body1,
maxLines = 1,
)
@ -561,7 +564,7 @@ private fun FileEntry(
modifier = Modifier.weight(1f, fill = false),
maxLines = 1,
softWrap = false,
fontSize = 13.sp,
style = MaterialTheme.typography.body2,
overflow = TextOverflow.Ellipsis,
color = MaterialTheme.colors.secondaryTextColor,
)
@ -571,7 +574,7 @@ private fun FileEntry(
modifier = Modifier.weight(1f, fill = false),
maxLines = 1,
softWrap = false,
fontSize = 13.sp,
style = MaterialTheme.typography.body2,
color = MaterialTheme.colors.primaryTextColor,
)
}

View File

@ -73,8 +73,7 @@ fun WelcomePage(
Text(
"Version ${AppConstants.APP_VERSION}",
color = MaterialTheme.colors.primaryTextColor,
fontSize = 12.sp,
style = MaterialTheme.typography.body2,
maxLines = 1,
modifier = Modifier
.align(Alignment.BottomEnd)
@ -120,9 +119,8 @@ fun HomeButtons(
) {
Text(
text = AppConstants.APP_NAME,
fontSize = 32.sp,
style = MaterialTheme.typography.h1,
maxLines = 1,
color = MaterialTheme.colors.primaryTextColor,
modifier = Modifier.padding(bottom = 16.dp),
)
@ -150,9 +148,8 @@ fun HomeButtons(
)
Text(
text = "About Gitnuro",
fontSize = 18.sp,
color = MaterialTheme.colors.primaryTextColor,
text = "About",
style = MaterialTheme.typography.h3,
modifier = Modifier.padding(top = 16.dp, bottom = 8.dp),
)
@ -200,16 +197,15 @@ fun RecentRepositories(appStateManager: AppStateManager, tabViewModel: TabViewMo
val latestOpenedRepositoriesPaths = appStateManager.latestOpenedRepositoriesPaths
Text(
text = "Recent",
fontSize = 18.sp,
style = MaterialTheme.typography.h3,
modifier = Modifier.padding(top = 48.dp, bottom = 8.dp),
color = MaterialTheme.colors.primaryTextColor,
)
if (latestOpenedRepositoriesPaths.isEmpty()) {
Text(
"Nothing to see here, open a repository first!",
color = MaterialTheme.colors.secondaryTextColor,
fontSize = 14.sp,
style = MaterialTheme.typography.body1,
modifier = Modifier.padding(top = 16.dp)
)
} else {
@ -229,14 +225,15 @@ fun RecentRepositories(appStateManager: AppStateManager, tabViewModel: TabViewMo
) {
Text(
text = repoDirName,
fontSize = 14.sp,
style = MaterialTheme.typography.body1,
maxLines = 1,
color = MaterialTheme.colors.primaryVariant
)
}
Text(
text = repoDirPath,
fontSize = 14.sp,
style = MaterialTheme.typography.body1,
modifier = Modifier.padding(start = 4.dp),
maxLines = 1,
color = MaterialTheme.colors.secondaryTextColor
@ -275,6 +272,7 @@ fun ButtonTile(
Text(
text = title,
maxLines = 1,
style = MaterialTheme.typography.body1,
color = MaterialTheme.colors.primaryVariant,
)
}

View File

@ -29,7 +29,7 @@ fun AdjustableOutlinedTextField(
colors: TextFieldColors = outlinedTextFieldColors(),
maxLines: Int = Int.MAX_VALUE,
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
textStyle: TextStyle = LocalTextStyle.current.copy(fontSize = 14.sp),
textStyle: TextStyle = LocalTextStyle.current.copy(fontSize = MaterialTheme.typography.body1.fontSize),
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
) {
val textColor = textStyle.color.takeOrElse {

View File

@ -156,7 +156,7 @@ fun Tab(title: MutableState<String>, selected: Boolean, onClick: () -> Unit, onC
.weight(1f),
color = MaterialTheme.colors.primaryTextColor,
overflow = TextOverflow.Visible,
fontSize = 14.sp,
style = MaterialTheme.typography.body1,
maxLines = 1,
)
IconButton(

View File

@ -4,6 +4,7 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
@ -30,7 +31,7 @@ fun SecondaryButton(
) {
Text(
text = text,
fontSize = 12.sp,
style = MaterialTheme.typography.body2,
color = textColor,
modifier = Modifier.padding(vertical = 4.dp, horizontal = 16.dp)
)

View File

@ -56,7 +56,7 @@ fun SideMenuEntry(
.padding(horizontal = 8.dp)
.weight(1f),
maxLines = 1,
fontSize = 14.sp,
style = MaterialTheme.typography.body2,
color = MaterialTheme.colors.primaryTextColor,
overflow = TextOverflow.Ellipsis,
)
@ -66,7 +66,7 @@ fun SideMenuEntry(
} else
Text(
text = itemsCount.toString(),
fontSize = 14.sp,
style = MaterialTheme.typography.body2,
color = MaterialTheme.colors.secondaryTextColor,
modifier = Modifier.padding(end = 16.dp),
)

View File

@ -61,7 +61,7 @@ fun SideMenuSubentry(
text = text,
modifier = Modifier.weight(1f, fill = true),
maxLines = 1,
fontSize = 12.sp,
style = MaterialTheme.typography.body2,
color = MaterialTheme.colors.primaryTextColor,
softWrap = false,
)

View File

@ -4,6 +4,7 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.material.DropdownMenuItem
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
@ -38,7 +39,7 @@ fun DropDownContent(
Text(
text = dropDownContentData.label,
fontSize = 13.sp,
style = MaterialTheme.typography.body2,
modifier = Modifier.padding(end = 8.dp),
maxLines = 1,
)

View File

@ -36,21 +36,18 @@ fun AppInfoDialog(
Column(modifier = Modifier.padding(16.dp)) {
Text(
AppConstants.APP_NAME,
fontSize = 24.sp,
color = MaterialTheme.colors.primaryTextColor,
style = MaterialTheme.typography.h2,
)
Text(
AppConstants.APP_DESCRIPTION,
fontSize = 14.sp,
color = MaterialTheme.colors.primaryTextColor,
style = MaterialTheme.typography.body1,
modifier = Modifier.padding(top = 16.dp)
)
Text(
"Gitnuro has been possible thanks to the following open source projects:",
fontSize = 14.sp,
color = MaterialTheme.colors.primaryTextColor,
style = MaterialTheme.typography.body1,
modifier = Modifier.padding(vertical = 16.dp)
)
}

View File

@ -89,8 +89,7 @@ fun AuthorDialog(
)
Text(
text = "Repository-level values will override global values",
color = MaterialTheme.colors.primaryTextColor,
fontSize = 12.sp,
style = MaterialTheme.typography.body2,
modifier = Modifier
.padding(top = 8.dp, bottom = 8.dp, start = 4.dp),
)
@ -142,8 +141,7 @@ private fun TextInput(
) {
Text(
text = title,
color = MaterialTheme.colors.primaryTextColor,
fontSize = 14.sp,
style = MaterialTheme.typography.body1,
modifier = Modifier
.width(80.dp)
.padding(end = 16.dp),

View File

@ -105,7 +105,7 @@ private fun CloneInput(
next = directoryFocusRequester
},
label = { Text("URL") },
textStyle = TextStyle(fontSize = 14.sp, color = MaterialTheme.colors.primaryTextColor),
textStyle = MaterialTheme.typography.body1,
maxLines = 1,
value = url,
colors = outlinedTextFieldColors(),
@ -130,7 +130,7 @@ private fun CloneInput(
previous = urlFocusRequester
next = directoryButtonFocusRequester
},
textStyle = TextStyle(fontSize = 14.sp, color = MaterialTheme.colors.primaryTextColor),
textStyle = MaterialTheme.typography.body1,
maxLines = 1,
label = { Text("Directory") },
value = directory,

View File

@ -196,7 +196,7 @@ fun EditRemotesDialog(
modifier = Modifier
.fillMaxWidth()
.background(MaterialTheme.colors.surface)
.padding(horizontal = 8.dp)
.padding(horizontal = 16.dp)
) {
if (selectedRemote != null) {
Column {
@ -204,7 +204,7 @@ fun EditRemotesDialog(
Text(
text = "New remote name",
color = MaterialTheme.colors.primaryTextColor,
modifier = Modifier.padding(vertical = 8.dp),
modifier = Modifier.padding(top = 8.dp),
)
AdjustableOutlinedTextField(
@ -230,7 +230,7 @@ fun EditRemotesDialog(
Text(
text = "Fetch URL",
color = MaterialTheme.colors.primaryTextColor,
modifier = Modifier.padding(vertical = 8.dp),
modifier = Modifier.padding(top = 8.dp),
)
AdjustableOutlinedTextField(
@ -250,7 +250,7 @@ fun EditRemotesDialog(
Text(
text = "Push URL",
color = MaterialTheme.colors.primaryTextColor,
modifier = Modifier.padding(vertical = 8.dp),
modifier = Modifier.padding(top = 8.dp),
)
AdjustableOutlinedTextField(

View File

@ -53,8 +53,13 @@ fun NewBranchDialog(
},
value = branchField,
singleLine = true,
label = { Text("New branch name", fontSize = 14.sp) },
textStyle = TextStyle(fontSize = 14.sp, color = MaterialTheme.colors.primaryTextColor),
label = {
Text(
"New branch name",
style = MaterialTheme.typography.body1.copy(MaterialTheme.colors.primaryVariant),
)
},
textStyle = MaterialTheme.typography.body1,
colors = outlinedTextFieldColors(),
onValueChange = {
branchField = it

View File

@ -53,8 +53,13 @@ fun NewTagDialog(
},
value = tagField,
singleLine = true,
label = { Text("New tag name", fontSize = 14.sp) },
textStyle = TextStyle(fontSize = 14.sp, color = MaterialTheme.colors.primaryTextColor),
label = {
Text(
"New tag name",
style = MaterialTheme.typography.body1.copy(MaterialTheme.colors.primaryVariant),
)
},
textStyle = MaterialTheme.typography.body1,
colors = outlinedTextFieldColors(),
onValueChange = {
tagField = it

View File

@ -60,8 +60,13 @@ fun PasswordDialog(
},
value = passwordField,
singleLine = true,
label = { Text("Password", fontSize = 14.sp) },
textStyle = TextStyle(fontSize = 14.sp, color = MaterialTheme.colors.primaryTextColor),
label = {
Text(
"Password",
style = MaterialTheme.typography.body1.copy(MaterialTheme.colors.primaryVariant),
)
},
textStyle = MaterialTheme.typography.body1,
colors = outlinedTextFieldColors(),
onValueChange = {
passwordField = it

View File

@ -113,7 +113,10 @@ fun SettingsDialog(
onDismiss()
}
) {
Text("Close")
Text(
"Close",
style = MaterialTheme.typography.body1.copy(color = MaterialTheme.colors.primaryVariant)
)
}
}
}
@ -149,8 +152,8 @@ fun <T : DropDownOption> SettingDropDown(
OutlinedButton(onClick = { showThemeDropdown = true }) {
Text(
text = currentOption.optionName,
style = MaterialTheme.typography.body1,
color = MaterialTheme.colors.primaryTextColor,
fontSize = 14.sp,
)
}
@ -192,8 +195,7 @@ fun SettingButton(
OutlinedButton(onClick = onClick) {
Text(
text = buttonText,
color = MaterialTheme.colors.primaryTextColor,
fontSize = 14.sp,
style = MaterialTheme.typography.body1,
)
}
}
@ -280,15 +282,14 @@ private fun FieldTitles(
) {
Text(
text = title,
color = MaterialTheme.colors.primaryTextColor,
fontSize = 14.sp,
style = MaterialTheme.typography.body1,
)
Text(
text = subtitle,
color = MaterialTheme.colors.secondaryTextColor,
modifier = Modifier.padding(top = 4.dp),
fontSize = 12.sp,
style = MaterialTheme.typography.body2,
)
}
}

View File

@ -52,8 +52,13 @@ fun StashWithMessageDialog(
}
},
value = textField,
label = { Text("New stash message", fontSize = 14.sp) },
textStyle = TextStyle(fontSize = 14.sp, color = MaterialTheme.colors.primaryTextColor),
label = {
Text(
"New stash message",
style = MaterialTheme.typography.body1.copy(color = MaterialTheme.colors.primaryVariant),
)
},
textStyle = MaterialTheme.typography.body1,
colors = outlinedTextFieldColors(),
onValueChange = {
textField = it

View File

@ -69,8 +69,13 @@ fun UserPasswordDialog(
value = userField,
singleLine = true,
colors = outlinedTextFieldColors(),
label = { Text("User", fontSize = 14.sp) },
textStyle = TextStyle(fontSize = 14.sp, color = MaterialTheme.colors.primaryTextColor),
label = {
Text(
"User",
style = MaterialTheme.typography.body1.copy(color = MaterialTheme.colors.primaryVariant),
)
},
textStyle = MaterialTheme.typography.body1,
onValueChange = {
userField = it
},
@ -92,8 +97,14 @@ fun UserPasswordDialog(
},
value = passwordField,
singleLine = true,
label = { Text("Password", fontSize = 14.sp) },
textStyle = TextStyle(fontSize = 14.sp, color = MaterialTheme.colors.primaryTextColor),
label = {
Text(
"Password",
style = MaterialTheme.typography.body1,
color = MaterialTheme.colors.primaryVariant,
)
},
textStyle = MaterialTheme.typography.body1,
colors = outlinedTextFieldColors(),
onValueChange = {
passwordField = it

View File

@ -10,6 +10,7 @@ import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.*
@ -237,7 +238,7 @@ fun Log(
text = "Scroll to top",
modifier = Modifier.padding(start = 8.dp),
color = MaterialTheme.colors.onPrimary,
fontSize = 14.sp,
style = MaterialTheme.typography.body1,
)
}
}
@ -309,7 +310,7 @@ fun SearchFilter(
Text("Search by message, author name or commit ID")
},
colors = textFieldColors(),
textStyle = TextStyle.Default.copy(fontSize = 14.sp, color = MaterialTheme.colors.primaryTextColor),
textStyle = MaterialTheme.typography.body1,
trailingIcon = {
Row(
modifier = Modifier
@ -396,7 +397,7 @@ fun MessagesList(
)
}
}
items(items = commitList) { graphNode ->
items(items = commitList) {graphNode ->
CommitLine(
graphWidth = graphWidth,
logViewModel = logViewModel,
@ -425,8 +426,8 @@ fun MessagesList(
Text(
text = "The commits list has been limited to $commitsLimit. Access the settings to change it.",
color = MaterialTheme.colors.primaryTextColor,
fontSize = 14.sp,
fontStyle = FontStyle.Italic,
style = MaterialTheme.typography.body2,
maxLines = 1,
)
}
@ -574,7 +575,7 @@ fun GraphHeader(
modifier = Modifier.width(graphWidth).padding(start = 16.dp),
text = "Graph",
color = MaterialTheme.colors.headerText,
fontSize = 14.sp,
style = MaterialTheme.typography.body1,
maxLines = 1,
)
@ -592,7 +593,7 @@ fun GraphHeader(
.weight(1f),
text = "Message",
color = MaterialTheme.colors.headerText,
fontSize = 14.sp,
style = MaterialTheme.typography.body1,
maxLines = 1,
)
@ -640,7 +641,7 @@ fun UncommitedChangesLine(
text = text,
fontStyle = FontStyle.Italic,
modifier = Modifier.padding(start = 16.dp),
fontSize = 14.sp,
style = MaterialTheme.typography.body2,
maxLines = 1,
color = MaterialTheme.colors.primaryTextColor,
)
@ -703,8 +704,7 @@ fun SummaryEntry(
) {
Text(
text = count.toString(),
color = MaterialTheme.colors.primaryTextColor,
fontSize = 14.sp,
style = MaterialTheme.typography.body2,
)
Icon(
@ -847,7 +847,7 @@ fun CommitMessage(
modifier = Modifier
.padding(start = 8.dp)
.weight(1f),
fontSize = 14.sp,
style = MaterialTheme.typography.body2,
color = if (matchesSearchFilter == false) MaterialTheme.colors.secondaryTextColor else MaterialTheme.colors.primaryTextColor,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
@ -856,7 +856,7 @@ fun CommitMessage(
Text(
text = commit.authorIdent.`when`.toSmartSystemString(),
modifier = Modifier.padding(horizontal = 16.dp),
fontSize = 12.sp,
fontSize = 10.sp,
color = MaterialTheme.colors.secondaryTextColor,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
@ -1139,8 +1139,7 @@ fun RefChip(
}
Text(
text = ref.simpleLogName,
color = MaterialTheme.colors.primaryTextColor,
fontSize = 13.sp,
style = MaterialTheme.typography.body2,
maxLines = 1,
modifier = Modifier.padding(horizontal = 6.dp)
)