make filter button easier to press

This commit is contained in:
spaced4ndy
2024-05-03 11:37:31 +04:00
parent 5f7c9108b8
commit 1fb3e98d11
+14 -6
View File
@@ -254,6 +254,11 @@ struct ChatsSearchBar: View {
searchFocussed = false
}
} else if m.chats.count > 0 {
// Text("Filter")
// .foregroundColor(.accentColor)
// .onTapGesture {
// showUnreadAndFavorites = !showUnreadAndFavorites
// }
toggleFilterButton()
}
}
@@ -296,13 +301,16 @@ struct ChatsSearchBar: View {
}
private func toggleFilterButton() -> some View {
Image(systemName: "line.3.horizontal.decrease.circle" + (showUnreadAndFavorites ? ".fill" : ""))
.resizable()
.foregroundColor(.accentColor)
.frame(width: 20, height: 20)
.onTapGesture {
showUnreadAndFavorites = !showUnreadAndFavorites
Button {
showUnreadAndFavorites = !showUnreadAndFavorites
} label: {
ZStack {
Color.clear
.frame(width: 30, height: 30)
Image(systemName: "line.3.horizontal.decrease.circle" + (showUnreadAndFavorites ? ".fill" : ""))
.foregroundColor(.accentColor)
}
}
}
private func connect(_ link: String) {