mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 14:35:07 +00:00
LibGUI: Use a separate data role for the table model sorting order.
This allows data to be displayed nicely while sorting happens based on some underlying raw data. :^)
This commit is contained in:
parent
3681a402ba
commit
46caa2663b
11 changed files with 43 additions and 15 deletions
|
@ -108,7 +108,7 @@ void GTableView::mousedown_event(GMouseEvent& event)
|
|||
for (int i = 0; i < m_model->column_count(); ++i) {
|
||||
auto header_rect = this->header_rect(i);
|
||||
if (header_rect.contains(adjusted_position)) {
|
||||
auto new_sort_order = GSortOrder::Descending;
|
||||
auto new_sort_order = GSortOrder::Ascending;
|
||||
if (m_model->key_column() == i)
|
||||
new_sort_order = m_model->sort_order() == GSortOrder::Ascending ? GSortOrder::Descending : GSortOrder::Ascending;
|
||||
m_model->set_key_column_and_sort_order(i, new_sort_order);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue