Use localized content description for Clear button icon

This commit is contained in:
Nebojsa Vuksic 2025-08-01 11:37:13 +02:00
parent 80a485b4bd
commit 5b4ff635c4
2 changed files with 12 additions and 7 deletions

View File

@ -26,6 +26,7 @@ import org.jetbrains.jewel.ui.component.PopupMenu
import org.jetbrains.jewel.ui.component.Text
import org.jetbrains.jewel.ui.component.TextField
import org.jetbrains.jewel.ui.icons.AllIconsKeys
import org.jetbrains.plugins.template.ComposeTemplateBundle
import org.jetbrains.plugins.template.weatherApp.model.PreviewableItem
import org.jetbrains.plugins.template.weatherApp.model.Searchable
import org.jetbrains.plugins.template.weatherApp.services.SearchAutoCompletionItemProvider
@ -125,12 +126,14 @@ internal fun CloseIconButton(onClick: () -> Unit) {
Icon(
key = if (hovered) AllIconsKeys.Actions.CloseHovered else AllIconsKeys.Actions.Close,
contentDescription = "Clear",
modifier = Modifier.pointerHoverIcon(PointerIcon.Default).clickable(
interactionSource = interactionSource,
indication = null,
role = Role.Button,
) { onClick() },
contentDescription = ComposeTemplateBundle.message("weather.app.clear.button.content.description"),
modifier = Modifier
.pointerHoverIcon(PointerIcon.Default)
.clickable(
interactionSource = interactionSource,
indication = null,
role = Role.Button,
) { onClick() },
)
}

View File

@ -6,4 +6,6 @@ weather.app.my.locations.empty.list.placeholder.text=No locations added yet. Go
weather.app.my.locations.empty.list.placeholder.icon.content.description=Empty list icon.
weather.app.search.toolbar.menu.add.button.text=Add
weather.app.search.toolbar.menu.add.button.content.description=Add a place to a watch list.
weather.app.7days.forecast.title.text=7-day Forecast
weather.app.7days.forecast.title.text=7-day Forecast
weather.app.clear.button.content.description=Clear