1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:57:45 +00:00

LibGUI: Add a DontResizeColumns option to Model::UpdateFlag

This allows an application to signal that column sizes do not
need to be recalculated for a given model update.
This commit is contained in:
Tim Ledbetter 2023-02-09 19:21:57 +00:00 committed by Ali Mohammad Pur
parent 99570cb0c4
commit 59855e49df
2 changed files with 4 additions and 1 deletions

View file

@ -352,7 +352,9 @@ void AbstractTableView::model_did_update(unsigned flags)
{ {
AbstractView::model_did_update(flags); AbstractView::model_did_update(flags);
update_row_sizes(); update_row_sizes();
update_column_sizes(); if (!(flags & Model::UpdateFlag::DontResizeColumns))
update_column_sizes();
update_content_size(); update_content_size();
update(); update();
} }

View file

@ -51,6 +51,7 @@ public:
enum UpdateFlag { enum UpdateFlag {
DontInvalidateIndices = 0, DontInvalidateIndices = 0,
InvalidateAllIndices = 1 << 0, InvalidateAllIndices = 1 << 0,
DontResizeColumns = 1 << 1,
}; };
enum MatchesFlag { enum MatchesFlag {