mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 09:46:04 -05:00
LibGUI: Set ProcessChooser key column and sort order after set_model (#3521)
Need to set the sort order after model was set to sort the table.
This commit is contained in:
parent
d7673b41ef
commit
19f2203b53
Notes:
sideshowbarker
2024-07-19 02:21:59 +09:00
Author: https://github.com/umasankar-yedida Commit: https://github.com/SerenityOS/serenity/commit/19f2203b53d Pull-request: https://github.com/SerenityOS/serenity/pull/3521
1 changed files with 1 additions and 1 deletions
|
@ -58,8 +58,8 @@ ProcessChooser::ProcessChooser(const StringView& window_title, const StringView&
|
||||||
m_table_view = widget.add<GUI::TableView>();
|
m_table_view = widget.add<GUI::TableView>();
|
||||||
auto sorting_model = GUI::SortingProxyModel::create(RunningProcessesModel::create());
|
auto sorting_model = GUI::SortingProxyModel::create(RunningProcessesModel::create());
|
||||||
sorting_model->set_sort_role(GUI::ModelRole::Display);
|
sorting_model->set_sort_role(GUI::ModelRole::Display);
|
||||||
m_table_view->set_key_column_and_sort_order(RunningProcessesModel::Column::PID, GUI::SortOrder::Descending);
|
|
||||||
m_table_view->set_model(sorting_model);
|
m_table_view->set_model(sorting_model);
|
||||||
|
m_table_view->set_key_column_and_sort_order(RunningProcessesModel::Column::PID, GUI::SortOrder::Descending);
|
||||||
|
|
||||||
m_table_view->on_activation = [this](const ModelIndex& index) { set_pid_from_index_and_close(index); };
|
m_table_view->on_activation = [this](const ModelIndex& index) { set_pid_from_index_and_close(index); };
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue