summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/AbstractTableView.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-21 19:45:15 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-21 19:55:44 +0200
commitc666c251c89f9d63a4855494cc2cf0f92e524db0 (patch)
treee4a76d4cdf785fe571ea67219421430782773354 /Libraries/LibGUI/AbstractTableView.cpp
parent2e03bded43344d4dd2d4f19d4d963646aaa77e40 (diff)
downloadserenity-c666c251c89f9d63a4855494cc2cf0f92e524db0.zip
LibGUI: Replace ColumnMetadata::sortable => Model::is_column_sortable()
Now there's only one thing left in ColumnMetadata: the initial width.
Diffstat (limited to 'Libraries/LibGUI/AbstractTableView.cpp')
-rw-r--r--Libraries/LibGUI/AbstractTableView.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/Libraries/LibGUI/AbstractTableView.cpp b/Libraries/LibGUI/AbstractTableView.cpp
index eb1ce70485..094f637d01 100644
--- a/Libraries/LibGUI/AbstractTableView.cpp
+++ b/Libraries/LibGUI/AbstractTableView.cpp
@@ -150,7 +150,7 @@ void AbstractTableView::paint_headers(Painter& painter)
bool is_key_column = model()->key_column() == column_index;
Gfx::Rect cell_rect(x_offset, 0, column_width + horizontal_padding() * 2, header_height());
bool pressed = column_index == m_pressed_column_header_index && m_pressed_column_header_is_pressed;
- bool hovered = column_index == m_hovered_column_header_index && model()->column_metadata(column_index).sortable == Model::ColumnMetadata::Sortable::True;
+ bool hovered = column_index == m_hovered_column_header_index && model()->is_column_sortable(column_index);
Gfx::StylePainter::paint_button(painter, cell_rect, palette(), Gfx::ButtonStyle::Normal, pressed, hovered);
String text;
if (is_key_column) {
@@ -372,8 +372,7 @@ void AbstractTableView::mousedown_event(MouseEvent& event)
return;
}
auto header_rect = this->header_rect(i);
- auto column_metadata = model()->column_metadata(i);
- if (header_rect.contains(horizontally_adjusted_position) && column_metadata.sortable == Model::ColumnMetadata::Sortable::True) {
+ if (header_rect.contains(horizontally_adjusted_position) && model()->is_column_sortable(i)) {
m_pressed_column_header_index = i;
m_pressed_column_header_is_pressed = true;
update_headers();