Skip to content

Commit

Permalink
Polish the query clear button
Browse files Browse the repository at this point in the history
  • Loading branch information
X1nto committed Jan 6, 2025
1 parent 7c4272d commit 21995df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,13 @@ fun PatchesSelectorScreen(
transitionSpec = { fadeIn() togetherWith fadeOut() }
) { searchExpanded ->
if (searchExpanded) {
IconButton(onClick = { setQuery("") }) {
IconButton(
onClick = { setQuery("") },
enabled = query.isNotEmpty()
) {
Icon(
imageVector = Icons.Filled.Close,
contentDescription = stringResource(R.string.close)
contentDescription = stringResource(R.string.clear)
)
}
} else {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
<string name="warning">Warning</string>
<string name="add">Add</string>
<string name="close">Close</string>
<string name="clear">Clear</string>
<string name="system">System</string>
<string name="light">Light</string>
<string name="dark">Dark</string>
Expand Down

0 comments on commit 21995df

Please sign in to comment.