GTableView: Don't hover-highlight unsortable column headers

The hover highlight is meant to indicate that the button is pressable.
Non-sortable columns are not pressable.
This commit is contained in:
Andreas Kling 2019-11-20 22:22:51 +01:00
parent 16c290e8d5
commit e08d605f72

View file

@ -397,7 +397,7 @@ void GTableView::paint_headers(Painter& painter)
bool is_key_column = model()->key_column() == column_index;
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;
bool hovered = column_index == m_hovered_column_header_index && model()->column_metadata(column_index).sortable == GModel::ColumnMetadata::Sortable::True;
StylePainter::paint_button(painter, cell_rect, ButtonStyle::Normal, pressed, hovered);
String text;
if (is_key_column) {