multiplatform: section item text width limitation (#2955)

This commit is contained in:
Stanislav Dmitrenko 2023-08-21 22:40:21 +03:00 committed by GitHub
parent 788ee15942
commit 36e5fc64a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -390,11 +390,14 @@ fun SettingsActionItemWithContent(icon: Painter?, text: String? = null, click: (
TextIconSpaced(extraPadding) TextIconSpaced(extraPadding)
} }
if (text != null) { if (text != null) {
Text(text, Modifier.weight(1f), color = if (disabled) MaterialTheme.colors.secondary else MaterialTheme.colors.onBackground) val padding = with(LocalDensity.current) { 6.sp.toDp() }
Text(text, Modifier.weight(1f).padding(vertical = padding), color = if (disabled) MaterialTheme.colors.secondary else MaterialTheme.colors.onBackground)
Spacer(Modifier.width(DEFAULT_PADDING)) Spacer(Modifier.width(DEFAULT_PADDING))
} }
Row(Modifier.widthIn(max = (windowWidth() - DEFAULT_PADDING * 2) / 2)) {
content() content()
} }
}
} }
@Composable @Composable