[haiku-commits] r36408 - haiku/trunk/src/kits/tracker

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 22 Apr 2010 04:02:55 +0200 (CEST)

Author: anevilyak
Date: 2010-04-22 04:02:55 +0200 (Thu, 22 Apr 2010)
New Revision: 36408
Changeset: http://dev.haiku-os.org/changeset/36408/haiku
Ticket: http://dev.haiku-os.org/ticket/5774

Modified:
   haiku/trunk/src/kits/tracker/PoseView.cpp
   haiku/trunk/src/kits/tracker/PoseView.h
Log:
When creating a new pose, the index offset at which it was inserted in list 
mode was never passed back. Consequently, when creating a new folder via the 
cmd+N shortcut (which immediately goes into edit mode), the TextWidget for 
editing would appear at the wrong location.

Fixes ticket #5774.

+alphabranch



Modified: haiku/trunk/src/kits/tracker/PoseView.cpp
===================================================================
--- haiku/trunk/src/kits/tracker/PoseView.cpp   2010-04-21 22:21:48 UTC (rev 
36407)
+++ haiku/trunk/src/kits/tracker/PoseView.cpp   2010-04-22 02:02:55 UTC (rev 
36408)
@@ -1653,7 +1653,7 @@
 
 void
 BPoseView::AddPoseToList(PoseList *list, bool visibleList, bool insertionSort,
-       BPose *pose, BRect &viewBounds, float &listViewScrollBy, bool forceDraw)
+       BPose *pose, BRect &viewBounds, float &listViewScrollBy, bool 
forceDraw, int32 *indexPtr)
 {
        int32 poseIndex = list->CountItems();
 
@@ -1732,6 +1732,9 @@
                if (viewBounds.Intersects(poseBounds))
                        SynchronousUpdate(poseBounds);
        }
+       
+       if (indexPtr)
+               *indexPtr = poseIndex;
 }
 
 
@@ -1793,11 +1796,11 @@
                        case kListMode:
                        {
                                AddPoseToList(fPoseList, !fFiltering, 
insertionSort, pose,
-                                       viewBounds, listViewScrollBy, 
forceDraw);
+                                       viewBounds, listViewScrollBy, 
forceDraw, &poseIndex);
 
                                if (fFiltering && FilterPose(pose)) {
                                        AddPoseToList(fFilteredPoseList, true, 
insertionSort, pose,
-                                               viewBounds, listViewScrollBy, 
forceDraw);
+                                               viewBounds, listViewScrollBy, 
forceDraw, &poseIndex);
                                }
 
                                break;

Modified: haiku/trunk/src/kits/tracker/PoseView.h
===================================================================
--- haiku/trunk/src/kits/tracker/PoseView.h     2010-04-21 22:21:48 UTC (rev 
36407)
+++ haiku/trunk/src/kits/tracker/PoseView.h     2010-04-22 02:02:55 UTC (rev 
36408)
@@ -446,7 +446,7 @@
 
                void AddPoseToList(PoseList *list, bool visibleList, bool 
insertionSort,
                        BPose *pose, BRect &viewBounds, float &listViewScrollBy,
-                       bool forceDraw);
+                       bool forceDraw, int32 *indexPtr = NULL);
                BPose *CreatePose(Model *, PoseInfo *, bool insertionSort = 
true,
                        int32 *index = 0, BRect *boundsPtr = 0, bool forceDraw 
= true);
                virtual void CreatePoses(Model **models, PoseInfo 
*poseInfoArray, int32 count,


Other related posts: