mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-24 02:09:28 +00:00
GTableView: add 'sortable' column header flag.
This prevents sorting unsortable by unsortable things, like icons.
This commit is contained in:
@@ -158,7 +158,8 @@ void GTableView::mousedown_event(GMouseEvent& event)
|
||||
return;
|
||||
}
|
||||
auto header_rect = this->header_rect(i);
|
||||
if (header_rect.contains(event.position())) {
|
||||
auto column_metadata = model()->column_metadata(i);
|
||||
if (header_rect.contains(event.position()) && column_metadata.sortable) {
|
||||
auto new_sort_order = GSortOrder::Ascending;
|
||||
if (model()->key_column() == i)
|
||||
new_sort_order = model()->sort_order() == GSortOrder::Ascending
|
||||
|
||||
Reference in New Issue
Block a user