add contentDescription for some more icons

This commit is contained in:
Helium314 2025-02-24 18:16:38 +01:00
parent d5d672ee33
commit f076d66f93
4 changed files with 9 additions and 9 deletions

View file

@ -172,7 +172,7 @@ private fun AddColorRow(onDismissRequest: () -> Unit, userColors: Collection<Str
SettingsDestination.navigateTo(targetScreen) SettingsDestination.navigateTo(targetScreen)
keyboardNeedsReload = true keyboardNeedsReload = true
} }
) { Icon(painterResource(R.drawable.ic_edit), null) } ) { Icon(painterResource(R.drawable.ic_edit), "edit") }
} }
} }
@ -209,13 +209,13 @@ private fun ColorItemRow(onDismissRequest: () -> Unit, item: String, isSelected:
var showDialog by remember { mutableStateOf(false) } var showDialog by remember { mutableStateOf(false) }
IconButton( IconButton(
onClick = { showDialog = true } onClick = { showDialog = true }
) { Icon(painterResource(R.drawable.ic_bin), null) } ) { Icon(painterResource(R.drawable.ic_bin), stringResource(R.string.delete)) }
IconButton( IconButton(
onClick = { onClick = {
onDismissRequest() onDismissRequest()
SettingsDestination.navigateTo(targetScreen + item) SettingsDestination.navigateTo(targetScreen + item)
} }
) { Icon(painterResource(R.drawable.ic_edit), null) } ) { Icon(painterResource(R.drawable.ic_edit), "edit") }
if (showDialog) if (showDialog)
ConfirmationDialog( ConfirmationDialog(
onDismissRequest = { showDialog = false }, onDismissRequest = { showDialog = false },

View file

@ -88,7 +88,7 @@ fun LayoutEditDialog(
onValueChange = { displayNameValue = it }, onValueChange = { displayNameValue = it },
isError = !nameValid, isError = !nameValid,
supportingText = { if (!nameValid) Text(stringResource(R.string.name_invalid)) }, supportingText = { if (!nameValid) Text(stringResource(R.string.name_invalid)) },
trailingIcon = { if (!nameValid) Icon(painterResource(R.drawable.ic_close), null) }, trailingIcon = { if (!nameValid) Icon(painterResource(R.drawable.ic_close), stringResource(R.string.name_invalid)) },
) )
}, },
checkTextValid = { text -> checkTextValid = { text ->

View file

@ -142,7 +142,7 @@ private fun AddLayoutRow(onNewLayout: (String) -> Unit, layoutType: LayoutType,
IconButton( IconButton(
enabled = textValue.text.isNotEmpty() && LayoutUtilsCustom.getLayoutName(textValue.text, layoutType) !in userLayouts, enabled = textValue.text.isNotEmpty() && LayoutUtilsCustom.getLayoutName(textValue.text, layoutType) !in userLayouts,
onClick = { onNewLayout(textValue.text) } onClick = { onNewLayout(textValue.text) }
) { Icon(painterResource(R.drawable.ic_edit), null) } ) { Icon(painterResource(R.drawable.ic_edit), "edit") }
} }
} }
@ -188,7 +188,7 @@ private fun LayoutItemRow(
var showDeleteDialog by remember { mutableStateOf(false) } var showDeleteDialog by remember { mutableStateOf(false) }
IconButton( IconButton(
onClick = { showDeleteDialog = true } onClick = { showDeleteDialog = true }
) { Icon(painterResource(R.drawable.ic_bin), null) } ) { Icon(painterResource(R.drawable.ic_bin), stringResource(R.string.delete)) }
if (showDeleteDialog) { if (showDeleteDialog) {
val inUse = SubtypeSettings.getAdditionalSubtypes().any { st -> val inUse = SubtypeSettings.getAdditionalSubtypes().any { st ->
val map = LayoutType.getLayoutMap(st.getExtraValueOf(ExtraValue.KEYBOARD_LAYOUT_SET)) val map = LayoutType.getLayoutMap(st.getExtraValueOf(ExtraValue.KEYBOARD_LAYOUT_SET))
@ -208,7 +208,7 @@ private fun LayoutItemRow(
} }
IconButton( IconButton(
onClick = { onClickEdit(layoutName to (if (isCustom) null else LayoutUtils.getContent(layoutType, layoutName, ctx))) } onClick = { onClickEdit(layoutName to (if (isCustom) null else LayoutUtils.getContent(layoutType, layoutName, ctx))) }
) { Icon(painterResource(R.drawable.ic_edit), null) } ) { Icon(painterResource(R.drawable.ic_edit), "edit") }
} }
} }

View file

@ -120,10 +120,10 @@ fun KeyboardIconsSet.GetIcon(name: String?) {
val drawable = getNewDrawable(name, ctx) val drawable = getNewDrawable(name, ctx)
Box(Modifier.size(40.dp), contentAlignment = Alignment.Center) { Box(Modifier.size(40.dp), contentAlignment = Alignment.Center) {
if (drawable is VectorDrawable) if (drawable is VectorDrawable)
Icon(painterResource(iconIds[name?.lowercase()]!!), null, Modifier.fillMaxSize(0.8f)) Icon(painterResource(iconIds[name?.lowercase()]!!), name, Modifier.fillMaxSize(0.8f))
else if (drawable != null) { else if (drawable != null) {
val px = TypedValueCompat.dpToPx(40f, ctx.resources.displayMetrics).toInt() val px = TypedValueCompat.dpToPx(40f, ctx.resources.displayMetrics).toInt()
Icon(drawable.toBitmap(px, px).asImageBitmap(), null, Modifier.fillMaxSize(0.8f)) Icon(drawable.toBitmap(px, px).asImageBitmap(), name, Modifier.fillMaxSize(0.8f))
} }
} }
} }