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)
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) }
IconButton(
onClick = { showDialog = true }
) { Icon(painterResource(R.drawable.ic_bin), null) }
) { Icon(painterResource(R.drawable.ic_bin), stringResource(R.string.delete)) }
IconButton(
onClick = {
onDismissRequest()
SettingsDestination.navigateTo(targetScreen + item)
}
) { Icon(painterResource(R.drawable.ic_edit), null) }
) { Icon(painterResource(R.drawable.ic_edit), "edit") }
if (showDialog)
ConfirmationDialog(
onDismissRequest = { showDialog = false },

View file

@ -88,7 +88,7 @@ fun LayoutEditDialog(
onValueChange = { displayNameValue = it },
isError = !nameValid,
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 ->

View file

@ -142,7 +142,7 @@ private fun AddLayoutRow(onNewLayout: (String) -> Unit, layoutType: LayoutType,
IconButton(
enabled = textValue.text.isNotEmpty() && LayoutUtilsCustom.getLayoutName(textValue.text, layoutType) !in userLayouts,
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) }
IconButton(
onClick = { showDeleteDialog = true }
) { Icon(painterResource(R.drawable.ic_bin), null) }
) { Icon(painterResource(R.drawable.ic_bin), stringResource(R.string.delete)) }
if (showDeleteDialog) {
val inUse = SubtypeSettings.getAdditionalSubtypes().any { st ->
val map = LayoutType.getLayoutMap(st.getExtraValueOf(ExtraValue.KEYBOARD_LAYOUT_SET))
@ -208,7 +208,7 @@ private fun LayoutItemRow(
}
IconButton(
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)
Box(Modifier.size(40.dp), contentAlignment = Alignment.Center) {
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) {
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))
}
}
}