mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +00:00
SystemMonitor: Keep current process selection expanded if needed
This is a hack until persistent model indices work.
This commit is contained in:
parent
0a61b45b64
commit
600596fbae
1 changed files with 9 additions and 0 deletions
|
@ -408,7 +408,16 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
auto& refresh_timer = window->add<Core::Timer>(
|
||||
frequency * 1000, [&] {
|
||||
// FIXME: remove the primitive re-toggling code once persistent model indices work.
|
||||
auto toggled_indices = process_table_view.selection().indices();
|
||||
toggled_indices.remove_all_matching([&](auto const& index) { return !process_table_view.is_toggled(index); });
|
||||
process_model->update();
|
||||
if (!process_table_view.selection().is_empty())
|
||||
process_table_view.selection().for_each_index([&](auto& selection) {
|
||||
if (toggled_indices.contains_slow(selection))
|
||||
process_table_view.expand_all_parents_of(selection);
|
||||
});
|
||||
|
||||
if (auto* memory_stats_widget = SystemMonitor::MemoryStatsWidget::the())
|
||||
memory_stats_widget->refresh();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue