mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibGUI: Make model sorting imperative and move order to AbstractView
Instead of SortingProxyModel having a column+order, we move that state to AbstractView. When you click on a column header, the view tells the model to resort the relevant column with the new order. This is implemented in SortingProxyModel by simply walking all the reified source/proxy mappings and resorting their row indexes.
This commit is contained in:
parent
370624bc37
commit
e1ed71ef9e
Notes:
sideshowbarker
2024-07-19 03:33:29 +09:00
Author: https://github.com/awesomekling
Commit: e1ed71ef9e
15 changed files with 85 additions and 55 deletions
|
@ -179,7 +179,7 @@ int main(int argc, char** argv)
|
|||
auto& process_table_view = process_table_container.add<GUI::TableView>();
|
||||
process_table_view.set_headers_visible(true);
|
||||
process_table_view.set_model(GUI::SortingProxyModel::create(ProcessModel::create()));
|
||||
process_table_view.model()->set_key_column_and_sort_order(ProcessModel::Column::CPU, GUI::SortOrder::Descending);
|
||||
process_table_view.set_key_column_and_sort_order(ProcessModel::Column::CPU, GUI::SortOrder::Descending);
|
||||
process_table_view.model()->update();
|
||||
|
||||
auto& refresh_timer = window->add<Core::Timer>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue