Rework the Search popup and highlight what matched
- The search field is a single-line field, so Enter no longer adds a
line break that made every search come up empty.
- The field, button and list use real font sizes from the theme instead
of being drawn at half size and scaled up, so the text is sharp, and
everything fits inside the panel.
- Results have alternating row backgrounds like the other lists, a count
("3 of 1045 soundtracks") and a message when nothing matches.
- The letters that matched are highlighted.
- Searches shorter than Settings.LETTERS_FOR_LOOSE_SEARCH (3) only find
names that contain the text, instead of names with the letters far
apart, which matched most of the library. The Statistics tab uses the
same search.
This commit is contained in:
1 parent
13fdb3f68c
commit
845d08c260
12 files changed
+2063
-808
No files matched your search
@@ -103,12 +103,12 @@ func test_button_works_again_after_popup_closed() -> void:
|
||||
func test_closing_search_clears_the_search() -> void:
|
||||
var search: BasePopup = _popup("SearchPopup")
|
||||
search.open()
|
||||
var search_bar: TextEdit = search.get_node("Searchbar")
|
||||
search_bar.text = "mario"
|
||||
var search_field: LineEdit = search.search_field
|
||||
search_field.text = "mario"
|
||||
|
||||
search.close()
|
||||
|
||||
assert_str(search_bar.text).is_empty()
|
||||
assert_str(search_field.text).is_empty()
|
||||
|
||||
|
||||
func test_closing_character_select_allows_song_clicks_again() -> void:
|
||||
@@ -129,3 +129,4 @@ func test_toggle_opens_and_closes() -> void:
|
||||
|
||||
shortcuts.toggle()
|
||||
assert_bool(shortcuts.visible).is_false()
|
||||
|
||||
Reference in new issue
Block a user