1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:48:11 +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:
Tom 2020-10-20 15:13:28 -06:00 committed by Andreas Kling
parent 307f0bc778
commit 52a847a0eb
13 changed files with 244 additions and 19 deletions

View file

@ -150,7 +150,9 @@ public:
virtual bool accepts_drag(const ModelIndex&, const StringView& data_type) override;
virtual bool is_column_sortable(int column_index) const override { return column_index != Column::Icon; }
virtual bool is_editable(const ModelIndex&) const override;
virtual bool is_searchable() const override { return true; }
virtual void set_data(const ModelIndex&, const Variant&) override;
virtual Vector<ModelIndex, 1> matches(const StringView&, unsigned = MatchesFlag::AllMatching, const ModelIndex& = ModelIndex()) override;
static String timestamp_string(time_t timestamp)
{