Add indicator when item has an exact match

master
Cole Deck 3 weeks ago
parent f873950bc0
commit 44147869c4

@ -230,7 +230,14 @@ class BrowsePage(rio.Component):
checkout = item["checkout_user"] + " - " + loc checkout = item["checkout_user"] + " - " + loc
else: else:
checkout = loc checkout = loc
searchview.add(rio.SimpleListItem(text=item["fullname"],secondary_text=(item["manufacturer"] + " - Serial: " + item["serial"] + "\n" + checkout), on_press=functools.partial( icon = None
if len(self.searchtext) > 2:
for key, val in item.items():
if val == self.searchtext:
# if the search has an exact match anywhere
icon=rio.Icon("material/stars", fill=rio.Color.from_hex("#3FBF3F"))
searchview.add(rio.SimpleListItem(text=item["fullname"],secondary_text=(item["manufacturer"] + " - Serial: " + item["serial"] + "\n" + checkout), left_child=icon, on_press=functools.partial(
self.click_item_dialog, self.click_item_dialog,
code=item["barcode"]))) code=item["barcode"])))

Loading…
Cancel
Save