mirror of
https://github.com/GradienceTeam/Gradience.git
synced 2024-08-23 16:02:33 +00:00
fix: search dropdown (#406)
This commit is contained in:
parent
fb6c1dbae0
commit
85d3f5b3a7
1 changed files with 14 additions and 14 deletions
|
@ -101,6 +101,7 @@ class GradiencePresetWindow(Adw.Window):
|
||||||
|
|
||||||
def setup_signals(self):
|
def setup_signals(self):
|
||||||
self.search_entry.connect("search-changed", self.on_search_changed)
|
self.search_entry.connect("search-changed", self.on_search_changed)
|
||||||
|
self.search_dropdown.connect("notify", self.on_search_changed)
|
||||||
self.search_entry.connect("stop-search", self.on_search_ended)
|
self.search_entry.connect("stop-search", self.on_search_ended)
|
||||||
|
|
||||||
def setup_builtin_presets(self):
|
def setup_builtin_presets(self):
|
||||||
|
@ -231,25 +232,24 @@ class GradiencePresetWindow(Adw.Window):
|
||||||
buglog(f"Search string: {search_text}")
|
buglog(f"Search string: {search_text}")
|
||||||
buglog("Items found:")
|
buglog("Items found:")
|
||||||
for widget in self.search_results_list:
|
for widget in self.search_results_list:
|
||||||
if search_text == "":
|
widget.props.visible = False
|
||||||
widget.props.visible = True
|
if not (
|
||||||
else:
|
self.search_dropdown.props.selected_item.get_string().lower()
|
||||||
widget.props.visible = False
|
in "all"
|
||||||
|
):
|
||||||
if (
|
if (
|
||||||
not self.search_dropdown.props.selected_item.get_string().lower()
|
self.search_dropdown.props.selected_item.get_string().lower()
|
||||||
in "all"
|
in widget.prefix.lower()
|
||||||
):
|
):
|
||||||
if (
|
|
||||||
self.search_dropdown.props.selected_item.get_string().lower()
|
|
||||||
in widget.prefix.lower()
|
|
||||||
):
|
|
||||||
if search_text.lower() in widget.props.title.lower():
|
|
||||||
widget.props.visible = True
|
|
||||||
buglog(widget.props.title)
|
|
||||||
else:
|
|
||||||
if search_text.lower() in widget.props.title.lower():
|
if search_text.lower() in widget.props.title.lower():
|
||||||
widget.props.visible = True
|
widget.props.visible = True
|
||||||
buglog(widget.props.title)
|
buglog(widget.props.title)
|
||||||
|
else:
|
||||||
|
if search_text.lower() in widget.props.title.lower():
|
||||||
|
widget.props.visible = True
|
||||||
|
buglog(widget.props.title)
|
||||||
|
elif search_text == "":
|
||||||
|
widget.props.visible = True
|
||||||
|
|
||||||
def on_search_ended(self, *args):
|
def on_search_ended(self, *args):
|
||||||
for widget in self.search_results_list:
|
for widget in self.search_results_list:
|
||||||
|
|
Loading…
Reference in a new issue