banshee r4549 - in trunk/banshee: . src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView



Author: gburt
Date: Mon Sep 15 21:50:53 2008
New Revision: 4549
URL: http://svn.gnome.org/viewvc/banshee?rev=4549&view=rev

Log:
2008-09-15  Gabriel Burt  <gabriel burt gmail com>

	* src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs: Bring
	back logic that scrolls to the first selected item when the view is
	refreshed unless it's already in the view (BGO #551970).



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs	Mon Sep 15 21:50:53 2008
@@ -80,6 +80,19 @@
             } else if (Model.Count <= RowsInView) {
                 // If our view fits all rows at once, make sure we're scrolled to the top
                 ScrollTo (0.0);
+            } else if (Selection != null && Selection.Count > 0 && !Selection.AllSelected) {
+                bool selection_in_view = false;
+                int first_row = GetRowAtY (0);
+                for (int i = 0; i < RowsInView; i++) {
+                    if (Selection.Contains (first_row + i)) {
+                        selection_in_view = true;
+                        break;
+                    }
+                }
+
+                if (!selection_in_view) {
+                    CenterOn (Selection.Ranges[0].Start);
+                }
             } else if (vadjustment != null) {
                 ScrollTo (vadjustment.Value);
             }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]