浏览代码

LibGUI: Respect the previously selected sort order in HeaderView (#3522)

Instead of forcefully setting the sort order to Ascending upon column
sort, setting it to the previously selected sort order
Uma Sankar 4 年之前
父节点
当前提交
d7673b41ef
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Libraries/LibGUI/HeaderView.cpp

+ 1 - 1
Libraries/LibGUI/HeaderView.cpp

@@ -206,7 +206,7 @@ void HeaderView::mouseup_event(MouseEvent& event)
         }
         }
         if (m_pressed_section != -1) {
         if (m_pressed_section != -1) {
             if (m_orientation == Gfx::Orientation::Horizontal && section_rect(m_pressed_section).contains(event.position())) {
             if (m_orientation == Gfx::Orientation::Horizontal && section_rect(m_pressed_section).contains(event.position())) {
-                auto new_sort_order = SortOrder::Ascending;
+                auto new_sort_order = m_table_view.sort_order();
                 if (m_table_view.key_column() == m_pressed_section)
                 if (m_table_view.key_column() == m_pressed_section)
                     new_sort_order = m_table_view.sort_order() == SortOrder::Ascending
                     new_sort_order = m_table_view.sort_order() == SortOrder::Ascending
                         ? SortOrder::Descending
                         ? SortOrder::Descending