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

View File

@ -7,3 +7,5 @@ weather.app.my.locations.empty.list.placeholder.icon.content.description=Empty l
weather.app.search.toolbar.menu.add.button.text=Add 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.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