mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Search improvements
This commit is contained in:
@@ -30,16 +30,10 @@ struct SearchSuggestions: View {
|
||||
HStack {
|
||||
Image(systemName: "magnifyingglass")
|
||||
HStack(spacing: 0) {
|
||||
if suggestion.hasPrefix(state.suggestionsText.lowercased()) {
|
||||
Text(state.suggestionsText.lowercased())
|
||||
.lineLimit(1)
|
||||
.layoutPriority(2)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
|
||||
Text(querySuffix(suggestion))
|
||||
Text(suggestion)
|
||||
.lineLimit(1)
|
||||
.layoutPriority(1)
|
||||
.truncationMode(.head)
|
||||
.frame(minWidth: 0, maxWidth: .infinity, alignment: .leading)
|
||||
.contentShape(Rectangle())
|
||||
}
|
||||
@@ -90,10 +84,6 @@ struct SearchSuggestions: View {
|
||||
}
|
||||
}
|
||||
|
||||
private func querySuffix(_ suggestion: String) -> String {
|
||||
suggestion.replacingFirstOccurrence(of: state.suggestionsText.lowercased(), with: "")
|
||||
}
|
||||
|
||||
#if os(macOS)
|
||||
private func onHover(_ inside: Bool) {
|
||||
if inside {
|
||||
|
Reference in New Issue
Block a user