mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 17:28:48 +00:00
LibGUI: Implement searching/jumping as you type in views
This allows the user to start typing and highlighting and jumping to a match in ColumnsView, IconView, TableView and TreeView if the model supports it.
This commit is contained in:
parent
307f0bc778
commit
52a847a0eb
Notes:
sideshowbarker
2024-07-19 01:48:54 +09:00
Author: https://github.com/tomuta
Commit: 52a847a0eb
Pull-request: https://github.com/SerenityOS/serenity/pull/3808
Reviewed-by: https://github.com/awesomekling
13 changed files with 244 additions and 19 deletions
|
@ -295,4 +295,17 @@ void SortingProxyModel::set_data(const ModelIndex& proxy_index, const Variant& d
|
|||
source().set_data(map_to_source(proxy_index), data);
|
||||
}
|
||||
|
||||
bool SortingProxyModel::is_searchable() const
|
||||
{
|
||||
return source().is_searchable();
|
||||
}
|
||||
|
||||
Vector<ModelIndex, 1> SortingProxyModel::matches(const StringView& searching, unsigned flags, const ModelIndex& proxy_index)
|
||||
{
|
||||
auto found_indexes = source().matches(searching, flags, map_to_source(proxy_index));
|
||||
for (size_t i = 0; i < found_indexes.size(); i++)
|
||||
found_indexes[i] = map_to_proxy(found_indexes[i]);
|
||||
return found_indexes;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue