Skip to content

Commit

Permalink
🐛 Fix the issue that the pasteboard type selection in the search bar …
Browse files Browse the repository at this point in the history
…does not exclude selected types (#1282)
  • Loading branch information
guiyanakuang authored Jun 23, 2024
1 parent 4bb1120 commit 9f31a60
Showing 1 changed file with 44 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,39 +369,58 @@ fun ClipeverySearchWindow() {
clipSearchService.setClipType(null)
currentType = "All_Types"
showTypes = false
focusRequester.requestFocus()
}
Divider()
}

MenuItem(copywriter.getText("Text"), textStyle, paddingValues) {
clipSearchService.setClipType(ClipType.TEXT)
currentType = "Text"
showTypes = false
focusRequester.requestFocus() // keep textField focus
if (currentType != "Text") {
MenuItem(copywriter.getText("Text"), textStyle, paddingValues) {
clipSearchService.setClipType(ClipType.TEXT)
currentType = "Text"
showTypes = false
focusRequester.requestFocus() // keep textField focus
}
}
MenuItem(copywriter.getText("Link"), textStyle, paddingValues) {
clipSearchService.setClipType(ClipType.URL)
currentType = "Link"
showTypes = false
focusRequester.requestFocus() // keep textField focus

if (currentType != "Link") {
MenuItem(copywriter.getText("Link"), textStyle, paddingValues) {
clipSearchService.setClipType(ClipType.URL)
currentType = "Link"
showTypes = false
focusRequester.requestFocus() // keep textField focus
}
}
MenuItem(copywriter.getText("Html"), textStyle, paddingValues) {
clipSearchService.setClipType(ClipType.HTML)
currentType = "Html"
showTypes = false
focusRequester.requestFocus() // keep textField focus

if (currentType != "Html") {
MenuItem(copywriter.getText("Html"), textStyle, paddingValues) {
clipSearchService.setClipType(ClipType.HTML)
currentType = "Html"
showTypes = false
focusRequester.requestFocus() // keep textField focus
}
}
MenuItem(copywriter.getText("Image"), textStyle, paddingValues) {
clipSearchService.setClipType(ClipType.IMAGE)
currentType = "Image"
showTypes = false
focusRequester.requestFocus() // keep textField focus

if (currentType != "Image") {
MenuItem(
copywriter.getText("Image"),
textStyle,
paddingValues,
) {
clipSearchService.setClipType(ClipType.IMAGE)
currentType = "Image"
showTypes = false
focusRequester.requestFocus() // keep textField focus
}
}
MenuItem(copywriter.getText("File"), textStyle, paddingValues) {
clipSearchService.setClipType(ClipType.FILE)
currentType = "File"
showTypes = false
focusRequester.requestFocus() // keep textField focus

if (currentType != "File") {
MenuItem(copywriter.getText("File"), textStyle, paddingValues) {
clipSearchService.setClipType(ClipType.FILE)
currentType = "File"
showTypes = false
focusRequester.requestFocus() // keep textField focus
}
}
}
}
Expand Down

0 comments on commit 9f31a60

Please sign in to comment.