Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save last used search request #80

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/projects/projects.gd
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func _load_projects_array(array):
await get_tree().process_frame
_projects_list.sort_items()
_update_remove_missing_disabled()
_projects_list._load_search_box_text()


func _refresh():
Expand Down
4 changes: 4 additions & 0 deletions src/components/projects/projects_list/projects_list.gd
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ func _fill_sort_options(btn: OptionButton):
var last_checked_sort = Cache.smart_value(self, "last_checked_sort", true)
btn.select(last_checked_sort.ret(1))
btn.item_selected.connect(func(idx): last_checked_sort.put(idx))


func _load_search_box_text() -> void:
set_search_box_text(Cache.smart_value(self, "project_list_search", true).ret(""))
2 changes: 2 additions & 0 deletions src/components/v_box_list/v_box_list.gd
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func _update_theme():

func set_search_box_text(text):
_search_box.text = text
Cache.smart_value(self, "project_list_search", true).put(_search_box.text)
_update_filters()


Expand Down Expand Up @@ -94,6 +95,7 @@ func _select_item(item):


func _on_search_box_text_changed(_new_text: String) -> void:
Cache.smart_value(self, "project_list_search", true).put(_search_box.text)
_update_filters()


Expand Down