[banshee] [ListView]Don't change direction when changing sorting columns (bgo#590869)
- From: Alexander Kojevnikov <alexk src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [banshee] [ListView]Don't change direction when changing sorting columns (bgo#590869)
- Date: Wed, 11 Nov 2009 22:37:07 +0000 (UTC)
commit 129e1043f93470cedc67dde4e9ee9b5d0701b482
Author: Alexander Kojevnikov <alexander kojevnikov com>
Date: Thu Nov 12 09:35:12 2009 +1100
[ListView]Don't change direction when changing sorting columns (bgo#590869)
.../Hyena.Data.Gui/ListView/ListView_Header.cs | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs b/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs
index 4813458..6450d57 100644
--- a/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs
+++ b/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs
@@ -271,14 +271,16 @@ namespace Hyena.Data.Gui
ISortable sortable = Model as ISortable;
// Change the sort-type with every click
- switch (sort_column.SortType) {
- case SortType.Ascending: sort_column.SortType = SortType.Descending; break;
- case SortType.Descending: sort_column.SortType = SortType.None; break;
- case SortType.None: sort_column.SortType = SortType.Ascending; break;
+ if (sort_column == ColumnController.SortColumn) {
+ switch (sort_column.SortType) {
+ case SortType.Ascending: sort_column.SortType = SortType.Descending; break;
+ case SortType.Descending: sort_column.SortType = SortType.None; break;
+ case SortType.None: sort_column.SortType = SortType.Ascending; break;
+ }
}
- // If we're switching to a different column or we aren't reorderable and the type is None, sort Ascending
- if (sort_column != ColumnController.SortColumn || (!IsEverReorderable && sort_column.SortType == SortType.None)) {
+ // If we're switching from a different column, or we aren't reorderable, make sure sort type isn't None
+ if ((sort_column != ColumnController.SortColumn || !IsEverReorderable) && sort_column.SortType == SortType.None) {
sort_column.SortType = SortType.Ascending;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]