From 6acacf5edb424c9b6a2c72cc43b827982bdc8547 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Mon, 29 Jan 2024 21:12:41 -0700 Subject: [PATCH] Limit file titles to one line in toolbar --- app/src/main/java/com/wbrawner/simplemarkdown/ui/MainScreen.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/ui/MainScreen.kt b/app/src/main/java/com/wbrawner/simplemarkdown/ui/MainScreen.kt index bcb3e2f..2a0ee8f 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/ui/MainScreen.kt +++ b/app/src/main/java/com/wbrawner/simplemarkdown/ui/MainScreen.kt @@ -64,6 +64,7 @@ import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.input.KeyboardCapitalization import androidx.compose.ui.text.input.TextFieldValue +import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import androidx.core.content.ContextCompat.startActivity import androidx.navigation.NavController @@ -364,7 +365,7 @@ fun MarkdownTopAppBar( ) { val coroutineScope = rememberCoroutineScope() TopAppBar(title = { - Text(title) + Text(text = title, maxLines = 1, overflow = TextOverflow.Ellipsis) }, navigationIcon = { val (icon, contentDescription, onClick) = remember { if (backAsUp) {