Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(783)

Unified Diff: ui/views/controls/table/table_view.h

Issue 2146033003: TableView: 3-phase ToggleSortOrder (sorted/reversed/unsorted) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sky's fixes. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/new_task_manager_view.cc ('k') | ui/views/controls/table/table_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/table/table_view.h
diff --git a/ui/views/controls/table/table_view.h b/ui/views/controls/table/table_view.h
index fc7f028164b02290c2163a4e74dc88f2acd65c6a..3c2e954e7379ee768e3df6b6616356fd94ab4ec5 100644
--- a/ui/views/controls/table/table_view.h
+++ b/ui/views/controls/table/table_view.h
@@ -154,10 +154,17 @@ class VIEWS_EXPORT TableView
// Sets the width of the column. |index| is in terms of |visible_columns_|.
void SetVisibleColumnWidth(int index, int width);
- // Toggles the sort order of the specified visible column index.
+ // Modify the table sort order, depending on a clicked column and the previous
+ // table sort order. Does nothing if this column is not sortable.
+ //
+ // When called repeatedly on the same sortable column, the sort order will
+ // cycle through three states in order: sorted -> reverse-sorted -> unsorted.
+ // When switching from one sort column to another, the previous sort column
+ // will be remembered and used as a secondary sort key.
void ToggleSortOrder(int visible_column_index);
const SortDescriptors& sort_descriptors() const { return sort_descriptors_; }
+ void SetSortDescriptors(const SortDescriptors& descriptors);
bool is_sorted() const { return !sort_descriptors_.empty(); }
// Maps from the index in terms of the model to that of the view.
@@ -227,9 +234,6 @@ class VIEWS_EXPORT TableView
// Invoked when the number of rows changes in some way.
void NumRowsChanged();
- // Resets the sort descriptions.
- void SetSortDescriptors(const SortDescriptors& sort_descriptors);
-
// Does the actual sort and updates the mappings (|view_to_model_| and
// |model_to_view_|) appropriately.
void SortItemsAndUpdateMapping();
« no previous file with comments | « chrome/browser/ui/views/new_task_manager_view.cc ('k') | ui/views/controls/table/table_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698