From b0c513228ed58b6c3cf387d1bfa2e030fa3f3ce7 Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Tue, 18 Jun 2024 14:55:41 +1000 Subject: [PATCH] Button in new message is not slim but the regular size --- .../conversation/newmessage/NewMessageFragment.kt | 3 ++- .../thoughtcrime/securesms/ui/components/Button.kt | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/newmessage/NewMessageFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/newmessage/NewMessageFragment.kt index 23f3c46d99..6fc830370f 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/newmessage/NewMessageFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/newmessage/NewMessageFragment.kt @@ -56,6 +56,7 @@ import org.thoughtcrime.securesms.ui.SessionColorsParameterProvider import org.thoughtcrime.securesms.ui.components.AppBar import org.thoughtcrime.securesms.ui.components.BorderlessButtonWithIcon import org.thoughtcrime.securesms.ui.components.MaybeScanQrCode +import org.thoughtcrime.securesms.ui.components.OutlineButton import org.thoughtcrime.securesms.ui.components.SessionOutlinedTextField import org.thoughtcrime.securesms.ui.components.SessionTabRow import org.thoughtcrime.securesms.ui.components.SlimOutlineButton @@ -175,7 +176,7 @@ fun EnterAccountId( .fillMaxWidth(), ) { onHelp() } - SlimOutlineButton( + OutlineButton( modifier = Modifier .align(Alignment.CenterHorizontally) .padding(horizontal = LocalDimensions.current.marginLarge) diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/components/Button.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/components/Button.kt index b8e0b8979a..19ea2f47f3 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/components/Button.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/components/Button.kt @@ -122,6 +122,18 @@ fun Button( Button(text, onClick, color, ButtonType.Outline, modifier, enabled) } +@Composable fun OutlineButton(modifier: Modifier = Modifier, color: Color = LocalColors.current.buttonOutline, enabled: Boolean = true, onClick: () -> Unit, content: @Composable () -> Unit) { + Button( + onClick = onClick, + color = color, + type = ButtonType.Outline, + modifier = modifier, + enabled = enabled + ){ + content() + } +} + @Composable fun PrimaryOutlineButton(text: String, modifier: Modifier = Modifier, enabled: Boolean = true, onClick: () -> Unit) { Button(text, onClick, LocalColors.current.primary, ButtonType.Outline, modifier, enabled) }