Prechádzať zdrojové kódy

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.
Andreas Kling 5 rokov pred
rodič
commit
0cdf68f668
1 zmenil súbory, kde vykonal 2 pridanie a 0 odobranie
  1. 2 0
      Libraries/LibGUI/AbstractTableView.cpp

+ 2 - 0
Libraries/LibGUI/AbstractTableView.cpp

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