ios: show clear search button when search is not empty (#3627)
This commit is contained in:
parent
644169b835
commit
4ab078bd18
@ -289,16 +289,16 @@ struct ChatListSearchBar: View {
|
|||||||
HStack(spacing: 4) {
|
HStack(spacing: 4) {
|
||||||
Image(systemName: "magnifyingglass")
|
Image(systemName: "magnifyingglass")
|
||||||
TextField("Search or paste SimpleX link", text: $searchText)
|
TextField("Search or paste SimpleX link", text: $searchText)
|
||||||
|
.foregroundColor(searchShowingSimplexLink ? .secondary : .primary)
|
||||||
.disabled(searchShowingSimplexLink)
|
.disabled(searchShowingSimplexLink)
|
||||||
.focused($searchFocussed)
|
.focused($searchFocussed)
|
||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
if searchFocussed || searchShowingSimplexLink {
|
if !searchText.isEmpty {
|
||||||
Image(systemName: "xmark.circle.fill")
|
Image(systemName: "xmark.circle.fill")
|
||||||
.opacity(searchText == "" ? 0 : 1)
|
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
searchText = ""
|
searchText = ""
|
||||||
}
|
}
|
||||||
} else if searchText == "" {
|
} else if !searchFocussed {
|
||||||
HStack(spacing: 24) {
|
HStack(spacing: 24) {
|
||||||
if m.pasteboardHasStrings {
|
if m.pasteboardHasStrings {
|
||||||
Image(systemName: "doc")
|
Image(systemName: "doc")
|
||||||
|
Loading…
Reference in New Issue
Block a user