[Haiku-commits] r31268 - haiku/trunk/src/kits/interface

bonefish at BerliOS bonefish at mail.berlios.de
Sat Jun 27 18:39:47 CEST 2009


Author: bonefish
Date: 2009-06-27 18:39:42 +0200 (Sat, 27 Jun 2009)
New Revision: 31268
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31268&view=rev

Modified:
   haiku/trunk/src/kits/interface/ColumnListView.cpp
Log:
Made ScrollTo(BRow*) more useful. Now it only scrolls, if the row isn't fully
visible and it only scrolls as much as necessary.


Modified: haiku/trunk/src/kits/interface/ColumnListView.cpp
===================================================================
--- haiku/trunk/src/kits/interface/ColumnListView.cpp	2009-06-27 14:24:55 UTC (rev 31267)
+++ haiku/trunk/src/kits/interface/ColumnListView.cpp	2009-06-27 16:39:42 UTC (rev 31268)
@@ -4428,8 +4428,13 @@
 OutlineView::ScrollTo(const BRow* row)
 {
 	BRect rect;
-	if (FindRect(row, &rect))
-		ScrollTo(BPoint(rect.left, rect.top));
+	if (FindRect(row, &rect)) {
+		BRect bounds = Bounds();
+		if (rect.top < bounds.top)
+			ScrollTo(BPoint(bounds.left, rect.top));
+		else if (rect.bottom > bounds.bottom)
+			ScrollBy(0, rect.bottom - bounds.bottom);
+	}
 }
 
 




More information about the Haiku-commits mailing list