From ca3f4c3ec613180fdd43056f99ffcdf32d0eff77 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Sun, 25 Jun 2023 16:49:33 -0400 Subject: [PATCH] Moves MaxWidth for Chat bubbles to Shapes --- .../vitorpamplona/amethyst/ui/note/ChatroomMessageCompose.kt | 5 +++-- .../main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ChatroomMessageCompose.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ChatroomMessageCompose.kt index 487888fa3..ca865e93c 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ChatroomMessageCompose.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ChatroomMessageCompose.kt @@ -71,6 +71,7 @@ import com.vitorpamplona.amethyst.ui.components.RobohashFallbackAsyncImage import com.vitorpamplona.amethyst.ui.components.SensitivityWarning import com.vitorpamplona.amethyst.ui.components.TranslatableRichTextViewer import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel +import com.vitorpamplona.amethyst.ui.theme.ChatBubbleMaxSizeModifier import com.vitorpamplona.amethyst.ui.theme.ChatBubbleShapeMe import com.vitorpamplona.amethyst.ui.theme.ChatBubbleShapeThem import com.vitorpamplona.amethyst.ui.theme.DoubleHorzSpacer @@ -239,7 +240,7 @@ fun NormalChatNote( ) { val drawAuthorInfo by remember { derivedStateOf { - (innerQuote || !accountViewModel.isLoggedUser(note.author)) && note.event !is PrivateDmEvent + note.event !is PrivateDmEvent && (innerQuote || !accountViewModel.isLoggedUser(note.author)) } } @@ -302,7 +303,7 @@ fun NormalChatNote( var popupExpanded by remember { mutableStateOf(false) } val modif2 = remember { - if (innerQuote) Modifier else Modifier.fillMaxWidth(0.85f) + if (innerQuote) Modifier else ChatBubbleMaxSizeModifier } val clickableModifier = remember { diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt index 766fdccde..73b82d841 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt @@ -83,3 +83,5 @@ val AccountPictureModifier = Modifier.width(55.dp).height(55.dp).clip(shape = Ci val ShowMoreRelaysButtonIconButtonModifier = Modifier.size(24.dp) val ShowMoreRelaysButtonIconModifier = Modifier.size(15.dp) val ShowMoreRelaysButtonBoxModifer = Modifier.fillMaxWidth().height(25.dp) + +val ChatBubbleMaxSizeModifier = Modifier.fillMaxWidth(0.85f)