Add indicator when item has an exact match
This commit is contained in:
parent
f873950bc0
commit
44147869c4
@ -230,7 +230,14 @@ class BrowsePage(rio.Component):
|
||||
checkout = item["checkout_user"] + " - " + loc
|
||||
else:
|
||||
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,
|
||||
code=item["barcode"])))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user