Add default style for dropdown menu item text.

This commit is contained in:
jeffrey-signal
2025-10-14 07:37:56 -04:00
committed by Cody Henthorne
parent e6399517ee
commit 56244ad873
5 changed files with 24 additions and 40 deletions

View File

@@ -554,8 +554,7 @@ fun DeviceRow(device: Device, setDeviceToRemove: (Device) -> Unit, onEditDevice:
)
Text(
text = stringResource(R.string.LinkDeviceFragment__unlink),
modifier = Modifier.padding(horizontal = 16.dp),
style = MaterialTheme.typography.bodyLarge
modifier = Modifier.padding(horizontal = 16.dp)
)
}
},
@@ -579,8 +578,7 @@ fun DeviceRow(device: Device, setDeviceToRemove: (Device) -> Unit, onEditDevice:
)
Text(
text = stringResource(R.string.LinkDeviceFragment__edit_name),
modifier = Modifier.padding(horizontal = 16.dp),
style = MaterialTheme.typography.bodyLarge
modifier = Modifier.padding(horizontal = 16.dp)
)
}
},

View File

@@ -537,8 +537,7 @@ private fun StoryDropDownItems(callback: MainToolbarCallback, onOptionSelected:
DropdownMenus.Item(
text = {
Text(
text = stringResource(R.string.StoriesLandingFragment__story_privacy),
style = MaterialTheme.typography.bodyLarge
text = stringResource(R.string.StoriesLandingFragment__story_privacy)
)
},
onClick = {
@@ -553,8 +552,7 @@ private fun CallDropdownItems(callFilter: CallLogFilter, callback: MainToolbarCa
DropdownMenus.Item(
text = {
Text(
text = stringResource(R.string.CallLogFragment__clear_call_history),
style = MaterialTheme.typography.bodyLarge
text = stringResource(R.string.CallLogFragment__clear_call_history)
)
},
onClick = {
@@ -567,8 +565,7 @@ private fun CallDropdownItems(callFilter: CallLogFilter, callback: MainToolbarCa
DropdownMenus.Item(
text = {
Text(
text = stringResource(R.string.CallLogFragment__filter_missed_calls),
style = MaterialTheme.typography.bodyLarge
text = stringResource(R.string.CallLogFragment__filter_missed_calls)
)
},
onClick = {
@@ -580,8 +577,7 @@ private fun CallDropdownItems(callFilter: CallLogFilter, callback: MainToolbarCa
DropdownMenus.Item(
text = {
Text(
text = stringResource(R.string.CallLogFragment__clear_filter),
style = MaterialTheme.typography.bodyLarge
text = stringResource(R.string.CallLogFragment__clear_filter)
)
},
onClick = {
@@ -594,8 +590,7 @@ private fun CallDropdownItems(callFilter: CallLogFilter, callback: MainToolbarCa
DropdownMenus.Item(
text = {
Text(
text = stringResource(R.string.text_secure_normal__menu_settings),
style = MaterialTheme.typography.bodyLarge
text = stringResource(R.string.text_secure_normal__menu_settings)
)
},
onClick = {
@@ -607,8 +602,7 @@ private fun CallDropdownItems(callFilter: CallLogFilter, callback: MainToolbarCa
DropdownMenus.Item(
text = {
Text(
text = stringResource(R.string.ConversationListFragment__notification_profile),
style = MaterialTheme.typography.bodyLarge
text = stringResource(R.string.ConversationListFragment__notification_profile)
)
},
onClick = {
@@ -623,8 +617,7 @@ private fun ChatDropdownItems(state: MainToolbarState, callback: MainToolbarCall
DropdownMenus.Item(
text = {
Text(
text = stringResource(R.string.text_secure_normal__menu_new_group),
style = MaterialTheme.typography.bodyLarge
text = stringResource(R.string.text_secure_normal__menu_new_group)
)
},
onClick = {
@@ -637,8 +630,7 @@ private fun ChatDropdownItems(state: MainToolbarState, callback: MainToolbarCall
DropdownMenus.Item(
text = {
Text(
text = stringResource(R.string.text_secure_normal__menu_clear_passphrase),
style = MaterialTheme.typography.bodyLarge
text = stringResource(R.string.text_secure_normal__menu_clear_passphrase)
)
},
onClick = {
@@ -651,8 +643,7 @@ private fun ChatDropdownItems(state: MainToolbarState, callback: MainToolbarCall
DropdownMenus.Item(
text = {
Text(
text = stringResource(R.string.text_secure_normal__mark_all_as_read),
style = MaterialTheme.typography.bodyLarge
text = stringResource(R.string.text_secure_normal__mark_all_as_read)
)
},
onClick = {
@@ -664,8 +655,7 @@ private fun ChatDropdownItems(state: MainToolbarState, callback: MainToolbarCall
DropdownMenus.Item(
text = {
Text(
text = stringResource(R.string.text_secure_normal__invite_friends),
style = MaterialTheme.typography.bodyLarge
text = stringResource(R.string.text_secure_normal__invite_friends)
)
},
onClick = {
@@ -678,8 +668,7 @@ private fun ChatDropdownItems(state: MainToolbarState, callback: MainToolbarCall
DropdownMenus.Item(
text = {
Text(
text = stringResource(R.string.text_secure_normal__filter_unread_chats),
style = MaterialTheme.typography.bodyLarge
text = stringResource(R.string.text_secure_normal__filter_unread_chats)
)
},
onClick = {
@@ -691,8 +680,7 @@ private fun ChatDropdownItems(state: MainToolbarState, callback: MainToolbarCall
DropdownMenus.Item(
text = {
Text(
text = stringResource(R.string.text_secure_normal__clear_unread_filter),
style = MaterialTheme.typography.bodyLarge
text = stringResource(R.string.text_secure_normal__clear_unread_filter)
)
},
onClick = {
@@ -705,8 +693,7 @@ private fun ChatDropdownItems(state: MainToolbarState, callback: MainToolbarCall
DropdownMenus.Item(
text = {
Text(
text = stringResource(R.string.text_secure_normal__menu_settings),
style = MaterialTheme.typography.bodyLarge
text = stringResource(R.string.text_secure_normal__menu_settings)
)
},
onClick = {
@@ -718,8 +705,7 @@ private fun ChatDropdownItems(state: MainToolbarState, callback: MainToolbarCall
DropdownMenus.Item(
text = {
Text(
text = stringResource(R.string.ConversationListFragment__notification_profile),
style = MaterialTheme.typography.bodyLarge
text = stringResource(R.string.ConversationListFragment__notification_profile)
)
},
onClick = {

View File

@@ -332,12 +332,7 @@ private fun TopAppBar(
offsetY = 0.dp
) {
DropdownMenus.Item(
text = {
Text(
text = stringResource(R.string.StickerManagement_menu_select_packs),
style = MaterialTheme.typography.bodyLarge
)
},
text = { Text(text = stringResource(R.string.StickerManagement_menu_select_packs)) },
onClick = {
onSetMultiSelectModeEnabled(true)
menuController.hide()

View File

@@ -388,7 +388,6 @@ private fun MenuItem(
)
Text(
text = text,
style = MaterialTheme.typography.bodyLarge,
modifier = Modifier.padding(horizontal = 16.dp)
)
}

View File

@@ -11,8 +11,10 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
@@ -69,7 +71,11 @@ object DropdownMenus {
) {
DropdownMenuItem(
contentPadding = contentPadding,
text = text,
text = {
CompositionLocalProvider(LocalTextStyle provides MaterialTheme.typography.bodyLarge) {
text()
}
},
onClick = onClick,
modifier = modifier
)