LibGUI: Always unhighlight table view column headers when cursor leaves

If the cursor left a table view column header while also pressing it,
we would keep the header highlighted. This was not consistent with how
regular buttons behaved.
This commit is contained in:
Andreas Kling 2020-02-12 19:35:25 +01:00
parent 29aee5e0d6
commit 0cdf68f668
Notes: sideshowbarker 2024-07-19 09:22:06 +09:00

View file

@ -274,10 +274,12 @@ void AbstractTableView::mousemove_event(MouseEvent& event)
if (m_pressed_column_header_index != -1) {
auto header_rect = this->header_rect(m_pressed_column_header_index);
if (header_rect.contains(event.position())) {
set_hovered_header_index(m_pressed_column_header_index);
if (!m_pressed_column_header_is_pressed)
update_headers();
m_pressed_column_header_is_pressed = true;
} else {
set_hovered_header_index(-1);
if (m_pressed_column_header_is_pressed)
update_headers();
m_pressed_column_header_is_pressed = false;