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



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36408 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rene Gollent 2010-04-22 02:02:55 +00:00
parent 3fe663e009
commit 01e63caf83
2 changed files with 7 additions and 4 deletions

View File

@ -1653,7 +1653,7 @@ BPoseView::AddPosesThreadValid(const entry_ref *ref) const
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 @@ BPoseView::AddPoseToList(PoseList *list, bool visibleList, bool insertionSort,
if (viewBounds.Intersects(poseBounds))
SynchronousUpdate(poseBounds);
}
if (indexPtr)
*indexPtr = poseIndex;
}
@ -1793,11 +1796,11 @@ BPoseView::CreatePoses(Model **models, PoseInfo *poseInfoArray, int32 count,
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;

View File

@ -446,7 +446,7 @@ class BPoseView : public BView {
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,